Index table support
Tools for generating supplemental index tables and their PDS3 labels.
- class IndexTable(input_dir: str | Path | FCPath | None = None, output_dir: str | Path | FCPath | None = None, template_path: str | Path | FCPath | None = None, metadata_dir: str | Path | FCPath | None = None, qualifier: str = '', glob: str | None = None, **kwargs: Any)[source]
Bases:
TableClass describing an index table for a single volume.
- get_args(host: str | None = None, index_type: str | None = None) ArgumentParser[source]
Argument parser for index files.
- Parameters:
host – Host name e.g. ‘GOISS’.
index_type – Qualifying string identifying the type of index file to create, e.g., ‘supplemental’.
- Returns:
Parser containing the argument specifications.
- key__file_specification_name(label_path: str | Path | FCPath, label_dict: dict[str, Any]) FCPath[source]
Key function for FILE_SPECIFICATION_NAME. The return value will appear in the index file under FILE_SPECIFICATION_NAME.
- Parameters:
label_path – Path to the PDS label.
label_dict – Dictionary containing the PDS label fields.
- Returns:
File Specification name.
- key__volume_id(label_path: str | Path | FCPath, label_dict: dict[str, Any]) str[source]
Key function for VOLUME_ID. The return value will appear in the index file under VOLUME_ID.
- Parameters:
label_path – Path to the PDS label.
label_dict – Dictionary containing the PDS label fields.
- Returns:
Volume ID.
- process_index(template_name: str, glob: str | None = None, volumes: list[str] | None = None, args: Namespace | None = None, task_file: str | None = None, task_list_only: bool = False) None[source]
Create index files for a collection of volumes.
- Parameters:
template_name – Name of input template.
glob – Glob pattern for data files.
volumes – List of volume ids to process. Overrides args.volumes.
args – Parsed arguments.
task_file – Name of tasks file. This file is overwritten. If not given, tasks are provided via the task_source generator.
task_list_only – If True, a task list is created and no processing is performed. If task_file is given, then the task list is written to that file. Otherwise, the task list is accessed via the task_source generator.