parse_metakernel()
Parse a SPICE metakernel (.tm) file from a local path, without needing a database.
Usage
parse_metakernel(path)Handles multiple \begindata / \begintext blocks as the SPICE specification describes.
Parameters
path: str | Path-
The
.tmfile.
Returns
ParsedMetakernel-
The parsed
PATH_VALUES,PATH_SYMBOLSandKERNELS_TO_LOAD, with the header.source_pathis the absolute path of the file.
Raises
FileNotFoundError- path does not exist.
Examples
>>> from spice_kernel_db import parse_metakernel
>>> mk = parse_metakernel("demo.tm") # a file with the two kernels of the next example
>>> mk.symbol_map{‘KERNELS’: ‘/data/kernels’}
>>> mk.kernel_filenames()[‘naif0012.tls’, ‘jup365.bsp’]