Routines for parsing SPICE text kernels
Project description
PyPI Release | Test Status | Code Coverage |
---|---|---|
rms-textkernel
PDS Ring-Moon Systems Node, SETI Institute
Supported versions: Python >= 3.7
This is a set of routines for parsing SPICE text kernels. It returns a dictionary of all the parameters and their values. It implements the complete syntax specification as discussed in the SPICE Kernel Required Reading document, "kernel.req". However, it cannot be guaranteed that the parsing of date/time fields is identical, although dates that are unambiguous should be treated the same.
Method: textkernel.FromFile(filename, clear=True)
Input:
filename the name of a text file.
clear True to return the contents of this text kernel only;
False to return a dictionary in which the contents of the
prior call(s) to FromFile() have been merged with the new
entries.
Return: A dictionary.
Note that the returned dictionary is keyed in a very specific way based on the structure of the keyword names in the kernel. Examples:
BODY399_POLE_RA dict["BODY"][399]["POLE_RA"]
MESSAGE dict["MESSAGE"]
DELTET/EB dict["DELTET"]["EB"]
FRAME_624_NAME dict["FRAME"][624]["NAME"]
Also, frames and bodies can be referenced by their name or their numeric ID. These are equivalent:
dict["FRAME"][623] dict["FRAME"]["IAU_SUTTUNGR"]
dict["BODY"][399] dict["BODY"]["SATURN"]
Frame and body dictionaries also have an additional keyword "ID" added, which returns the numeric ID and is useful when the dictionary is selected by name instead. Example:
dict["FRAME"]["IAU_SUTTUNGR"]["ID"] = 623
dict["FRAME"][623]["ID"] = 623
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for rms_textkernel-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd1b631194d89a68846104f223925bcae6493e8f6449058c52cbfd309c47d5de |
|
MD5 | 860e15afe0e707de1802fb41b658764f |
|
BLAKE2b-256 | ec363ad6f061a32a804a115acca5c85cd9d3a95b669ce8220f1c22560b58bd46 |