rms-vax


Namerms-vax JSON
Version 1.0.5 PyPI version JSON
download
home_pageNone
SummaryRoutines for converting to and from vax single-precision floating-point values
upload_time2024-12-16 21:03:58
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseApache-2.0
keywords vax
VCS
bugtrack_url
requirements coverage flake8 myst-parser numpy pytest sphinx sphinxcontrib-napoleon sphinx-rtd-theme
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/ca/20/69ed9131f7677790c9f1b51f0b69656575ab4b93090a45201527a55b2bbd/rms_vax-1.0.5.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.5",
    "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": "78f9407a90f936fa3fbfea576845e18798f05398c832e3055207e68a24eda432",
                "md5": "a23b6387a3b16c00d62143062e249865",
                "sha256": "cf81320d3b0adb85d881a1f5e2a348c3e42aaec3b34f090b16d84e91d0a8f57a"
            },
            "downloads": -1,
            "filename": "rms_vax-1.0.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a23b6387a3b16c00d62143062e249865",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 10422,
            "upload_time": "2024-12-16T21:03:56",
            "upload_time_iso_8601": "2024-12-16T21:03:56.421048Z",
            "url": "https://files.pythonhosted.org/packages/78/f9/407a90f936fa3fbfea576845e18798f05398c832e3055207e68a24eda432/rms_vax-1.0.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ca2069ed9131f7677790c9f1b51f0b69656575ab4b93090a45201527a55b2bbd",
                "md5": "2cd78c622e4d2faadc13b933c07a6e4e",
                "sha256": "7e83e7461e5a7d5d765225220bfd8e27242b5f20838d930bf3665d9ef66211b0"
            },
            "downloads": -1,
            "filename": "rms_vax-1.0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "2cd78c622e4d2faadc13b933c07a6e4e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 36443,
            "upload_time": "2024-12-16T21:03:58",
            "upload_time_iso_8601": "2024-12-16T21:03:58.689997Z",
            "url": "https://files.pythonhosted.org/packages/ca/20/69ed9131f7677790c9f1b51f0b69656575ab4b93090a45201527a55b2bbd/rms_vax-1.0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-16 21:03:58",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "SETI",
    "github_project": "rms-vax",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [
        {
            "name": "coverage",
            "specs": []
        },
        {
            "name": "flake8",
            "specs": []
        },
        {
            "name": "myst-parser",
            "specs": []
        },
        {
            "name": "numpy",
            "specs": []
        },
        {
            "name": "pytest",
            "specs": []
        },
        {
            "name": "sphinx",
            "specs": []
        },
        {
            "name": "sphinxcontrib-napoleon",
            "specs": []
        },
        {
            "name": "sphinx-rtd-theme",
            "specs": []
        }
    ],
    "lcname": "rms-vax"
}
        
Elapsed time: 0.44540s