lephare.process
Attributes
Functions
|
Run all required steps to produce photometric redshift estimates |
|
Calculate the zero point offsets for objects with spectroscopic redshifts |
|
Take an astropy table and return the arrays required for a run. |
|
Take a sed list and move it with the sed files to the work directory. |
Module Contents
- process(config, input, col_names=None, standard_names=False, filename=None, write_outputs=False)[source]
Run all required steps to produce photometric redshift estimates
- Parameters:
config (dict of lephare.keyword) – The configuration for the run
input (astropy.table.Table) – The input table which must satisfy column name requirements depending on other optional inputs.
col_names (list) – Input catalogue column names. We will use ordering to determine meaning
standard_names (bool) – If true we assume standard names.
filename (str) – Output file name for the output catalogue.
write_outputs (bool) – Whether to write the output spectra, PDF, and ascii file if specified in the config. By default these are not written to save space.
- Returns:
output (astropy.table.Table) – The output table.
photozlist (list of lephare.onesource) – List of lephare onesource objects.
- calculate_offsets_from_input(config, input, col_names=None, standard_names=False)[source]
Calculate the zero point offsets for objects with spectroscopic redshifts
We want to have this available as an independent method so that it can be called as a training stage prior to running at scale.
- Parameters:
config (dict of lephare.keyword) – The configuration for the run
input (astropy.table.Table) – The input table which must satisfy column name requirements depending on other optional inputs.
col_names (list) – Input catalogue column names. We will use ordering to determine meaning
standard_names (bool) – If true we assume standard names.
- Returns:
a0 – Offsets a0
- Return type:
np.array
- table_to_data(config, input, col_names=None, standard_names=False)[source]
Take an astropy table and return the arrays required for a run.
We assume that either the columns are in the standard LePHARE order or that the user provides the colnames in the standard order or they use a standard naming convention and set the standard_names=True
The column names are id, f_filtername, ferr_filtername (for all filters) and context, zspec, string_input.
- Parameters:
config (dict of lephare.keyword) – The config keymap. We need this to know if we have magnitudes or fluxes and to get the filter names.
input (astropy.table.Table) – The input catalogue.
col_names (list of str) – The column names in the default order.
standard_names (bool) – If this is set we assume a standard column naming convention.
- Returns:
id (np.array) – The object ids
flux (np.array) – The object fluxes or magnitudes
flux_err (np.array) – The flux or magnitude errors
context (np.array) – The context determining flux usage
zspec (np.array) – The spectroscopic redshifts.
string_input (np.array) – Additional notes as a string.
- load_sed_list(path_to_list, object_type, absolute_paths=False)[source]
Take a sed list and move it with the sed files to the work directory.
We want to be able to load SED lists from other sources. These may use absolute paths or relative to the list file. They must adopt the lepahre standard which is relative to the sed/$TYPE/ directory
- Parameters:
path_to_list (str) – The path to the SED list file. This can be absolute or relative.
object_type ({'STAR', 'GAL', 'QSO'}) – The type of object. Must be one of “STAR”, “GAL”, or “QSO”.
absolute_paths (bool) – Set to True if list of absolute paths and not relative to list file
- Returns:
new_config_val – The location of the new list file with respect to current LEPHAREWORK directory. This is the value to set in the config.
- Return type:
str