Writing PLF files

In this tutorial you will learn how to write PLF files. PLF files are generated programmatically by the PSA ops engineers for processing and ingestion of geometry metadata into PSA. However, Archive Scientists have the task to write a representative set of data products for a given instrument.

Prerequisites

We assume you have access to the GEOGEN Training JupyterHub platform and completed the previous tutorial Computing geometry metadata. You can also follow this tutorial if you’re using GEOGEN on your local computer.

Steps

1. Get required product properties

PLF files are simple JSON files containing a list of product properties required for computing corresponing observation metadata. See Product List File (PLF) for detailed specifications.

You can get the required properties for a given instrument data product by using the config command.

For example, if you’re interested in computing Mars Express SPICAM data products geometry metadata, run the following commands to know what the product types defined for SPICAM are, and then to know what the required properties for a given product type are:

$ geogen config --mission-id=MEX --instrument-id=SPICAM

...

Instrument: SPICAM

- Products: ['RDR']
$ geogen config --mission-id=MEX --instrument-id=SPICAM --product-type=RDR

...

Instrument: SPICAM

Product Type: RDR
- Required properties:
   product_id                     PRODUCT_ID
   instrument_host_id             INSTRUMENT_HOST_ID
   instrument_id                  INSTRUMENT_ID
   product_type                   PRODUCT_TYPE
   target_name                    TARGET_NAME
   start_time                     START_TIME
   stop_time                      STOP_TIME
   target_type                    TARGET_TYPE
   channel_id                     CHANNEL_ID
   spacecraft_pointing_mode       SPACECRAFT_POINTING_MODE
   instrument_mode_id             INSTRUMENT_MODE_ID
   spicam_target                  MEX:SPICAM_TARGET
   spicam_binning                 MEX:SPICAM_BINNING
   file_records                   FILE_RECORDS

The path to access each required property is the PDS3/PDS4 data product lable is provived, as well as the full Instrument Product class code if you need to understand or verify how the associated detector information is derived.

2. Write a PLF file

  • Create a new PLF file in your data/plf directory.

  • Write PLF product item(s), example:

    {
      "products": [
        {
          "product_id": "SPIM_1AU_11471A01_E_01.FIT",
          "instrument_host_id": "MEX",
          "instrument_id": "SPICAM",
          "target_name": "",
          "start_time": "2013-01-06T00:44:33.760",
          "stop_time": "2013-01-06T00:56:25.760",
          "product_type": "RDR",
          "channel_id": "UV",
          "spacecraft_pointing_mode": "INERT",
          "instrument_mode_id": "BINNING",
          "spicam_binning": "16",
          "target_type": "STAR",
          "spicam_target": "MARS",
          "file_records": "5169"
        }
      ]
    }
    

3. Compute and analysis geometry for this PLF file

Test, play around, add more products to the list. See Computing geometry metadata.