libera_utils.libera_spice.spice_utils.make_kernel#
- libera_utils.libera_spice.spice_utils.make_kernel(config_file: str | Path, output_kernel: str | CloudPath | Path, input_data: DataFrame | None = None, overwrite: bool = False, append: bool | int = False) CloudPath | Path#
Create a binary SPICE kernel (CK or SPK) from a JSON configuration file and input data.
This is a low-level utility that wraps Curryer’s KernelCreator, which drives the NAIF command-line tools
mkspk(for SPK ephemeris kernels) andmsopck(for CK attitude kernels). It is used for creating binary CK and SPK kernels, including fixed-offset static SPKs and dynamic CK/SPK kernels.This function does NOT create text kernels such as LSKs (.tls), PCKs (.tpc), frame kernels (.tf), instrument kernels (.ti), or clock kernels (.tsc). Those are plain-text files managed separately.
Callers are responsible for ensuring required kernels (especially LSK and any relevant frame kernels) are furnished before calling this function.
- Parameters:
config_file (str | Path) – JSON configuration file defining how to create the kernel.
output_kernel (str | 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 (pd.DataFrame | None) – pd.DataFrame containing kernel input data. If not supplied, the config is assumed to reference an input data file.
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:
PathType
Notes
This function requires a leap second kernel (LSK) to be furnished by SPICE before it can convert times. Callers should use KernelManager.load_naif_kernels() or similar to ensure kernels are ready before calling this function.