Roman Catalog Process
This module provides functionality for processing a Roman Telescope multiband catalog to obtain photometric redshifts for cataloged galaxies.
Module API
- class roman_photoz.roman_catalog_process.RomanCatalogProcess(config_filename: dict | str = '', model_filename: str = 'roman_model.pkl')
Bases:
objectA class to process a Roman Telescope multiband catalog data using rail and lephare.
- data
Dictionary to store the processed data.
- Type:
dict
- flux_cols
List of flux column names.
- Type:
list
- flux_err_cols
List of flux error column names.
- Type:
list
- inform_stage
Informer stage for creating the library of SEDs.
- Type:
RailStage
- estimated
Estimator stage for finding the best fits from the library.
- Type:
RailStage
- model_filename
Name of the pickle model file to use.
- Type:
str
- property informer_model_exists
Check if the informer model file exists.
- Returns:
True if the model file exists, False otherwise.
- Return type:
bool
- property informer_model_path
Get the path to the informer model file used.
The path is determined by checking the INFORMER_MODEL_PATH environment variable first, falling back to LEPHAREWORK if not set.
- Returns:
The path to the informer model file.
- Return type:
str
- process(input_filename, output_filename: str | None = None, output_format: str = 'parquet', fit_colname: str = 'segment_{}_flux', fit_err_colname: str = 'segment_{}_flux_err')
Process the Roman catalog data.
- Parameters:
input_filename (str) – Name of the input file.
output_filename (str, optional) – Name of the output file. If none is provided (default), the input file will be updated in place.
output_format (str, optional) – Format to save the results. Supported formats are “parquet” (default) and “asdf.”
flux_type (str, optional) – The type of flux to use for fitting. Options are “psf” (default), “kron”, “segment”, or “aperture.”
- roman_photoz.roman_catalog_process.main(argv=None)
Main function to process Roman catalog data.
Examples
For a quick start, we can use the roman-photoz CLI to create a Roman multiband
catalog containing 2000 simulated objects through the
roman-photoz-create-simulated-catalog command:
$ roman-photoz-create-simulated-catalog \
--output-path ./ \
--output-filename roman_photoz_simulated_catalog.parquet \
--nobj 2000
Then, use the RomanCatalogProcess class to process the catalog and estimate
the redshifts through the roman-photoz command:
$ roman-photoz \
--input-filename roman_photoz_simulated_catalog.parquet \
--output-filename roman_photoz_results.parquet \
--fit-colname segment_{}_flux \
--fit-err-colname segment_{}_flux_err
Note that if no output filename is provided, as in the following example, the input file will be updated with the results instead:
# run roman-photoz and update the input file with the results
$ roman-photoz \
--input-filename roman_photoz_simulated_catalog.parquet \
--fit-colname segment_{}_flux \
--fit-err-colname segment_{}_flux_err
Additional examples of how to use this module can be found in the Usage section.