rms-textkernel


Namerms-textkernel JSON
Version 1.0.1 PyPI version JSON
download
home_page
SummaryRoutines for parsing SPICE text kernels
upload_time2024-01-24 23:36:24
maintainer
docs_urlNone
author
requires_python>=3.8
licenseApache-2.0
keywords spice naif jpl space geometry ephemeris text kernel
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            | PyPI Release | Test Status | Code Coverage |
| ------------ | ----------- | ------------- |
| [![PyPI version](https://badge.fury.io/py/rms-textkernel.svg)](https://badge.fury.io/py/rms-textkernel) | [![Build status](https://img.shields.io/github/actions/workflow/status/SETI/rms-textkernel/run-tests.yml?branch=main)](https://github.com/SETI/rms-textkernel/actions) | [![Code coverage](https://img.shields.io/codecov/c/github/SETI/rms-textkernel/main?logo=codecov)](https://codecov.io/gh/SETI/rms-textkernel) |

# rms-textkernel

Supported versions: Python >= 3.8

## PDS Ring-Moon Systems Node, SETI Institute
## TextKernel Library

This is a set of routines for parsing SPICE text kernels. The simplest use case is as
follows:
```
        import textkernel
        tkdict = textkernel.from_file('path/to/kernel/file')
```

The returned dictionary is keyed by all the parameter names (on the left side of an equal
sign) in the text kernel, and each associated dictionary value is that found on the right
side. Values are Python ints, floats, strings, datetime objects, or lists of one or more
of these.

This module implements the complete syntax specification as discussed in the SPICE Kernel
Required Reading document, "kernel.req":
        <https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/req/kernel.html>

For convenience, the returned dictionary adds additional, "hierarchical" keys that provide
alternative access to the same values. Hierarchical keys are substrings from the original
parameter name, which return a sub-dictionary keyed by part or all of the remainder of
that parameter name.

Parameter names with a slash are split apart as if they represented components of a file
directory tree, so these are equivalent:
```
        tkdict["DELTET/EB"] == tkdict["DELTET"]["EB"]
```

When a body or frame ID is embedded inside a parameter name, it is extracted, converted
to integer, and used as a piece of the hierarchy, making these equivalent:
```
        tkdict["BODY399_POLE_RA"] == tkdict["BODY"][399]["POLE_RA"]
        tkdict["SCLK01_MODULI_32"] == tkdict["SCLK"][-32]["01_MODULI"]
```

Leading and trailing underscores before and after the embedded numeric ID are stripped
from the hierarchical keys, as you can see in the examples above. Note also that the
components of the parameter name are re-ordered in the second example, so that the
second key is always the numeric ID.

When the name associated with a body or frame ID is known, that name can be used in the
place of the integer ID:
```
        tkdict["BODY"][399] == tkdict["BODY"]["EARTH"]
        tkdict["FRAME"][10013] == tkdict["FRAME"]["IAU_EARTH"]
        tkdict["SCLK"][-32] == tkdict["SCLK"]["VOYAGER 2"]
```

If a frame is uniquely or primarily associated with a particular central body, that
body's ID can also be used in place of the frame's ID:
```
        tkdict["FRAME"][399] == tkdict["FRAME"]["IAU_EARTH"]
```

Note that the "BODY" and "FRAME" dictionaries also have an additional entry keyed by "ID",
which returns the associated integer ID:
```
        tkdict["FRAME"][623]["ID"] = 623
        tkdict["FRAME"]["IAU_SUTTUNGR"]["ID"] = 623
```
This ensures that you can look up a body or frame by name and readily obtain its ID.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "rms-textkernel",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "\"Robert S. French\" <rfrench@seti.org>",
    "keywords": "spice,naif,jpl,space,geometry,ephemeris,text kernel",
    "author": "",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/7c/80/84947357dd9ee0d034463ec40bacb6cfdb1cafd04f73a6b4fe41771f46f2/rms-textkernel-1.0.1.tar.gz",
    "platform": null,
    "description": "| PyPI Release | Test Status | Code Coverage |\n| ------------ | ----------- | ------------- |\n| [![PyPI version](https://badge.fury.io/py/rms-textkernel.svg)](https://badge.fury.io/py/rms-textkernel) | [![Build status](https://img.shields.io/github/actions/workflow/status/SETI/rms-textkernel/run-tests.yml?branch=main)](https://github.com/SETI/rms-textkernel/actions) | [![Code coverage](https://img.shields.io/codecov/c/github/SETI/rms-textkernel/main?logo=codecov)](https://codecov.io/gh/SETI/rms-textkernel) |\n\n# rms-textkernel\n\nSupported versions: Python >= 3.8\n\n## PDS Ring-Moon Systems Node, SETI Institute\n## TextKernel Library\n\nThis is a set of routines for parsing SPICE text kernels. The simplest use case is as\nfollows:\n```\n        import textkernel\n        tkdict = textkernel.from_file('path/to/kernel/file')\n```\n\nThe returned dictionary is keyed by all the parameter names (on the left side of an equal\nsign) in the text kernel, and each associated dictionary value is that found on the right\nside. Values are Python ints, floats, strings, datetime objects, or lists of one or more\nof these.\n\nThis module implements the complete syntax specification as discussed in the SPICE Kernel\nRequired Reading document, \"kernel.req\":\n        <https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/req/kernel.html>\n\nFor convenience, the returned dictionary adds additional, \"hierarchical\" keys that provide\nalternative access to the same values. Hierarchical keys are substrings from the original\nparameter name, which return a sub-dictionary keyed by part or all of the remainder of\nthat parameter name.\n\nParameter names with a slash are split apart as if they represented components of a file\ndirectory tree, so these are equivalent:\n```\n        tkdict[\"DELTET/EB\"] == tkdict[\"DELTET\"][\"EB\"]\n```\n\nWhen a body or frame ID is embedded inside a parameter name, it is extracted, converted\nto integer, and used as a piece of the hierarchy, making these equivalent:\n```\n        tkdict[\"BODY399_POLE_RA\"] == tkdict[\"BODY\"][399][\"POLE_RA\"]\n        tkdict[\"SCLK01_MODULI_32\"] == tkdict[\"SCLK\"][-32][\"01_MODULI\"]\n```\n\nLeading and trailing underscores before and after the embedded numeric ID are stripped\nfrom the hierarchical keys, as you can see in the examples above. Note also that the\ncomponents of the parameter name are re-ordered in the second example, so that the\nsecond key is always the numeric ID.\n\nWhen the name associated with a body or frame ID is known, that name can be used in the\nplace of the integer ID:\n```\n        tkdict[\"BODY\"][399] == tkdict[\"BODY\"][\"EARTH\"]\n        tkdict[\"FRAME\"][10013] == tkdict[\"FRAME\"][\"IAU_EARTH\"]\n        tkdict[\"SCLK\"][-32] == tkdict[\"SCLK\"][\"VOYAGER 2\"]\n```\n\nIf a frame is uniquely or primarily associated with a particular central body, that\nbody's ID can also be used in place of the frame's ID:\n```\n        tkdict[\"FRAME\"][399] == tkdict[\"FRAME\"][\"IAU_EARTH\"]\n```\n\nNote that the \"BODY\" and \"FRAME\" dictionaries also have an additional entry keyed by \"ID\",\nwhich returns the associated integer ID:\n```\n        tkdict[\"FRAME\"][623][\"ID\"] = 623\n        tkdict[\"FRAME\"][\"IAU_SUTTUNGR\"][\"ID\"] = 623\n```\nThis ensures that you can look up a body or frame by name and readily obtain its ID.\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Routines for parsing SPICE text kernels",
    "version": "1.0.1",
    "project_urls": {
        "Homepage": "https://github.com/SETI/rms-textkernel",
        "Issues": "https://github.com/SETI/rms-textkernel/issues",
        "Repository": "https://github.com/SETI/rms-textkernel",
        "Source": "https://github.com/SETI/rms-textkernel"
    },
    "split_keywords": [
        "spice",
        "naif",
        "jpl",
        "space",
        "geometry",
        "ephemeris",
        "text kernel"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a229d447bff10abccaac01f84b7b2f565ffb0dd74e29e58b4cb3ebbcf6acee17",
                "md5": "2fa479af51a833fc7302c3b279c98552",
                "sha256": "1cf66e5f4011167d83e9f31ddc88225194c15cfd9afc59762728a9863ea799f3"
            },
            "downloads": -1,
            "filename": "rms_textkernel-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "2fa479af51a833fc7302c3b279c98552",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 42471,
            "upload_time": "2024-01-24T23:36:21",
            "upload_time_iso_8601": "2024-01-24T23:36:21.904221Z",
            "url": "https://files.pythonhosted.org/packages/a2/29/d447bff10abccaac01f84b7b2f565ffb0dd74e29e58b4cb3ebbcf6acee17/rms_textkernel-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7c8084947357dd9ee0d034463ec40bacb6cfdb1cafd04f73a6b4fe41771f46f2",
                "md5": "da6416f6a756294d83683c3157f80c4c",
                "sha256": "1840c16bbe3dfd01d8b0d270cb30f0e3617c0f0ea03bcded1c32b0e93aa1b2f8"
            },
            "downloads": -1,
            "filename": "rms-textkernel-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "da6416f6a756294d83683c3157f80c4c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 259177,
            "upload_time": "2024-01-24T23:36:24",
            "upload_time_iso_8601": "2024-01-24T23:36:24.156557Z",
            "url": "https://files.pythonhosted.org/packages/7c/80/84947357dd9ee0d034463ec40bacb6cfdb1cafd04f73a6b4fe41771f46f2/rms-textkernel-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-24 23:36:24",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "SETI",
    "github_project": "rms-textkernel",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [],
    "lcname": "rms-textkernel"
}
        
Elapsed time: 0.26905s