libera_utils.kernel_maker#
Module containing CLI tool for creating SPICE kernels from packets
Functions
Utility function to return an array of packet data from a list of file paths of raw JPSS APID 11 geolocation packet data files. |
|
|
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 JPSS CK from APID 11 CCSDS packets. |
Alpha function triggering kernel generation from manifest file. |
|
|
Create a JPSS SPK from APID 11 CCSDS packets. |
|
Write ephemeris and attitude data to MKSPK and MSOPCK input data files, respectively. |
|
Write an MSOPCK or MKSPK compatible setup file of key-value pairs. |
- libera_utils.kernel_maker.get_spice_packet_data_from_filepaths(packet_data_filepaths)#
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
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.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_jpss_ck(parsed_args: Namespace)#
Create a JPSS CK from APID 11 CCSDS packets. 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_jpss_kernels_from_manifest(manifest_file_path: str, output_directory: str)#
Alpha function triggering kernel generation from manifest file.
If the manifest configuration field contains “start_time” and “end_time” fields then this function will select only packet data that falls in that range. If these are not given, then all packet data will be used.
- Parameters:
manifest_file_path (str or cloudpathlib.anypath.AnyPath) – Path to the manifest file that includes end_time and start_time in the configuration section
output_directory (str or cloudpathlib.anypath.AnyPath) – Path to save the completed kernels
- Returns:
output_directory – Path to the directory containing the completed kernels
- Return type:
- libera_utils.kernel_maker.make_jpss_spk(parsed_args: Namespace)#
Create a JPSS SPK from APID 11 CCSDS packets. The SPK system is the component of SPICE concerned with ephemeris data (position/velocity).
- Parameters:
parsed_args (argparse.Namespace) – Namespace of parsed CLI arguments
- Return type:
None
- libera_utils.kernel_maker.write_kernel_input_file(data: ndarray, filepath: str, fields: list = None, fmt: str = '%.16f')#
Write ephemeris and attitude data to MKSPK and MSOPCK input data files, respectively.
- See MSOPCK documentation here:
https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/ug/msopck.html
- See MKSPK documentation here:
https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/ug/mkspk.html
- Parameters:
data (numpy.ndarray) – Structured array (named, with data types) of attitude or ephemeris data.
filepath (str or pathlib.Path) – Filepath to write to.
fields (list) – Optional. List of field names to write out to the data file. If not specified, assume fields are already in the proper order.
fmt (str or list) – Format specifier(s) to pass to np.savetxt. Default is to assume everything should be floats with 16 decimal places of precision (%.16f). If a list is passed, it must contain a format specifier for each column in data.
- Returns:
Absolute path to written file.
- Return type:
- libera_utils.kernel_maker.write_kernel_setup_file(data: dict, filepath: Path)#
Write an MSOPCK or MKSPK compatible setup file of key-value pairs. See documentation here: https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/ug/msopck.html#Input%20Data%20Format
- Parameters:
data (dict) – Dictionary of key-value pairs to write to the setup file.
filepath (pathlib.Path) – Filepath to write to.
- Returns:
Absolute path to written file.
- Return type: