Skip to main content

Struct Extract Interface

Warning: This page is a Work In Progress

For projects that use packet file archives, XINA Mining (struct_mining) and Export (struct_export) delegates the decoding and conversion of mnemonic data to a mission specific tool, which we will reference as struct_extract. This tool should implement the following interface for integration with XINA.

Environment
  • The app should be runnable on Ubuntu 22.04.
  • Any required environment setup will be performed on a per project basis.
Input

struct_extract should accept a single argument which is the path to a JSON file. The JSON file defines the parameters needed to extract the requested mnemonic data. Project specific keys can be added as needed. The following table defines the standard parameters:

Note: If raw, eng, or sci are not provided, all mnemonics should be extracted as "science".

Key Required Description
dir The path to the dir containing the archive file and any ancillary files needed for processing
dest The path to the dir that all output (e.g. xbin file) should be placed
mission TBC: The mission which may be needed to determine how the archive file is processed
model TBC: The mission's model which may be needed to determine how the archive file is processed
raw The mnemonic IDs of the mnemonics that should be extracted and output, unconverted
eng The mnemonic IDs of the mnemonics that should be extracted and output with the engineering conversion applied
sci The mnemonic IDs of the mnemonics that should be extracted and output with the science conversion applied
time_mode For projects that support it, defines which time source should be used when timestamping the mnemonic data. Either "pkt" or "grt" (ground receipt time). If not provided, it should default to packet time.

Example JSON configuration file:

{
}
Output

The output of the tool should be a xbin file. XINA's tools will then process the xbin file to produce the required mine or export products.

For mission specific data, struct_extract should output using one of the following options [TBD]:

  • Self generate the data file and corresponding XINA JSON import file. XINA will take care of importing the data.
  • Output the data into the xbin file. XINA will take care of the rest.
Return Codes

Return codes are used by the struct_extract app to return final execution status to the XINA processing.

Name Code Description
Success 0 Execution was successful
Error 1 Generic error code for unsuccessful execution. A more specific error code should be preferred over this one.
Finished with warnings 3 Execution finished but there were warnings. The log file should be examined for more info