liger_iris_pipeline.datamodels.model_base
Classes
|
The base data model for Liger and IRIS data products. |
- class liger_iris_pipeline.datamodels.model_base.LigerIRISDataModel(init=None, schema=None, memmap=False, pass_invalid_values=None, strict_validation=None, validate_on_assignment=None, validate_arrays=False, ignore_missing_extensions=True, **kwargs)[source]
Bases:
DataModel
The base data model for Liger and IRIS data products. This class should not be instantiated on its own.
- generate_filename(suffix: str | None = None) str [source]
Generates a filename for this model instance. See LigerIRISDataModel._generate_filename() for details.
- get_crds_parameters()[source]
Collect the parameters used by CRDS to select references for this model.
- Returns:
dict : the CRDS parameters
- get_primary_array_name()[source]
Returns the name “primary” array for this model, which controls the size of other arrays that are implicitly created. This is intended to be overridden in the subclasses if the primary array’s name is not “data”.
- static get_sem_id(jd: float) str [source]
- on_init(init)[source]
Hook invoked by the base class before returning a newly created model instance.
- on_save()[source]
Hook invoked by the base class before writing a model to a file (FITS or ASDF).
- save(filepath: str | None = None, filename: str | None = None, output_dir: str | None = None, suffix: str | None = None, **kwargs) str [source]
Save the model to a file.
- Args:
filepath (str, optional): The filepath to save to. Defaults to self._filepath. filename (str, optional): The filename to save to. Defaults to None. output_dir (str, optional): The directory to save to. Defaults to the directory of self._filepath, then os.getcwd(). suffix (str, optional): The suffix to add to the filename. Defaults to None.
- schema_url = 'https://oirlab.github.io/schemas/LigerIRISDataModel.schema'
The schema URI to validate the model against. If None, only basic validation of required metadata properties (filename, model_type) will occur.
- to_fits(**kwargs)[source]
Write the model to a FITS file using self._filepath as the output_path.
- Args:
kwargs: Additional arguments to pass to the fits.writeto() function.