High-level functions
Contents
High-level functions#
This package includes the Click-based CLI command functions, using the gfinder API. The following functions can be used programmatically instead of using the GFINDER CLI commands:
config
#
GFINDER CLI config command.
search
#
GFINDER CLI search command.
- gfinder.commands.search.search(odf_file, opportunity_id=None, start_time=None, stop_time=None, event_id=None, n_steps=100, time_step=1.0, mission_scenario_id='CREMA50', target=None, compute=False, overwrite=False, suffix=None, silent=False, no_save=False, **kwargs)[source]#
Search observation opportunities.
This command takes as input an Opportunity Definition File (ODF) file, containing the geometry condition(s) and geometry parameters corresponding to a user-defined observation opportunity.
Search time window can be provided as timing inputs (using start_time, stop_time, event_name options), or as an ‘opportunity’ resulting from a previous search.
It produces a set of output geometry event (GeoEvent) files in JSON format bundled in an ‘opportunity’ directory. It also produces companion GeoJSON files when applicable. The identifier of an opportunity is automatically assigned.
- Parameters
odf_file (str) – ODF file output_dir relative to ODF data store directory.
opportunity_id (str, optional) – Identifier of an opportunity to used as input time window input (cascading search).
start_time (str, optional) – Start time of the input time window (UTC), or relative start time string if –event-id is used.
stop_time (str, optional) – Stop time of the input time window (UTC), or relative stop time string if –event-id is used.
event_id (str, optional) – Identifier of the mission event (phase/segment) to be used as input time window (based on Mission Event file).
n_steps (int, optional) – Number of time steps used to derive time step (default: 100).
time_step (float, optional) – Time step, in seconds, to be used to bracket roots (default: 1.0 sec.).
mission_scenario_id (str, optional) – Mission scenario ID (default: CREMA50)
target (str, optional) – Target name ODF overwrite.
compute (bool, optional) – Run observation geometry data computation for all opportunity windows.
overwrite (bool, optional) – Overwrite existing opportunity data files.
suffix (str, optional) – Add suffix string to the searched opportunity ID.
compute
#
GFINDER CLI compute command.
- gfinder.commands.compute.compute(odf_file=None, opportunity_id=None, event_id=None, start_time=None, stop_time=None, n_steps=100, time_step=None, mission_scenario_id='CREMA50', target=None, binning=1, ptr_file=None, ck_file=None, sim_sc_att=False, sc_slew_angles=None, sim_scanner=False, majis_scan_angle=None, overwrite=False, suffix=None, silent=False, no_save=False, **kwargs)[source]#
Compute observation geometry.
This command takes as input an Opportunity Definition File (ODF) file, containing the geometry condition(s) and geometry parameters corresponding to a user-defined observation opportunity.
Computation time window can be provided as timing inputs (using start-time, stop-time, event-id options), or or as an ‘opportunity’ resulting from a previous search.
It produces a set of output geometry event (GeoEvt) files in JSON format, depending of the number of input time intervals or opportunities, bundled in an ‘opportunity’ directory. It also produce companion GeoJSON files. The identifier of an opportunity is automatically assigned. Geometry events are either: a sequence of observations, or an observation:
Sequence GeoEvt files contain the times and geometry of a sequence of observations, and the times and geometry of each individual observation opportunity.
Observation GeoEvt files contains the times and geometry of an observation opportunity, and the times and geometry of each individual instant measurement.
The geometry of an observation is always derived from the geometry of all individual instant measurement (model hypothesis). Timing information, such as the number of time steps, can be provided as an option.
Examples:
$ gfinder compute –odf-file=data/odf/highres_ganymede_mapping.json –event-id=GCO1 $ gfinder compute –odf-file=data/odf/jupiter_disk.json –event-id=JFB1
- Parameters
odf_file (str, optional) – Input Opportunity Definition File.
opportunity_id (str, optional) – Identifier of the opportunity to compute geometry data for.
event_id (str, optional) – ID of the mission event to be used as input time window (based on Mission Fvents file).
start_time (str, optional) – Start time of the input time window (UTC).
stop_time (str, optional) – Stop time of the input time window (UTC).
n_steps (int, optional) – Number of computation steps (or repetitions) (default: 100).
time_step (float, optional) – Computation time step, in seconds (or repetition time)
mission_scenario_id (str, optional) – Mission scenario ID (default: CREMA50)
target (str, optional) – Target name ODF overwrite.
binning (int, optional) – Detector binning: 1 (default), 2 or 4.
ptr_file (str, optional) – Input PTR file, converted into CK file and loaded to SPICE kernel pool.
ck_file (str, optional) – Input CK file loaded to SPICE kernel pool.
sim_sc_att (bool, optional) – Simulate SC attitude based on input ODF pointing definition (default: False).
sc_slew_angles (str, optional) – Overwrites ODF SC_Slew_Angles parameters (run geometry command to know allowed parameters).
sim_scanner (bool, optional) – Simulate MAJIS scanner pointing based on input ODF pointing definition (default: False).
majis_scan_angle (str, optional) – Overwrites ODF MAJIS_Scan_Angle parameters (run geometry command to know allowed parameters).
overwrite (bool, optional) – Overwrite existing opportunity data files.
suffix (str, optional) – Add suffix string to the computed opportunity ID.
export
#
GFINDER CLI export command.
- gfinder.commands.export.export(opportunity_id, format=None, overwrite=False, measurements=False, agm_validation=False)[source]#
Export opportunity data to external data format (EventCSV, QuaternionCSV, GeoJSON, CK, PTR, ITL).
Exported files are located in subdirectories of the opportunity directory. Each subdirectory corresponds to the exported format (eg: EventCSV files on eventcsv/ subdirectory).
Export to Event CSV:
Jupiter ring low-phase observations opportunity windows, and a specific simulated observation geometry data in CSV format.
$ gfinder export crema50_jup_majis_mainring_lowphase_20310119_20341219 –format=EventCSV $ gfinder export crema50_jup_majis_mainring_lowphase_20331127_20331127 –format=EventCSV
Export to PTR:
$ gfinder export crema50_jup_majis_mainring_lowphase_20331127_20331127 –format=PTR $ gfinder export crema50_jup_majis_mainring_lowphase_20331127_20331127 –format=PTR –agm-validation
- Parameters
opportunity_id (str) – Opportunity or Timeline ID
format (str, optional) – Output format: [‘EventCSV’, ‘GeoJSON’, ‘QuaternionCSV’, ‘CK’, ‘PTR’, ‘ITL’].
overwrite (bool, optional) – Overwrite existing exported files.
measurements (bool, optional) – [EventCSV] Export measurements data for all observations. By default, only the first observation measurements are exported.
agm_validation (bool, optional) – [PTR] Validate exported PTR file(s) using AGM.
definitions
#
GFINDER CLI definitions command.
definition
#
GFINDER CLI definition command.
- gfinder.commands.definition.definition(odf_file, target=None, binning=1, sc_slew_angles=None, majis_scan_angle=None, to_json=False, **kwargs)[source]#
Get information about an observation opportunity definition (ODF file).
- Parameters
odf_file (str) – ODF file output_dir relative to ODF data store directory.
target (str, optional) – Overwrites ODF target parameters.
binning (int, optional) – Detector binning: 1 (default), 2 or 4
sc_slew_angles (str, optional) – Overwrites ODF SC_Slew_Angles parameters (run geometry command to know allowed parameters).
majis_scan_angle (str, optional) – Overwrites ODF MAJIS_Scan_Angle parameters (run geometry command to know allowed parameters).
to_json (bool, optional) – Output JSON
geometries
#
GFINDER CLI geometries command.
geometry
#
GFINDER CLI geometry command.
opportunities
#
GFINDER CLI opportunities command.
opportunity
#
GFINDER CLI opportunity command.
scenarios
#
GFINDER CLI scenarios command.
scenario
#
GFINDER CLI scenario command.
events
#
GFINDER CLI events command.
- gfinder.commands.events.events(event_file_key='', filter=None, before=None, after=None, mission_scenario_id=None)[source]#
List mission events for a given mission scenario.
Examples:
gfinder events –event-file-key=phase –mission-scenario-id=CREMA5_1_150lb gfinder events –filter=’flyby’
- Parameters
event_file_key (str, optional) – Filter by event file key (eg: “phase”, “orbit”)
filter (str, optional) – Filter name using complex regular expression.
before (str, optional) – Filter before a given UTC time.
after (str, optional) – Filter after a given UTC time.
mission_scenario_id (str, optional) – Mission scenario ID (default: CREMA50)
event
#
GFINDER CLI event command.
- gfinder.commands.event.event(mission_event_id, mission_scenario_id=None)[source]#
Get information about a mission event for a given event identifier or synonym.
A mission event ID within MOS is defined as a unique string identifier allowing to retrieve an event defined in events files. Identifier is formed as follows:
MISSION_EVENT_ID: ‘<event_file_key>:<key1>[:<key2>]’ (full) or ‘<synonym>’
where:
<event_file_key> is the key of event file as defined in the Mission Scenario Index file, for example:
‘phase’, ‘timeline’, ‘orbit’, ‘dl’ and ‘custom’.
<key1> is the name of the event (eg: ‘GCO500’ or ‘PERIJOVE_12PJ’), or the name of the events list (eg:
‘FLYBY_EUROPA’ or ‘DL_’).
<key2> is the optional name of the event, when exists (eg: ‘7E1’ for ‘FLYBY_EUROPA’ events list), or the
occurence number of the event in the events list (eg: ‘66’ for ‘IO_TRANSIT’ events list).
For example:
$ gfinder event phase:GCO500 $ gfinder event timeline:FLYBY_GANYMEDE:1G1 $ gfinder event orbit:54 $ gfinder event custom:TOUR
When only <event_file_key> is provided (no <key1> and <key2>), it is assumed to be a synonym and its corresponding event ID is derived. Examples of synonyms, which can be used (not sensitive to the case):
$ gfinder event TOUR # ‘custom:TOUR’ $ gfinder event GCO500 # ‘phase:GCO500’ $ gfinder event 7E1 # ‘timeline:FLYBY_EUROPA:7E1’ $ gfinder event PJ12 # ‘timeline:PERIJOVE_12PJ’ $ gfinder event AP12 # ‘timeline:APOJOVE_12AP’ $ gfinder event orb54 # ‘orbit:54’ $ gfinder event dl666 # ‘dl:DL_:666’
ptrgen
#
GFINDER CLI ptrgen command.
- gfinder.commands.ptrgen.ptrgen(ptr_pointing_type, start_time=None, stop_time=None, metadata=None, params=False, agm_validation=False, mission_scenario_id=None, **kwargs)[source]#
- (beta) Generate a PTR file based on a pre-defined “PTR Pointing Type”, and given a set of required
pointing parameters.
Use –params to show “pointing parameters” for a given PTR pointing type.
Examples:
$ gfinder ptrgen juice_jupiter_ring –params $ gfinder ptrgen juice_jupiter_ring –fixed_offset_x_angle=12.6 $ gfinder ptrgen juice_jupiter_ring –fixed_offset_x_angle=12.6 –agm-validation
See Also:
Use the ptr-pointings CLI command to list all available PTR Pointing Types, and associated required pointing parameters.
Use the export CLI command to export an opportunity definition to a PTR file, optionally AGM-validated.
- Parameters
ptr_pointing_type (str) – PTR pointing type (eg: juice_jupiter_ring.
start_time (str, optional) – Start time of the pointing block (UTC). Default is 2031-01-19.
stop_time (str, optional) – Stop time of the pointing block (UTC). Default is 2031-01-19 plus 10 minutes.
metadata (str, optional) – Additional pointing block metadata (free text).
params (bool, optional) – Show pointing parameters for a given PTR pointing type.
agm_validation (bool, optional) – Validate generated PRM using AGM.
mission_scenario_id (str, optional) – Mission scenario ID to be used for AGM validation (default: CREMA50)