Product module
Contents
Product module¶
The product
module holds the Product
class, the Instrument Product classes
inherating from the Product class, and PLFParser
and
ProductFactory
classes, respectively used to parse an input PLF file and create
corresponding valid Product objects.
props_dict
¶
A product properties dictionary typically comes from parsing a PLF file. It must contain the following keys:
instrument_host_id
, instrument_id
, product_type
so as to identify and create a corresponding
Instrument Product class object. Additional required keys are defined in the
Configuration File and retuned by a geogen.config.Config.get_product_req_props()
method call.
Example of product properties dictionary:
{
"product_id": "HH852_0008_SR2.IMG",
"instrument_host_id": "MEX",
"instrument_id": "HRSC",
"product_type": "",
"target_name": "MARS",
"start_time": "2018-02-08T02:08:35.476Z",
"stop_time": "2018-02-08T02:08:35.481Z",
"detector_id": "MEX_HRSC_SRC",
"lines": "1018"
}
Product
class¶
- class geogen.product.Product(props_dict, config, silent=False)[source]¶
Bases:
object
Class that represents any PDS observational data product.
Its hold the observational data product properties required to initiate a valid
Observation
object, and compute its geometry metadata.- valid¶
Whether or not Product object is valid.
- Type
bol
Constructs Product object.
- Parameters
props_dict (dict) – Input product properties dictionary (see props_dict).
config (Config) – Input Config object.
silent (bool) – Indicates whether or not missing-required-product-property warning message is kept silent.
Instrument Product classes¶
Instrument Product classes inherits all the Product
class attributes. They holds
additional attributes, specific to each instrument data product type, that are passed by an input props_dict.
Their __init__
contructor method is used to set and/or modify any of these attributes so that a valid
Observation
object can be instantiated, and its corresponding geometry metadata
computed.
Mars Express (MEX)¶
- class geogen.product.MEX_OMEGA_EDR(props_dict, config, silent=False)[source]¶
Bases:
geogen.product.Product
Product class for MEX/OMEGA EDR data products.
detector_name
is always set to ‘MEX_OMEGA_SWIR_C’.detector_mode
is set to the first element of the data cube dimension, given by thecore_items
property value.n_data_records
is set to the third element of the data cube dimension, given by thecore_items
property value.
Constructs Product object.
- Parameters
props_dict (dict) – Input product properties dictionary (see props_dict).
config (Config) – Input Config object.
silent (bool) – Indicates whether or not missing-required-product-property warning message is kept silent.
- class geogen.product.MEX_HRSC_RDR(props_dict, config, silent=False)[source]¶
Bases:
geogen.product.Product
Product class for MEX/HRSC RDR data products.
detector_name
is set to thedetector_id
property value.n_data_records
is set to thelines
property value.
Constructs Product object.
- Parameters
props_dict (dict) – Input product properties dictionary (see props_dict).
config (Config) – Input Config object.
silent (bool) – Indicates whether or not missing-required-product-property warning message is kept silent.
- class geogen.product.MEX_PFS_EDR(props_dict, config, silent=False)[source]¶
Bases:
geogen.product.Product
Product class for MEX/PFS EDR data products.
detector_name
is set based on thedetector_id
property value.n_data_records
is set to thefile_records
property value.
Constructs Product object.
- Parameters
props_dict (dict) – Input product properties dictionary (see props_dict).
config (Config) – Input Config object.
silent (bool) – Indicates whether or not missing-required-product-property warning message is kept silent.
- class geogen.product.MEX_SPICAM_RDR(props_dict, config, silent=False)[source]¶
Bases:
geogen.product.Product
Product class for MEX/SPICAM RDR data products.
detector_name
is set based on thechannel_id
,target_type
,spacecraft_pointing_mode
andspicam_binning
properties values.n_data_records
is set to thefile_records
property value.target_name
is set to thespicam_target
property value.
Constructs Product object.
- Parameters
props_dict (dict) – Input product properties dictionary (see props_dict).
config (Config) – Input Config object.
silent (bool) – Indicates whether or not missing-required-product-property warning message is kept silent.
- class geogen.product.MEX_MARSIS(props_dict, config, silent=False)[source]¶
Bases:
geogen.product.Product
Product class for MEX/MARSIS data products.
Currently defined as applicable to EDR and RDR product types in psa_config.json file. Temporary detector FOV definition in mex_addendum.ti file:
\begindata INS-41300_FOV_FRAME = 'MEX_SPACECRAFT' INS-41300_FOV_SHAPE = 'RECTANGLE' INS-41300_BORESIGHT = ( 0.00000 0.00000 1.00000 ) INS-41300_FOV_CLASS_SPEC = 'ANGLES' INS-41300_FOV_REF_VECTOR = ( 1.00000 0.00000 0.00000 ) INS-41300_FOV_REF_ANGLE = 1.0 INS-41300_FOV_CROSS_ANGLE = 1.0 INS-41300_FOV_ANGLE_UNITS = 'DEGREES' \begintext
detector_name
is always set to ‘MEX_MARSIS’n_data_records
is set to therows
property value.
Constructs Product object.
- Parameters
props_dict (dict) – Input product properties dictionary (see props_dict).
config (Config) – Input Config object.
silent (bool) – Indicates whether or not missing-required-product-property warning message is kept silent.
- class geogen.product.MEX_ASPERA(props_dict, config, silent=False)[source]¶
Bases:
geogen.product.Product
Product class for MEX/ASPERA-3 data products.
Currently defined as applicable to DATA and DDR product types in psa_config.json file.
detector_name
is set based onproduct_id
property value.n_data_records
is set tofile_records
property value.
Constructs Product object.
- Parameters
props_dict (dict) – Input product properties dictionary (see props_dict).
config (Config) – Input Config object.
silent (bool) – Indicates whether or not missing-required-product-property warning message is kept silent.
- class geogen.product.MEX_VMC(props_dict, config, silent=False)[source]¶
Bases:
geogen.product.Product
Product class for MEX/VMC data products.
Currently defined as applicable to EDR and RDR product types in psa_config.json file.
detector_name
is set todetector_id
property value.
Constructs Product object.
- Parameters
props_dict (dict) – Input product properties dictionary (see props_dict).
config (Config) – Input Config object.
silent (bool) – Indicates whether or not missing-required-product-property warning message is kept silent.
Rosetta (ROS)¶
- class geogen.product.ROS_OSIRIS(props_dict, config, silent=False)[source]¶
Bases:
geogen.product.Product
Product class for ROSETTA/OSIRIS WAC and NAC data products.
Currently defined as applicable to EDR product type in psa_config.json file.
detector_name
is set based oninstrument_id
andgeometric_distortion_correction_flag
properties values.target_name
is currently updated so as to take into account for undefined SPICE body name synonyms.
Constructs Product object.
- Parameters
props_dict (dict) – Input product properties dictionary (see props_dict).
config (Config) – Input Config object.
silent (bool) – Indicates whether or not missing-required-product-property warning message is kept silent.
- class geogen.product.ROS_NAVCAM_EDR(props_dict, config, silent=False)[source]¶
Bases:
geogen.product.Product
Product class for ROSETTA/NAVCAM EDR data products.
detector_name
is set based onchannel_id
property value.
Constructs Product object.
- Parameters
props_dict (dict) – Input product properties dictionary (see props_dict).
config (Config) – Input Config object.
silent (bool) – Indicates whether or not missing-required-product-property warning message is kept silent.
- class geogen.product.ROS_ALICE(props_dict, config, silent=False)[source]¶
Bases:
geogen.product.Product
Product class for ROSETTA/ALICE data products.
Currently defined as applicable to EDR, REDR and REFDR product types in psa_config.json file.
detector_name
is always set to ‘ROS_ALICE’.n_data_records
is set tolines
property value.
Constructs Product object.
- Parameters
props_dict (dict) – Input product properties dictionary (see props_dict).
config (Config) – Input Config object.
silent (bool) – Indicates whether or not missing-required-product-property warning message is kept silent.
- class geogen.product.ROS_VIRTIS_EDR(props_dict, config, silent=False)[source]¶
Bases:
geogen.product.Product
Product class for ROSETTA/VIRTIS EDR data products.
detector_name
is set based onchannel_id
property value.n_data_records
is set to the third element of the data cube dimension, given by thecore_items
property value.
Constructs Product object.
- Parameters
props_dict (dict) – Input product properties dictionary (see props_dict).
config (Config) – Input Config object.
silent (bool) – Indicates whether or not missing-required-product-property warning message is kept silent.
- class geogen.product.ROS_MIRO(props_dict, config, silent=False)[source]¶
Bases:
geogen.product.Product
Product class for ROSETTA/MIRO data products.
Currently defined as applicable to EDR and RDR product types in psa_config.json file.
detector_name
is set based onproduct_id
property value.n_data_records
is set tofile_records
property value.
Constructs Product object.
- Parameters
props_dict (dict) – Input product properties dictionary (see props_dict).
config (Config) – Input Config object.
silent (bool) – Indicates whether or not missing-required-product-property warning message is kept silent.
ExoMars TGO (TGO)¶
- class geogen.product.TGO_ACS_RAW(props_dict, config, silent=False)[source]¶
Bases:
geogen.product.Product
Product class for TGO/ACS Raw data products.
detector_name
is set based onidentifier
property value.n_data_records
is set torecords
property value.
Constructs Product object.
- Parameters
props_dict (dict) – Input product properties dictionary (see props_dict).
config (Config) – Input Config object.
silent (bool) – Indicates whether or not missing-required-product-property warning message is kept silent.
- class geogen.product.TGO_ACS_CAL(props_dict, config, silent=False)[source]¶
Bases:
geogen.product.Product
Product class for TGO/ACS Calibrated data products.
detector_name
is based onidentifier
andnir_observation_type
properties values.n_data_records
is set torecords
property value.
Constructs Product object.
- Parameters
props_dict (dict) – Input product properties dictionary (see props_dict).
config (Config) – Input Config object.
silent (bool) – Indicates whether or not missing-required-product-property warning message is kept silent.
- class geogen.product.TGO_CASSIS_RAW(props_dict, config, silent=False)[source]¶
Bases:
geogen.product.Product
Product class for TGO/CASSIS Raw data products.
detector_name
is set based onproduct_id
property value.detector_fov_ref_ratio
is set based onsamples
property value.detector_fov_cross_ratio
is set based onlines
andfilter
properties values.stop_time
is set tostart_time
property value.No
time_offset
is applied (can be changed if deemed necessary).
Constructs Product object.
- Parameters
props_dict (dict) – Input product properties dictionary (see props_dict).
config (Config) – Input Config object.
silent (bool) – Indicates whether or not missing-required-product-property warning message is kept silent.
- class geogen.product.TGO_CASSIS_CAL(props_dict, config, silent=False)[source]¶
Bases:
geogen.product.Product
Product class for TGO/CASSIS Calibrated data products.
detector_name
is set based onfilter
property value.detector_fov_ref_ratio
is set based onsamples
property value.detector_fov_cross_ratio
is set based onlines
andfilter
properties values.stop_time
is set tostart_time
property value.No
time_offset
is applied (can be changed if deemed necessary).
Constructs Product object.
- Parameters
props_dict (dict) – Input product properties dictionary (see props_dict).
config (Config) – Input Config object.
silent (bool) – Indicates whether or not missing-required-product-property warning message is kept silent.
- class geogen.product.TGO_FREND_CAL(props_dict, config, silent=False)[source]¶
Bases:
geogen.product.Product
Product class for TGO/FREND Calibrated data products.
detector_name
is always set to ‘TGO_FREND’.n_data_records
is set torecords
property value.
Constructs Product object.
- Parameters
props_dict (dict) – Input product properties dictionary (see props_dict).
config (Config) – Input Config object.
silent (bool) – Indicates whether or not missing-required-product-property warning message is kept silent.
- class geogen.product.TGO_NOMAD_RAW(props_dict, config, silent=False)[source]¶
Bases:
geogen.product.Product
Product class for TGO/NOMAD Raw data products.
detector_name
is set basedidentifier
property value.n_data_records
is set torecords
property value.
Constructs Product object.
- Parameters
props_dict (dict) – Input product properties dictionary (see props_dict).
config (Config) – Input Config object.
silent (bool) – Indicates whether or not missing-required-product-property warning message is kept silent.
- class geogen.product.TGO_NOMAD_CAL(props_dict, config, silent=False)[source]¶
Bases:
geogen.product.Product
Product class for TGO/NOMAD Calibrated data products.
detector_name
is set based onidentifier
andproduct_id
properties values.n_data_records
is set torecords
property value.
Constructs Product object.
- Parameters
props_dict (dict) – Input product properties dictionary (see props_dict).
config (Config) – Input Config object.
silent (bool) – Indicates whether or not missing-required-product-property warning message is kept silent.
PLFParser
class¶
- class geogen.product.PLFParser(config)[source]¶
Bases:
object
Class that parses Product List File (PLF) files.
Holds valid
Product
objects resulting from a PLF file parsing.- n_product_items¶
Number of valid product items in PFL file.
- Type
- products¶
List of Product objects matching valid product items.
- Type
List[Product]
Constructs PLFParser object.
- Parameters
config (Config) – Config object to be associated to the parser.
ProductFactory
class¶
- class geogen.product.ProductFactory(config)[source]¶
Bases:
object
Class that creates Product or Product-child objects.
Constructs ProductFactory object.
- Parameters
config (Config) – Input Config object.
- create(props_dict, silent=False)[source]¶
Returns a valid Product-children class object from an input product props dictionary.
- Parameters
props_dict (dict) – Input product properties dictionary (see props_dict).
silent (bool, optional) – Indicates whether or not missing-required-product-property warning message is kept silent.
- Return type