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.

../_images/product_module.png

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.

instrument_host_id

Instrument host ID.

Type

str

instrument_id

Instrument ID.

Type

str

product_type

Product type.

Type

str

detector_name

Detector name.

Type

str

detector_mode

Detector mode (default is 1).

Type

str

n_data_records

Number of data records (default is 0).

Type

int

detector_subframe

Boolean defining whether a FRAME detector can have sub-frames.

Type

bool

detector_fov_ref_ratio

Detector sub-frame FOV reference-axis ratio.

Type

float

detector_fov_cross_ratio

Detector sub-frame FOV cross-axis ratio.

Type

float

time_offset

Time offset in seconds to be applied for computation.

Type

float

config

Associated Config object.

Type

Config

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 the core_items property value.

  • n_data_records is set to the third element of the data cube dimension, given by the core_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 the detector_id property value.

  • n_data_records is set to the lines 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 the detector_id property value.

  • n_data_records is set to the file_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 the channel_id, target_type, spacecraft_pointing_mode and spicam_binning properties values.

  • n_data_records is set to the file_records property value.

  • target_name is set to the spicam_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 the rows 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 on product_id property value.

  • n_data_records is set to file_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 to detector_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 on instrument_id and geometric_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 on channel_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 to lines 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 on channel_id property value.

  • n_data_records is set to the third element of the data cube dimension, given by the core_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 on product_id property value.

  • n_data_records is set to file_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 on identifier property value.

  • n_data_records is set to 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.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 on identifier and nir_observation_type properties values.

  • n_data_records is set to 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.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 on product_id property value.

  • detector_fov_ref_ratio is set based on samples property value.

  • detector_fov_cross_ratio is set based on lines and filter properties values.

  • stop_time is set to start_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 on filter property value.

  • detector_fov_ref_ratio is set based on samples property value.

  • detector_fov_cross_ratio is set based on lines and filter properties values.

  • stop_time is set to start_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 to 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.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 based identifier property value.

  • n_data_records is set to 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.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 on identifier and product_id properties values.

  • n_data_records is set to 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.

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.

config

Config object associated to the parser.

Type

Config

plf_file

Parsed PLF file.

Type

str

n_product_items

Number of valid product items in PFL file.

Type

int

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.

parse(plf_file)[source]

Parses an input PLF file and returns corresponding Product objects.

Parameters

plf_file (str) – PLF file to be parsed.

Return type

List[Product]

get_missions()[source]

Returns the list of mission IDs corresponding to valid Product objects.

Return type

List[str]

ProductFactory class

class geogen.product.ProductFactory(config)[source]

Bases: object

Class that creates Product or Product-child objects.

config

Associated Config object.

Type

Config

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

Product