[![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/8f/8c/c3b5bffddffac8fd10f3de5eb3d756ca4d142e5fdb25a7af581280d33795/rms_tabulation-1.1.1.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.1.1",
"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": "38e1a046b16c7e1726c7982feab954a173a0bb7a9b11282842891aab801e343b",
"md5": "8aab9d9011025600373a510b8e0765bb",
"sha256": "453b056632b4909ffa3e625f9aa4b0b220737f7de8045fef5251929ce62b0e4f"
},
"downloads": -1,
"filename": "rms_tabulation-1.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8aab9d9011025600373a510b8e0765bb",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 15740,
"upload_time": "2024-12-16T20:40:45",
"upload_time_iso_8601": "2024-12-16T20:40:45.167366Z",
"url": "https://files.pythonhosted.org/packages/38/e1/a046b16c7e1726c7982feab954a173a0bb7a9b11282842891aab801e343b/rms_tabulation-1.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8f8cc3b5bffddffac8fd10f3de5eb3d756ca4d142e5fdb25a7af581280d33795",
"md5": "e9458b9e4e33b53fc82195e9f85ac29d",
"sha256": "1ae47eee67805c1a552b97c973c2bc84b2e6697e00b71e2c26659527d4108fed"
},
"downloads": -1,
"filename": "rms_tabulation-1.1.1.tar.gz",
"has_sig": false,
"md5_digest": "e9458b9e4e33b53fc82195e9f85ac29d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 29023,
"upload_time": "2024-12-16T20:40:47",
"upload_time_iso_8601": "2024-12-16T20:40:47.413909Z",
"url": "https://files.pythonhosted.org/packages/8f/8c/c3b5bffddffac8fd10f3de5eb3d756ca4d142e5fdb25a7af581280d33795/rms_tabulation-1.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-16 20:40:47",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "SETI",
"github_project": "rms-tabulation",
"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": "scipy",
"specs": []
},
{
"name": "sphinx",
"specs": []
},
{
"name": "sphinxcontrib-napoleon",
"specs": []
},
{
"name": "sphinx-rtd-theme",
"specs": []
}
],
"lcname": "rms-tabulation"
}