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. |
|
Generate SPICE JPSS kernels from command line arguments. |
|
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 | CloudPath | Path], kernel_identifier: str | DataProductIdentifier, output_dir: str | CloudPath | Path, overwrite=False, append=False, verbose=False) CloudPath | Path #
Create a SPICE kernel from an input file and kernel data product type.
- Parameters:
input_data_files (list[str, filenaming.PathType]) – Input data files.
kernel_identifier (str | DataProductIdentifier) – Data product identifier that is associated with a kernel.
output_dir (str | filenaming.PathType) – Output location for the SPICE kernels and output manifest.
overwrite (bool) – Option to overwrite any existing similar-named SPICE kernels.
append (bool) – Option to append to any existing similar-named SPICE kernels. If multiple input files are provided with append=False, the first file will create a new kernel, and subsequent files will append to it.
verbose (bool) – Option to log with extra verbosity.
- Returns:
Output kernel file path.
- Return type:
filenaming.PathType
- libera_utils.kernel_maker.from_manifest(input_manifest: str | CloudPath | Path, data_product_identifiers: list[str], output_dir: str | CloudPath | Path, overwrite=False, append=False, verbose=False)#
Generate SPICE kernels from a manifest file.
- Parameters:
input_manifest (str | filenaming.PathType) – 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 | filenaming.PathType) – 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.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_kernel(config_file: str | Path, output_kernel: str | CloudPath | Path, input_data: str | Path | None = None, overwrite: bool = False, append: bool | int = False) CloudPath | Path #
Create a SPICE kernel from a configuration file and input data.
- Parameters:
config_file (str | pathlib.Path) – JSON configuration file defining how to create the kernel.
output_kernel (str | filenaming.PathType) – 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 | filenaming.PathType or pd.DataFrame, optional) – Input data file or object. Not required if defined within the config.
overwrite (bool) – Option to overwrite an existing file.
append (bool | int) – Option to append to an existing file. Anything truthy will be treated as True.
- Returns:
Output kernel file path
- Return type:
filenaming.PathType
- libera_utils.kernel_maker.preprocess_data(input_data_file: str | CloudPath | Path, nominal_time_field: str, pkt_time_fields: Sequence[str], kernel_identifier: DataProductIdentifier) tuple[DataFrame, tuple[datetime, datetime]] #
Preprocess kernel data to perform conversions and determine time range.
- Parameters:
input_data_file (str | filenaming.PathType) – Input data file.
nominal_time_field (str) – Name of the field to store the converted time field as.
pkt_time_fields (Sequence[str]) – Names of the telemetry packet time fields used to convert the time.
kernel_identifier (DataProductIdentifier) – The kernel type being generated (needed to determine which packet reader to use).
- Returns:
pd.DataFrame – Loaded SPICE kernel data.
datetime.datetime, datetime.datetime – The date time range of the data.