Config module

The config module holds the Config class and related default variables.

PDS_NAIF_MAPPING

geogen.config.PDS_NAIF_MAPPING = {-226800: ['RL', 'ROS_LANDER', 'PHILAE'], -652: ['MTM', 'BEPICOLOMBO MTM', 'MERCURY TRANSFER MODULE'], -248: ['VEX', 'VENUS EXPRESS', 'VENUS-EXPRESS', 'VENUS_EXPRESS'], -238: ['S1', 'SM1', 'SMART1', 'SMART-1'], -226: ['ROSETTA', 'ROS', 'ROSETTA ORBITER'], -143: ['TGO', 'TRACE GAS ORBITER', 'EXOMARS TGO', 'EXOMARS 2016 TGO'], -121: ['MPO', 'BEPICOLOMBO MPO', 'MERCURY PLANETARY ORBITER'], -41: ['MEX', 'MARS EXPRESS', 'MARS-EXPRESS', 'MARS_EXPRESS']}

Set dictionary variable mapping PDS instrument host ID with SPICE NAIF spacecraft body name and synonyms, and consequently defining allowed mission IDs in configuration file. For example: ‘Mercury Planetary Orbiter’ as instrument host/spacecraft name in PDS label will be translated into ‘MPO’, which becomes an allowed mission ID in the configuration file.

DEFAULT_DATA_DIR

geogen.config.DEFAULT_DATA_DIR = 'data'

Default output data directory is the data directory relative to from where GEOGEN is executed.

KERNELS_PATH_SYMBOL

geogen.config.KERNELS_PATH_SYMBOL = '$ESA_SPICE_KERNELS'

Symbol used in the Configuration file to specify the path of a mission metakernel file relative to path of the ESA’s SPICE Kernels Datasets (SKDs) top-level directory, which specified by the ESA_SPICE_KERNELS environment variable.

Config class

class geogen.config.Config(config_file, data_dir='data', addendum_dir='')[source]

Bases: object

Class that represents a configuration to be used for computation.

It mainly allows to retrieve information from a Configuration File and load SPICE kernels.

config_file

Configuration file path.

Type

str

b3f_dir

B3F data directory path.

Type

str

geojson_dir

GeoJSON data directory path.

Type

str

log_dir

LOG data directory path.

Type

str

addendum_dir

Addendum kernels directory path.

Type

str

skd_basedir

SPICE Kernels Datasets (SKD) top-level directory path.

Type

str

Constructs Config object.

Parameters
  • config_file (str) – Configuration file path.

  • data_dir (str, optional) – Data directory path (default is DEFAULT_DATA_DIR).

  • addendum_dir (str, optional) – Addendum directory path (default is the package data addendum directory).

get_missions()[source]

Returns all mission IDs and definitions.

Return type

Tuple[List[str], List[dict]]

get_mission(mission_id)[source]

Returns the mission definition for a given mission ID.

Parameters

mission_id (str) – Mission ID.

Returns

Mission definition dictionary.

Return type

dict

get_instruments(mission_id)[source]

Returns instrument IDs and definitions for a given mission ID.

Parameters

mission_id (str) – Mission ID.

Return type

Tuple[List[str], List[str]]

get_instrument(mission_id, instrument_id)[source]

Returns the instrument definition for a given mission ID and instrument ID.

Parameters
  • mission_id (str) – Mission ID.

  • instrument_id (str) – Instrument ID.

Returns

Instrument definition dictionary.

Return type

dict

get_products(mission_id, instrument_id)[source]

Returns product types, definitions and default type for a given mission ID.

Parameters
  • mission_id (str) – Mission ID.

  • instrument_id (str) – Instrument ID.

Return type

Tuple[List[str], List[dict], str]

get_product(mission_id, instrument_id, product_type)[source]

Returns the product definition and default type for a given mission ID, instrument ID and product type.

Parameters
  • mission_id (str) – Mission ID.

  • instrument_id (str) – Instrument ID.

  • product_type (str) – Product type.

Return type

Tuple[dict, str]

get_product_class(mission_id, instrument_id, product_type)[source]

Returns the product class name for a given mission ID, instrument ID and product type.

Parameters
  • mission_id (str) – Mission ID.

  • instrument_id (str) – Instrument ID.

  • product_type (str) – Product type.

Returns

Product class name (see Instrument Product classes).

Return type

str

get_product_req_props(mission_id, instrument_id, product_type, pds_version='PDS3')[source]

Returns the product required properties for a given mission ID, instrument ID and product type.

Parameters
  • mission_id (str) – Mission ID.

  • instrument_id (str) – Instrument ID.

  • product_type (str) – Product type.

  • pds_version (str, optional) – PDS version, either ‘PDS3’ (default) or ‘PDS4’.

Returns

List of properties names, paths, and default product type.

Return type

Tuple[List[str], List[str], str]

get_kernels(mission)[source]

Returns the list of SPICE kernels defined for a given mission ID.

Parameters

mission (str) – Mission ID.

Return type

List[str]

load_kernels(spice_kernels)[source]

Load a list of SPICE kernels.

Parameters

spice_kernels (List[str]) – List of SPICE kernels.

get_kernels_reference_time(body_name)[source]

Get reference ephemeris time for a given SPICE body name.

Used by the GEOGEN CLI fov command.

Parameters

body_name (str) – SPICE body name (mission ID).

Return type

float

get_primary_target(mission)[source]

Get primary target of a given mission ID.

Parameters

mission (str) – Mission ID.

Returns

Target name.

Return type

str

get_applicable_targets()[source]

Return applicable target names.

Return type

List[str]

get_target_frame(target_name)[source]

Returns body-fixed reference frame defined for a given target.

Parameters

target_name (str) – Target name.

Returns

Target body-fixed reference frame name.

Return type

str

get_dsk_file(target_name)[source]

Returns the SPICE DSK file defined for a given target.

Parameters

target_name (str) – Target name.

Returns

SPICE DSK file path.

Return type

str