libera_utils.kernel_maker#
Module containing CLI tool for creating SPICE kernels from packets
Functions
|
Generate SPICE Az/El kernels from command line arguments. |
|
Create a SPICE kernel from an input file and kernel data product type. |
|
Generate SPICE kernels from a manifest file. |
Utility function to return an array of packet data from a list of file paths of raw JPSS APID 11 geolocation packet data files. |
|
|
Generate SPICE JPSS kernels from command line arguments. |
|
Create a Libera Az-El CK from CCSDS packets or ASCII input files The C-kernel (CK) is the component of SPICE concerned with attitude of spacecraft structures or instruments. |
|
Create a SPICE kernel from a configuration file and input data. |
|
Preprocess kernel data to perform conversions and determine time range. |
- libera_utils.kernel_maker.azel_kernel_cli_handler(parsed_args: Namespace)#
Generate SPICE Az/El kernels from command line arguments.
- Parameters:
parsed_args (argparse.Namespace) – Namespace of parsed CLI arguments.
- Returns:
Output manifest file containing one or more kernel files.
- Return type:
- libera_utils.kernel_maker.from_args(input_data_files: list[str], kernel_identifier: str, output_dir: str, overwrite=False, append=False, verbose=False)#
Create a SPICE kernel from an input file and kernel data product type.
- Parameters:
input_data_files (list of str or pathlib.Path) – Input data files.
kernel_identifier (str or DataProductIdentifier) – Data product identifier that is associated with a kernel.
output_dir (str or AnyPath) – Output location for the SPICE kernels and output manifest.
overwrite (bool, optional) – Option to overwrite any existing similar-named SPICE kernels.
append (bool, optional) – Option to append to any existing similar-named SPICE kernels.
verbose (bool, optional) – Option to log with extra verbosity.
- Returns:
Output kernel file path.
- Return type:
str or AnyPath
- libera_utils.kernel_maker.from_manifest(input_manifest: str, data_product_identifiers: list[str], output_dir: str, overwrite=False, append=False, verbose=False)#
Generate SPICE kernels from a manifest file.
- Parameters:
input_manifest (str or AnyPath) – Input manifest file containing one or more input data files.
data_product_identifiers (list[str]) – One or more SPICE kernel data product identifiers.
output_dir (str or AnyPath) – Output location for the SPICE kernels and output manifest.
overwrite (bool, optional) – Option to overwrite any existing similar-named SPICE kernels.
append (bool, optional) – Option to append to any existing similar-named SPICE kernels.
verbose (bool, optional) – Option to log with extra verbosity.
- Returns:
Output manifest file containing one or more kernel files.
- Return type:
- libera_utils.kernel_maker.get_spice_packet_data_from_filepaths(packet_data_filepaths: list[str])#
Utility function to return an array of packet data from a list of file paths of raw JPSS APID 11 geolocation packet data files.
- Parameters:
- packet_data_filepathslist of str or cloudpathlib.anypath.AnyPath
The list of file paths to the raw packet data
- :returns: **packet_data – The configured packet data. See packets.py for more details on structure**
- :rtype: numpy.ndarray
- libera_utils.kernel_maker.jpss_kernel_cli_handler(parsed_args: Namespace)#
Generate SPICE JPSS kernels from command line arguments.
- Parameters:
parsed_args (argparse.Namespace) – Namespace of parsed CLI arguments.
- Returns:
Output manifest file containing one or more kernel files.
- Return type:
- libera_utils.kernel_maker.make_azel_ck(parsed_args: Namespace)#
Create a Libera Az-El CK from CCSDS packets or ASCII input files The C-kernel (CK) is the component of SPICE concerned with attitude of spacecraft structures or instruments.
- Parameters:
parsed_args (argparse.Namespace) – Namespace of parsed CLI arguments
- Return type:
None
- libera_utils.kernel_maker.make_kernel(config_file: str, output_kernel: str, input_data: str = None, overwrite: bool = False, append: bool = False)#
Create a SPICE kernel from a configuration file and input data.
- Parameters:
config_file (str or pathlib.Path) – JSON configuration file defining how to create the kernel.
output_kernel (str or cloudpathlib.anypath.AnyPath) – Output directory or file to create the kernel. If a directory, the file name will be based on the config_file, but with the SPICE file extension.
input_data (str or pathlib.Path or pd.DataFrame, optional) – Input data file or object. Not required if defined within the config.
overwrite (bool, optional) – Option to overwrite an existing file.
append (bool, optional) – Option to append to an existing file.
- Returns:
Output kernel file path
- Return type:
- libera_utils.kernel_maker.preprocess_data(input_data_file, nominal_time_field: str = None, pkt_time_fields: list[str] = None)#
Preprocess kernel data to perform conversions and determine time range.
- Parameters:
input_data_file (str or pathlib.Path) – Input data file.
nominal_time_field (str) – Name of the field to store the converted time field as.
pkt_time_fields (list of str) – Name of the telemetry packet time fields used to convert the time.
- Returns:
pd.DataFrame – Loaded SPICE kernel data.
datetime.datetime, datetime.datetime – The date time range of the data.