rms-tabulation


Namerms-tabulation JSON
Version 1.0.0 PyPI version JSON
download
home_pageNone
SummaryA class that performs linear interpolation
upload_time2024-09-30 23:37:40
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseApache-2.0
keywords interpolation
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-tabulation)](https://github.com/SETI/rms-tabulation/releases)
[![GitHub Release Date](https://img.shields.io/github/release-date/SETI/rms-tabulation)](https://github.com/SETI/rms-tabulation/releases)
[![Test Status](https://img.shields.io/github/actions/workflow/status/SETI/rms-tabulation/run-tests.yml?branch=main)](https://github.com/SETI/rms-tabulation/actions)
[![Documentation Status](https://readthedocs.org/projects/rms-tabulation/badge/?version=latest)](https://rms-tabulation.readthedocs.io/en/latest/?badge=latest)
[![Code coverage](https://img.shields.io/codecov/c/github/SETI/rms-tabulation/main?logo=codecov)](https://codecov.io/gh/SETI/rms-tabulation)
<br />
[![PyPI - Version](https://img.shields.io/pypi/v/rms-tabulation)](https://pypi.org/project/rms-tabulation)
[![PyPI - Format](https://img.shields.io/pypi/format/rms-tabulation)](https://pypi.org/project/rms-tabulation)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/rms-tabulation)](https://pypi.org/project/rms-tabulation)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/rms-tabulation)](https://pypi.org/project/rms-tabulation)
<br />
[![GitHub commits since latest release](https://img.shields.io/github/commits-since/SETI/rms-tabulation/latest)](https://github.com/SETI/rms-tabulation/commits/main/)
[![GitHub commit activity](https://img.shields.io/github/commit-activity/m/SETI/rms-tabulation)](https://github.com/SETI/rms-tabulation/commits/main/)
[![GitHub last commit](https://img.shields.io/github/last-commit/SETI/rms-tabulation)](https://github.com/SETI/rms-tabulation/commits/main/)
<br />
[![Number of GitHub open issues](https://img.shields.io/github/issues-raw/SETI/rms-tabulation)](https://github.com/SETI/rms-tabulation/issues)
[![Number of GitHub closed issues](https://img.shields.io/github/issues-closed-raw/SETI/rms-tabulation)](https://github.com/SETI/rms-tabulation/issues)
[![Number of GitHub open pull requests](https://img.shields.io/github/issues-pr-raw/SETI/rms-tabulation)](https://github.com/SETI/rms-tabulation/pulls)
[![Number of GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed-raw/SETI/rms-tabulation)](https://github.com/SETI/rms-tabulation/pulls)
<br />
![GitHub License](https://img.shields.io/github/license/SETI/rms-tabulation)
[![Number of GitHub stars](https://img.shields.io/github/stars/SETI/rms-tabulation)](https://github.com/SETI/rms-tabulation/stargazers)
![GitHub forks](https://img.shields.io/github/forks/SETI/rms-tabulation)

# Introduction

`tabulation` is a Python module that provides the `Tabulation` class. The `Tabulation`
class represents a mathematical function by a sequence of linear interpolations between
points defined by arrays of *x* and *y* coordinates.

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

# Installation

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

```sh
pip install rms-tabulation
```

# Getting Started

The `Tabulation` class models a mathematical function by a series of (*x*,*y*) points and
performs linear interpolation between them. Although optimized to model filter bandpasses
and spectral flux, the class is sufficiently general to be used in a wide range of
applications.

The mathematical function is treated as equal to zero outside the domain of the *x*
coordinates, with a step at the provided leading and trailing *x* coordinates. In general,
zero values (either supplied or computed) at either the leading or trailing ends are
removed. However, if explicitly supplied, one leading and/or trailing zero value is
considered significant because it anchors the interpolation of a ramp at the beginning or
end of the domain.

A variety of mathematical operations can be performed on `Tabulation` objects, including
addition, subtraction, multiplication, division, integration, and finding the X mean,
FWHM, and square width. See the [module
documentation](https://rms-tabulation.readthedocs.io/en/latest/module.html) for details.

Here are some examples to get you started:

        >>> t2 = Tabulation([0, 2, 4], [0, 5, 5])  # Ramp on leading edge
        >>> t2.domain()
        (0., 4.)
        >>> t2([0,    1,    1.9,  2,    3,    3.9,  4,    5,    6])

```python
>>> from tabulation import Tabulation
>>> t1 = Tabulation([2, 4], [10, 10])  # Leading&trailing step function
>>> t1.domain()
(2., 4.)
>>> r1 = t1([0,   1,   1.9, 2,   3,   3.9, 4,   5,   6])
array([      0.,  0.,  0., 10., 10., 10., 10.,  0.,  0.])
>>> t1.x_mean()
3.0
>>> t1.integral()
20.0

>>> t2 = Tabulation([0, 2, 4], [0, 5, 5])  # Ramp on leading edge
>>> t2.domain()
(0., 4.)
>>> r2 = t2([0,    1,  1.9, 2,  3,  3.9, 4,  5,  6])
array([      0., 2.5, 4.75, 5., 5., 5. , 5., 0., 0.])
>>> t2.x_mean()
2.6666666666666665
>>> t2.integral()
15.0

>>> t3 = t2-t1
>>> t3.domain()
(0.0, 4.0)
>>> r2-r1
array([ 0.  ,  2.5 ,  4.75, -5.  , -5.  , -5.  , -5.  ,  0.  ,  0.  ])
>>> t3([0,       1,   1.9,   2,     3,     3.9,   4,     5,     6])
array([ 0.  ,  2.5 ,  4.75, -5.  , -5.  , -5.  , -5.  ,  0.  ,  0.  ])
>>> t3.integral()
-5.000000000000001
```

# Contributing

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

# Links

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

# Licensing

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

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "rms-tabulation",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "\"Robert S. French\" <rfrench@seti.org>",
    "keywords": "interpolation",
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/ff/e9/5de5758733efea8ec9c1b6aa16515d712e27471c6c37832b63ea82247a35/rms_tabulation-1.0.0.tar.gz",
    "platform": null,
    "description": "[![GitHub release; latest by date](https://img.shields.io/github/v/release/SETI/rms-tabulation)](https://github.com/SETI/rms-tabulation/releases)\n[![GitHub Release Date](https://img.shields.io/github/release-date/SETI/rms-tabulation)](https://github.com/SETI/rms-tabulation/releases)\n[![Test Status](https://img.shields.io/github/actions/workflow/status/SETI/rms-tabulation/run-tests.yml?branch=main)](https://github.com/SETI/rms-tabulation/actions)\n[![Documentation Status](https://readthedocs.org/projects/rms-tabulation/badge/?version=latest)](https://rms-tabulation.readthedocs.io/en/latest/?badge=latest)\n[![Code coverage](https://img.shields.io/codecov/c/github/SETI/rms-tabulation/main?logo=codecov)](https://codecov.io/gh/SETI/rms-tabulation)\n<br />\n[![PyPI - Version](https://img.shields.io/pypi/v/rms-tabulation)](https://pypi.org/project/rms-tabulation)\n[![PyPI - Format](https://img.shields.io/pypi/format/rms-tabulation)](https://pypi.org/project/rms-tabulation)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/rms-tabulation)](https://pypi.org/project/rms-tabulation)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/rms-tabulation)](https://pypi.org/project/rms-tabulation)\n<br />\n[![GitHub commits since latest release](https://img.shields.io/github/commits-since/SETI/rms-tabulation/latest)](https://github.com/SETI/rms-tabulation/commits/main/)\n[![GitHub commit activity](https://img.shields.io/github/commit-activity/m/SETI/rms-tabulation)](https://github.com/SETI/rms-tabulation/commits/main/)\n[![GitHub last commit](https://img.shields.io/github/last-commit/SETI/rms-tabulation)](https://github.com/SETI/rms-tabulation/commits/main/)\n<br />\n[![Number of GitHub open issues](https://img.shields.io/github/issues-raw/SETI/rms-tabulation)](https://github.com/SETI/rms-tabulation/issues)\n[![Number of GitHub closed issues](https://img.shields.io/github/issues-closed-raw/SETI/rms-tabulation)](https://github.com/SETI/rms-tabulation/issues)\n[![Number of GitHub open pull requests](https://img.shields.io/github/issues-pr-raw/SETI/rms-tabulation)](https://github.com/SETI/rms-tabulation/pulls)\n[![Number of GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed-raw/SETI/rms-tabulation)](https://github.com/SETI/rms-tabulation/pulls)\n<br />\n![GitHub License](https://img.shields.io/github/license/SETI/rms-tabulation)\n[![Number of GitHub stars](https://img.shields.io/github/stars/SETI/rms-tabulation)](https://github.com/SETI/rms-tabulation/stargazers)\n![GitHub forks](https://img.shields.io/github/forks/SETI/rms-tabulation)\n\n# Introduction\n\n`tabulation` is a Python module that provides the `Tabulation` class. The `Tabulation`\nclass represents a mathematical function by a sequence of linear interpolations between\npoints defined by arrays of *x* and *y* coordinates.\n\n`tabulation` is a product of the [PDS Ring-Moon Systems Node](https://pds-rings.seti.org).\n\n# Installation\n\nThe `tabulation` module is available via the `rms-tabulation` package on PyPI and can be\ninstalled with:\n\n```sh\npip install rms-tabulation\n```\n\n# Getting Started\n\nThe `Tabulation` class models a mathematical function by a series of (*x*,*y*) points and\nperforms linear interpolation between them. Although optimized to model filter bandpasses\nand spectral flux, the class is sufficiently general to be used in a wide range of\napplications.\n\nThe mathematical function is treated as equal to zero outside the domain of the *x*\ncoordinates, with a step at the provided leading and trailing *x* coordinates. In general,\nzero values (either supplied or computed) at either the leading or trailing ends are\nremoved. However, if explicitly supplied, one leading and/or trailing zero value is\nconsidered significant because it anchors the interpolation of a ramp at the beginning or\nend of the domain.\n\nA variety of mathematical operations can be performed on `Tabulation` objects, including\naddition, subtraction, multiplication, division, integration, and finding the X mean,\nFWHM, and square width. See the [module\ndocumentation](https://rms-tabulation.readthedocs.io/en/latest/module.html) for details.\n\nHere are some examples to get you started:\n\n        >>> t2 = Tabulation([0, 2, 4], [0, 5, 5])  # Ramp on leading edge\n        >>> t2.domain()\n        (0., 4.)\n        >>> t2([0,    1,    1.9,  2,    3,    3.9,  4,    5,    6])\n\n```python\n>>> from tabulation import Tabulation\n>>> t1 = Tabulation([2, 4], [10, 10])  # Leading&trailing step function\n>>> t1.domain()\n(2., 4.)\n>>> r1 = t1([0,   1,   1.9, 2,   3,   3.9, 4,   5,   6])\narray([      0.,  0.,  0., 10., 10., 10., 10.,  0.,  0.])\n>>> t1.x_mean()\n3.0\n>>> t1.integral()\n20.0\n\n>>> t2 = Tabulation([0, 2, 4], [0, 5, 5])  # Ramp on leading edge\n>>> t2.domain()\n(0., 4.)\n>>> r2 = t2([0,    1,  1.9, 2,  3,  3.9, 4,  5,  6])\narray([      0., 2.5, 4.75, 5., 5., 5. , 5., 0., 0.])\n>>> t2.x_mean()\n2.6666666666666665\n>>> t2.integral()\n15.0\n\n>>> t3 = t2-t1\n>>> t3.domain()\n(0.0, 4.0)\n>>> r2-r1\narray([ 0.  ,  2.5 ,  4.75, -5.  , -5.  , -5.  , -5.  ,  0.  ,  0.  ])\n>>> t3([0,       1,   1.9,   2,     3,     3.9,   4,     5,     6])\narray([ 0.  ,  2.5 ,  4.75, -5.  , -5.  , -5.  , -5.  ,  0.  ,  0.  ])\n>>> t3.integral()\n-5.000000000000001\n```\n\n# Contributing\n\nInformation on contributing to this package can be found in the\n[Contributing Guide](https://github.com/SETI/rms-tabulation/blob/main/CONTRIBUTING.md).\n\n# Links\n\n- [Documentation](https://rms-tabulation.readthedocs.io)\n- [Repository](https://github.com/SETI/rms-tabulation)\n- [Issue tracker](https://github.com/SETI/rms-tabulation/issues)\n- [PyPi](https://pypi.org/project/rms-tabulation)\n\n# Licensing\n\nThis code is licensed under the [Apache License v2.0](https://github.com/SETI/rms-tabulation/blob/main/LICENSE).\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "A class that performs linear interpolation",
    "version": "1.0.0",
    "project_urls": {
        "Documentation": "https://rms-tabulation.readthedocs.io/en/latest",
        "Homepage": "https://github.com/SETI/rms-tabulation",
        "Issues": "https://github.com/SETI/rms-tabulation/issues",
        "Repository": "https://github.com/SETI/rms-tabulation",
        "Source": "https://github.com/SETI/rms-tabulation"
    },
    "split_keywords": [
        "interpolation"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "bef87c272bc08b449396fbdc4d653abb6cbffaf4bdba8a246535305452977b49",
                "md5": "ca99e19494c70f911d95ca9a3fca46a2",
                "sha256": "1172dbe2102c2739e10c437ec6fe50f8e89ad40577798b8cb99976c03f2724b0"
            },
            "downloads": -1,
            "filename": "rms_tabulation-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ca99e19494c70f911d95ca9a3fca46a2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 14222,
            "upload_time": "2024-09-30T23:37:39",
            "upload_time_iso_8601": "2024-09-30T23:37:39.216959Z",
            "url": "https://files.pythonhosted.org/packages/be/f8/7c272bc08b449396fbdc4d653abb6cbffaf4bdba8a246535305452977b49/rms_tabulation-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ffe95de5758733efea8ec9c1b6aa16515d712e27471c6c37832b63ea82247a35",
                "md5": "0035517af2fa3bdbbdd51febece5aab5",
                "sha256": "daaaa22d8db11eb5b81185d4083ead4778cfbc5c52c38a6415a850dd5f5c98d5"
            },
            "downloads": -1,
            "filename": "rms_tabulation-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "0035517af2fa3bdbbdd51febece5aab5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 26287,
            "upload_time": "2024-09-30T23:37:40",
            "upload_time_iso_8601": "2024-09-30T23:37:40.961435Z",
            "url": "https://files.pythonhosted.org/packages/ff/e9/5de5758733efea8ec9c1b6aa16515d712e27471c6c37832b63ea82247a35/rms_tabulation-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-30 23:37:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "SETI",
    "github_project": "rms-tabulation",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [],
    "lcname": "rms-tabulation"
}
        
Elapsed time: 0.44335s