rms-vax


Namerms-vax JSON
Version 1.0.4 PyPI version JSON
download
home_pageNone
SummaryRoutines for converting to and from vax single-precision floating-point values
upload_time2024-06-27 21:51:32
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseApache-2.0
keywords vax
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            [![GitHub release; latest by date](https://img.shields.io/github/v/release/SETI/rms-vax)](https://github.com/SETI/rms-vax/releases)
[![GitHub Release Date](https://img.shields.io/github/release-date/SETI/rms-vax)](https://github.com/SETI/rms-vax/releases)
[![Test Status](https://img.shields.io/github/actions/workflow/status/SETI/rms-vax/run-tests.yml?branch=main)](https://github.com/SETI/rms-vax/actions)
[![Documentation Status](https://readthedocs.org/projects/rms-vax/badge/?version=latest)](https://rms-vax.readthedocs.io/en/latest/?badge=latest)
[![Code coverage](https://img.shields.io/codecov/c/github/SETI/rms-vax/main?logo=codecov)](https://codecov.io/gh/SETI/rms-vax)
<br />
[![PyPI - Version](https://img.shields.io/pypi/v/rms-vax)](https://pypi.org/project/rms-vax)
[![PyPI - Format](https://img.shields.io/pypi/format/rms-vax)](https://pypi.org/project/rms-vax)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/rms-vax)](https://pypi.org/project/rms-vax)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/rms-vax)](https://pypi.org/project/rms-vax)
<br />
[![GitHub commits since latest release](https://img.shields.io/github/commits-since/SETI/rms-vax/latest)](https://github.com/SETI/rms-vax/commits/main/)
[![GitHub commit activity](https://img.shields.io/github/commit-activity/m/SETI/rms-vax)](https://github.com/SETI/rms-vax/commits/main/)
[![GitHub last commit](https://img.shields.io/github/last-commit/SETI/rms-vax)](https://github.com/SETI/rms-vax/commits/main/)
<br />
[![Number of GitHub open issues](https://img.shields.io/github/issues-raw/SETI/rms-vax)](https://github.com/SETI/rms-vax/issues)
[![Number of GitHub closed issues](https://img.shields.io/github/issues-closed-raw/SETI/rms-vax)](https://github.com/SETI/rms-vax/issues)
[![Number of GitHub open pull requests](https://img.shields.io/github/issues-pr-raw/SETI/rms-vax)](https://github.com/SETI/rms-vax/pulls)
[![Number of GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed-raw/SETI/rms-vax)](https://github.com/SETI/rms-vax/pulls)
<br />
![GitHub License](https://img.shields.io/github/license/SETI/rms-vax)
[![Number of GitHub stars](https://img.shields.io/github/stars/SETI/rms-vax)](https://github.com/SETI/rms-vax/stargazers)
![GitHub forks](https://img.shields.io/github/forks/SETI/rms-vax)

# Introduction

`vax` is a set of routines for converting between NumPy floating point and complex
scalars/arrays and VAX-format single- and double-precision floats.

`vax` is a product of the [PDS Ring-Moon Systems Node](https://pds-rings.seti.org).

# Installation

The `vax` module is available via the `rms-vax` package on PyPI and can be installed with:

```sh
pip install rms-vax
```

# Getting Started

The `vax` module provides two functions for converting *from* VAX-format floats:

- [`from_vax32`](https://rms-vax.readthedocs.io/en/latest/module.html#vax.from_vax32):
  Interpret a series of bytes or NumPy array as one or more VAX single-precision floats
  and convert them to a NumPy float or complex scalar or array.
- [`from_vax64`](https://rms-vax.readthedocs.io/en/latest/module.html#vax.from_vax64):
  Interpret a series of bytes NumPy array as one or more VAX double-precision floats and
  convert them to a NumPy float or complex scalar or array.

and two functions for converting *to* VAX-format floats::

- [`to_vax32`](https://rms-vax.readthedocs.io/en/latest/module.html#vax.to_vax32):
  Convert a NumPy float or complex scalar or array to a NumPy array containing the
  binary representation of VAX single-precision floats. Such an array can not be
  used for arithmetic operations since it is not in IEEE 754 format.
- [`to_vax32_bytes`](https://rms-vax.readthedocs.io/en/latest/module.html#vax.to_vax32_bytes):
  Convert a NumPy float or complex scalar or array to a Python `bytes` object containing
  the binary representation of VAX single-precision floats.

Note that there are no functions to convert a NumPy array to VAX double-precision format.

Details of each function are available in the [module documentation](https://rms-vax.readthedocs.io/en/latest/module.html).

Basic operation is as follows:

```python
import vax
b = vax.to_vax32([1., 2., 3.])
print(f'b = {b!r}')
ba = vax.to_vax32_bytes([1., 2., 3.])
print(f'ba = {ba!r}')
v = vax.from_vax32(b)
print(f'v = {v!r}')
va = vax.from_vax32(ba)
print(f'va = {va!r}')
```

yields:

```python
b = array([2.3138e-41, 2.3318e-41, 2.3407e-41], dtype=float32)
ba = b'\x80@\x00\x00\x00A\x00\x00@A\x00\x00'
v = array([1., 2., 3.], dtype=float32)
va = array([1., 2., 3.], dtype=float32)
```

As NASA data products stored as VAX-format floats are often provided in JPL's VICAR file
format, you may also be interested in the `rms-vicar` package
([documentation](https://rms-vicar.readthedocs.io/en/latest)).

# Contributing

Information on contributing to this package can be found in the
[Contributing Guide](https://github.com/SETI/rms-vax/blob/main/CONTRIBUTING.md).

# Links

- [Documentation](https://rms-vax.readthedocs.io)
- [Repository](https://github.com/SETI/rms-vax)
- [Issue tracker](https://github.com/SETI/rms-vax/issues)
- [PyPi](https://pypi.org/project/rms-vax)

# Licensing

This code is licensed under the [Apache License v2.0](https://github.com/SETI/rms-vax/blob/main/LICENSE).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "rms-vax",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "\"Robert S. French\" <rfrench@seti.org>",
    "keywords": "vax",
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/3b/ae/da11e4b249e748e2d865b357de72e0ba73f2f5211dde17e6caa71070a9c1/rms_vax-1.0.4.tar.gz",
    "platform": null,
    "description": "[![GitHub release; latest by date](https://img.shields.io/github/v/release/SETI/rms-vax)](https://github.com/SETI/rms-vax/releases)\n[![GitHub Release Date](https://img.shields.io/github/release-date/SETI/rms-vax)](https://github.com/SETI/rms-vax/releases)\n[![Test Status](https://img.shields.io/github/actions/workflow/status/SETI/rms-vax/run-tests.yml?branch=main)](https://github.com/SETI/rms-vax/actions)\n[![Documentation Status](https://readthedocs.org/projects/rms-vax/badge/?version=latest)](https://rms-vax.readthedocs.io/en/latest/?badge=latest)\n[![Code coverage](https://img.shields.io/codecov/c/github/SETI/rms-vax/main?logo=codecov)](https://codecov.io/gh/SETI/rms-vax)\n<br />\n[![PyPI - Version](https://img.shields.io/pypi/v/rms-vax)](https://pypi.org/project/rms-vax)\n[![PyPI - Format](https://img.shields.io/pypi/format/rms-vax)](https://pypi.org/project/rms-vax)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/rms-vax)](https://pypi.org/project/rms-vax)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/rms-vax)](https://pypi.org/project/rms-vax)\n<br />\n[![GitHub commits since latest release](https://img.shields.io/github/commits-since/SETI/rms-vax/latest)](https://github.com/SETI/rms-vax/commits/main/)\n[![GitHub commit activity](https://img.shields.io/github/commit-activity/m/SETI/rms-vax)](https://github.com/SETI/rms-vax/commits/main/)\n[![GitHub last commit](https://img.shields.io/github/last-commit/SETI/rms-vax)](https://github.com/SETI/rms-vax/commits/main/)\n<br />\n[![Number of GitHub open issues](https://img.shields.io/github/issues-raw/SETI/rms-vax)](https://github.com/SETI/rms-vax/issues)\n[![Number of GitHub closed issues](https://img.shields.io/github/issues-closed-raw/SETI/rms-vax)](https://github.com/SETI/rms-vax/issues)\n[![Number of GitHub open pull requests](https://img.shields.io/github/issues-pr-raw/SETI/rms-vax)](https://github.com/SETI/rms-vax/pulls)\n[![Number of GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed-raw/SETI/rms-vax)](https://github.com/SETI/rms-vax/pulls)\n<br />\n![GitHub License](https://img.shields.io/github/license/SETI/rms-vax)\n[![Number of GitHub stars](https://img.shields.io/github/stars/SETI/rms-vax)](https://github.com/SETI/rms-vax/stargazers)\n![GitHub forks](https://img.shields.io/github/forks/SETI/rms-vax)\n\n# Introduction\n\n`vax` is a set of routines for converting between NumPy floating point and complex\nscalars/arrays and VAX-format single- and double-precision floats.\n\n`vax` is a product of the [PDS Ring-Moon Systems Node](https://pds-rings.seti.org).\n\n# Installation\n\nThe `vax` module is available via the `rms-vax` package on PyPI and can be installed with:\n\n```sh\npip install rms-vax\n```\n\n# Getting Started\n\nThe `vax` module provides two functions for converting *from* VAX-format floats:\n\n- [`from_vax32`](https://rms-vax.readthedocs.io/en/latest/module.html#vax.from_vax32):\n  Interpret a series of bytes or NumPy array as one or more VAX single-precision floats\n  and convert them to a NumPy float or complex scalar or array.\n- [`from_vax64`](https://rms-vax.readthedocs.io/en/latest/module.html#vax.from_vax64):\n  Interpret a series of bytes NumPy array as one or more VAX double-precision floats and\n  convert them to a NumPy float or complex scalar or array.\n\nand two functions for converting *to* VAX-format floats::\n\n- [`to_vax32`](https://rms-vax.readthedocs.io/en/latest/module.html#vax.to_vax32):\n  Convert a NumPy float or complex scalar or array to a NumPy array containing the\n  binary representation of VAX single-precision floats. Such an array can not be\n  used for arithmetic operations since it is not in IEEE 754 format.\n- [`to_vax32_bytes`](https://rms-vax.readthedocs.io/en/latest/module.html#vax.to_vax32_bytes):\n  Convert a NumPy float or complex scalar or array to a Python `bytes` object containing\n  the binary representation of VAX single-precision floats.\n\nNote that there are no functions to convert a NumPy array to VAX double-precision format.\n\nDetails of each function are available in the [module documentation](https://rms-vax.readthedocs.io/en/latest/module.html).\n\nBasic operation is as follows:\n\n```python\nimport vax\nb = vax.to_vax32([1., 2., 3.])\nprint(f'b = {b!r}')\nba = vax.to_vax32_bytes([1., 2., 3.])\nprint(f'ba = {ba!r}')\nv = vax.from_vax32(b)\nprint(f'v = {v!r}')\nva = vax.from_vax32(ba)\nprint(f'va = {va!r}')\n```\n\nyields:\n\n```python\nb = array([2.3138e-41, 2.3318e-41, 2.3407e-41], dtype=float32)\nba = b'\\x80@\\x00\\x00\\x00A\\x00\\x00@A\\x00\\x00'\nv = array([1., 2., 3.], dtype=float32)\nva = array([1., 2., 3.], dtype=float32)\n```\n\nAs NASA data products stored as VAX-format floats are often provided in JPL's VICAR file\nformat, you may also be interested in the `rms-vicar` package\n([documentation](https://rms-vicar.readthedocs.io/en/latest)).\n\n# Contributing\n\nInformation on contributing to this package can be found in the\n[Contributing Guide](https://github.com/SETI/rms-vax/blob/main/CONTRIBUTING.md).\n\n# Links\n\n- [Documentation](https://rms-vax.readthedocs.io)\n- [Repository](https://github.com/SETI/rms-vax)\n- [Issue tracker](https://github.com/SETI/rms-vax/issues)\n- [PyPi](https://pypi.org/project/rms-vax)\n\n# Licensing\n\nThis code is licensed under the [Apache License v2.0](https://github.com/SETI/rms-vax/blob/main/LICENSE).\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Routines for converting to and from vax single-precision floating-point values",
    "version": "1.0.4",
    "project_urls": {
        "Documentation": "https://rms-vax.readthedocs.io/en/latest",
        "Homepage": "https://github.com/SETI/rms-vax",
        "Issues": "https://github.com/SETI/rms-vax/issues",
        "Repository": "https://github.com/SETI/rms-vax",
        "Source": "https://github.com/SETI/rms-vax"
    },
    "split_keywords": [
        "vax"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "883423fb519644294cbc3e90aec47d9e76302ee23b057a171e0d7cf97bb24049",
                "md5": "07ee5df2c2c0cbeac38622149bbc2ca0",
                "sha256": "978acb0fb8f94a4ad30b823af13ebfbb2b7a2712b42af163ec806594c7399b54"
            },
            "downloads": -1,
            "filename": "rms_vax-1.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "07ee5df2c2c0cbeac38622149bbc2ca0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 10421,
            "upload_time": "2024-06-27T21:51:30",
            "upload_time_iso_8601": "2024-06-27T21:51:30.973206Z",
            "url": "https://files.pythonhosted.org/packages/88/34/23fb519644294cbc3e90aec47d9e76302ee23b057a171e0d7cf97bb24049/rms_vax-1.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3baeda11e4b249e748e2d865b357de72e0ba73f2f5211dde17e6caa71070a9c1",
                "md5": "19e7f0f4e89de4481dff1a361b7fcabe",
                "sha256": "476c6a90fa5b2366265dba44a54968e36d35ed078d37d7ef78f7334116e9fe7c"
            },
            "downloads": -1,
            "filename": "rms_vax-1.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "19e7f0f4e89de4481dff1a361b7fcabe",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 36438,
            "upload_time": "2024-06-27T21:51:32",
            "upload_time_iso_8601": "2024-06-27T21:51:32.418281Z",
            "url": "https://files.pythonhosted.org/packages/3b/ae/da11e4b249e748e2d865b357de72e0ba73f2f5211dde17e6caa71070a9c1/rms_vax-1.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-27 21:51:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "SETI",
    "github_project": "rms-vax",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [],
    "lcname": "rms-vax"
}
        
Elapsed time: 0.30081s