metadata-tools is a Python module that generates index and geometry metadata tables
and their corresponding PDS3 labels. Each line of the table contains metadata for a single
data file (e.g. image).
Index files contain descriptive information about the data product, like observation times, exposures, instrument modes and settings, etc. Index file entries are taken from the label for the data product by default, but may instead be derived from label quantities by defining the appropriate configuration function in the host_config.py for the specific host.
Raw index files are provided by each project, with varying levels of compliance. The
project-supplied index files are modified to produce the corrected index files that
can be used with the host from_index() method. The metadata-tools package is intended
to produce supplemental index files, which add columns to the corrected index file.
Supplemental index files are identical in structure to index files, so this package can
generate any kind of index file. Supplemental index files can be provided as arguments to
from_index() to create a merged dictionary.
Supplemental index files are used as input to OPUS, and are available via viewmaster to be downloaded by PDS users.
Geometry files tabulate the values of geometric quantities for each data file, which are derived from SPICE using the information in the index file or from the PDS3 label using OOPS. The purpose of the geometry files is to provide input to OPUS.
metadata-tools is a product of the PDS Ring-Moon Systems Node.
Clone the rms-metadata-tools repo, activate the venv, and install the dependencies:
% git clone https://github.com/SETI/rms-metadata-tools.git
% activate
% pip install -r requirements.txtThe procedure for generating metadata tables for a given collection is as follows:
- Create the supplemental index using <collection>_index.py.
- Create the geometry tables using <collection>_geometry.py.
- Generate the cumulative tables using <collection>_cumulative.py.
The procedure for creating a new host configuration is as follows:
- Create a directory for the new host collection under the hosts/ subdirectory, e.g., hosts/GO_0xxx/, hosts/COISS_xxxx/, etc.
- Copy the python files from an existing host directory and rename them as needed for the new collection.
- Edit the config and init modules as needed.
- Create a templates/ subdirectory and copy the files from an existing host. Rename the files as needed.
- Edit host_defs.lbl for the new host.
- Edit the descriptions in the summary templates as needed.
- Edit the supplemental template to define the supplemental metadata for the new host.
The supplemental index table is controlled by the supplemental label template. By default, each column object in the label specifies the name of a PDS label field to add to the table, along with its desired formatting. This behavior may be overridden by adding a key function to index_config.py of the form:
key__<NAME>(label_path, label_dict)where label_path is the path to the PDS label, and label_dict is a dictionary containing the PDS label fields. The returned value is placed in the index file.
Modifying the geometry tables requires editing of the column definition and format tables, and may require the addition of new backplane functions.
To add a new geometry column:
- Add a column definition to the column definition file, e.g. COLUMNS_BODY.py.
- Add a corresponding function to appropriate backplane module.
- Add a row to the format dictionary in geometry_support.py.
- Add column description(s) to the label template, e.g., body_summary.lbl.
Information on contributing to this package can be found in the Contributing Guide.
This code is licensed under the Apache License v2.0.