Roman Catalog Process
This module provides functionality for processing catalog data related to the Roman Space Telescope.
Module API
- class roman_photoz.roman_catalog_process.RomanCatalogProcess(config_filename: dict | str = '', model_filename: str = 'roman_model.pkl')
Bases:
objectA class to process Roman catalog data using rail and lephare.
- data
Dictionary to store the processed data.
- Type:
dict
- flux_cols
List of flux columns.
- Type:
list
- flux_err_cols
List of flux error columns.
- 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.
- Type:
str
- create_estimator_stage()
Create the estimator stage to find the best fits from the library.
- create_informer_stage()
Create the informer stage to generate the library of SEDs with various parameters.
- get_data(input_filename, fit_colname: str = 'segment_{}_flux', fit_err_colname: str = 'segment_{}_flux_err') Table
Fetch the data from the input file.
- Parameters:
input_filename (str, optional) – Name of the input file.
- Returns:
The catalog data.
- Return type:
Table
- 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.
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, 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.
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.”
- save_results(output_filename: str = None, output_format: str = 'parquet')
Save the results to the specified output file.
- Parameters:
output_filename (str, optional) – Name of the output file.
output_format (str, optional) – Format to save the results. Supported formats are “parquet” (default) and “asdf”.
- Raises:
ValueError – If there are no results to save.
- set_config_file(config_filename: dict | str = '')
Set the configuration file.
- Parameters:
config_filename (Union[dict, str], optional) – Path to the configuration file in JSON format or a configuration dictionary.
- update_input(input_filename)
- roman_photoz.roman_catalog_process.main()
Main function to process Roman catalog data.
Examples
Basic usage:
from roman_photoz.roman_catalog_process import process_catalog
process_catalog('input_catalog.fits', 'processed_catalog.fits')
Notes
This module follows the Roman Space Telescope data specifications v1.2.