Metallicity_Stack_Commons package

Common functions

Metallicity_Stack_Commons.dir_date(folder_name, path_init='', year=False, verbose=False, log=<Logger stdout_logger (INFO)>)

This function finds and returns the path to a directory named after the current date (MMDDYYYY). If the directory doesn’t exist yet, it creates a new directory named after the current date in the provided folder_name directory.

Originally from https://github.com/rafia37/Evolution-of-Galaxies/blob/master/general.py

Usage:

fitspath = dir_date(folder_name, year=True)

Parameters
  • folder_name (str) – Directory for date subdirectory will be in

  • path_init (str) – root path. Default: empty string

  • year (bool) – Indicate whether to include year in date folder. Default: False

  • verbose (bool) – Write verbose message to stdout. Default: file only

  • log (Logger) – logging.Logger object

Return type

str

Returns

Full path to the date directory

Metallicity_Stack_Commons.exclude_outliers(objno, verbose=False, log=<Logger stdout_logger (INFO)>)

Exclude spectra that are identified as outliers.

Generally this is because the spectra have very high S/N on the continuum.

Parameters
  • objno (Union[list, ndarray]) – Array of eight-digit identifier

  • verbose (bool) – Write verbose message to stdout. Default: file only

  • log (Logger) – logging.Logger object

Return type

ndarray

Returns

Array of zeros (not flagged) and ones (flagged

Metallicity_Stack_Commons.get_user(username=None, verbose=False, log=<Logger stdout_logger (INFO)>)

Get the corresponding path for a given username

Parameters
  • username (Optional[str]) – Optional input for username

  • verbose (bool) – Write verbose message to stdout. Default: file only

  • log (Logger) – logging.Logger object

Return type

str

Returns

Full path to the date directory