Using alternative configuration
Contents
Using alternative configuration¶
In this tutorial you will learn how to configure GEOGEN for specific definition and validation scenarios. This is a first step towards Configuring for new instrument data product types.
Prerequisites¶
We assume you have access to the GEOGEN Training JupyterHub platform and completed the previous tutorials. You can also follow this tutorial if you’re using GEOGEN on your local computer.
Important
If you’re using GEOGEN on your local computer, you don’t need to duplicate the configuration file and the
addendum
directory in your working directory. You can even edit the content of the product.py
module. However,
if you’re not developping GEOGEN, you must ensure that you don’t have write access, or NEVER “git push”, to
the remote psa_geo
Bitbucket repository.
Steps¶
1. Create your own configuration file¶
Copy the psa_config.json
configuration file in your working directory, with a different name, for example:
cp psa_geo/psa_config.json my_config.json
2. Create your own addendum directory¶
Addendum kernels used for computation are by default contained within the psa-geo
package, ensuring minimum
configuration effort on PSA ops side.
As a user you can create and manage your own addendum kernels in any directory of your choice, for example
data/addendum
to keep things tidy.
Start from what is inside the psa-geo
package. Run:
mkdir data/addendum
cp psa_geo/data/addendum/* data/addendum/.
3. Change detector angle-of-view (AOV)¶
Edit data/addendum/mex_addendum.ti
and change MEX_HRSC_NADIR
detector AOV (NAIF code -41215
) from
\begindata
INS-41215_GG_DETECTOR_TYPE = 'LINE'
INS-41215_GG_DETECTOR_MODES = ( 1 )
INS-41215_GG_AOV_ROT_VECTOR = ( 0.000 1.000 0.000 )
INS-41215_GG_AOV_ANGLES = ( 11.88085 )
INS-41215_GG_AOV_ANGLE_UNITS = 'DEGREES'
\begintext
to:
\begindata
INS-41215_GG_DETECTOR_TYPE = 'LINE'
INS-41215_GG_DETECTOR_MODES = ( 1 )
INS-41215_GG_AOV_ROT_VECTOR = ( 0.000 1.000 0.000 )
INS-41215_GG_AOV_ANGLES = ( 20.0 )
INS-41215_GG_AOV_ANGLE_UNITS = 'DEGREES'
\begintext
Run computation for H3211_0000_ND2.IMG
data product, which is associated to the MEX_HRSC_NADIR detector:
geogen compute psa_geo/data/plf/mex_sample_test.plf --product-id=H3211_0000_ND2.IMG --addendum-dir=data/addendum --no-preview
Notice the difference:
4. Set up your configuration for BepiColombo¶
Define BepiColombo mission and SIMBIO-SYS instrument in your configuration. Add the following mission JSON object member as a minimal configuration:
{
"id": "MPO",
"primary_target": "MERCURY",
"spice_kernels": [
"$ESA_SPICE_KERNELS/bepicolombo/kernels/mk/bc_ops.tm"
],
"pds_version": "PDS4",
"instruments": [
{
"id": "SIMBIO-SYS",
"products": [
{
"type": "Raw",
"py_class": "",
"req_props": []
}
]
}
]
}
Check your configuration:
$ geogen config --config-file=my_config.json
$ geogen config --config-file=my_config.json --mission-id=MPO --instrument-id=SIMBIO-SYS
$ geogen config --config-file=my_config.json --mission-id=MPO --instrument-id=SIMBIO-SYS --product-type=Raw
Required product properties and paths should be as follow:
product_id pds:Identification_Area/pds:logical_identifier
instrument_host_id pds:Observation_Area/pds:Observing_System/pds:Observing_System_Component[pds:type="Spacecraft"]/pds:name
instrument_id pds:Observation_Area/pds:Observing_System/pds:Observing_System_Component[pds:type="Instrument"]/pds:name
product_type pds:Observation_Area/pds:Primary_Result_Summary/pds:processing_level
target_name pds:Observation_Area/pds:Target_Identification/pds:name
start_time pds:Observation_Area/pds:Time_Coordinates/pds:start_date_time
stop_time pds:Observation_Area/pds:Time_Coordinates/pds:stop_date_time
Create a simple PLF file for SIMBIO-SYS, save it as mpo_sample.plf
in your data/plf
directory:
{
"products": [
{
"product_id": "FAKE_SIMBIO-SYS_0001",
"instrument_host_id": "Mercury Planetary Orbiter",
"instrument_id": "SIMBIO-SYS",
"target_name": "MERCURY",
"start_time": "2023-01-06T00:44:33.760",
"stop_time": "2023-01-06T00:56:25.760",
"product_type": "Raw"
}
]
}
Don’t forget to download BepiColombo ESA’s SPICE Kernels Datasets before running a SIMBIO-SYS computation preview:
$ geogen compute data/plf/mpo_sample.plf --config-file=my_config.json
You should see something like this:
1 coverage(s) loaded from PLF file:
#1 MERCURY_MPO_SIMBIO-SYS_RAW has 1 observation(s):
Product ID = FAKE_SIMBIO-SYS_0001
Product Type = Raw
Target SPICE Name = MERCURY
Target SPICE Body-Fixed Frame = IAU_MERCURY
GEOGEN Detector Type = IN-SITU
Detector SPICE Name = MPO_SIMBIO-SYS
Detector SPICE ID = -121600
Detector SPICE Frame = N/A
Computation Time Steps = 100
Output B3F directory : /Users/nmanaud/workspace/geogen/data/b3f/mpo_sample/
Output GeoJSON directory : /Users/nmanaud/workspace/geogen/data/geojson/mpo_sample/
This was a computation preview. Use --no-preview option to run the computation.
It looks like MPO_SIMBIO-SYS
is a SPICE-known detector name (we got lucky), but it may not have a FOV. You’re ready
to compute this (fake) SIMBIO-SYS observation geometry metadata. Otherwise, we would have to add the --force-detector
option. Run the following command and check results in your data/geojson/mpo_sample
directory:
$ geogen compute data/plf/mpo_sample.plf --config-file=my_config.json --no-preview
Only pointing-independent geometry meta can be be computed. SIMBIO-SYS is not an IN-SITU detector. In order to be able to compute pointing-dependent geometry meta (footprint and related parameters), you must:
define its detector type in an new addendum IK kernel, and
write an dedicated Instrument Product class mapping input product properties with a SPICE-known detector that has a FOV. This may be require to define additional required product properties.