Skip to main content

GitHub release; latest by date GitHub Release Date Test Status Documentation Status Code coverage
PyPI - Version PyPI - Format PyPI - Downloads PyPI - Python Version
GitHub commits since latest release GitHub commit activity GitHub last commit
Number of GitHub open issues Number of GitHub closed issues Number of GitHub open pull requests Number of GitHub closed pull requests
GitHub License Number of GitHub stars GitHub forks

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.

Installation

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

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 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])
>>> 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.

Links

Licensing

This code is licensed under the Apache License v2.0.

Metadata

Release files for rms-tabulation 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rms-tabulation 2.1.0
File Size Uploaded Provenance Actions
rms_tabulation-2.1.0.tar.gz 30.7 kB Without provenance Details for rms_tabulation-2.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rms-tabulation 2.1.0
File Interpreter ABI Platform Actions
rms_tabulation-2.1.0-py3-none-any.whl Python 3 none any Details for rms_tabulation-2.1.0-py3-none-any.whl

Total release size: 46.9 kB

Release files / rms_tabulation-2.1.0.tar.gz

Download URL rms_tabulation-2.1.0.tar.gz
Size 30.7 kB
Tags Source
SHA-256 checksum
How to use checksums
0a271da0f2792ed377490a1ef9348ebd6592bfd7ad845f304f12ecea8f27a4c3
BLAKE2b-256 checksum
How to use checksums
94e0b62148d235c4808bae861c8be2401d14b79cce8a44025e2c573172eb84c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / rms_tabulation-2.1.0-py3-none-any.whl

Download URL rms_tabulation-2.1.0-py3-none-any.whl
Size 16.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ba2eab3c44255f42277f2799f1d8c71763d2123df4e795f46211ea43b6fae32f
BLAKE2b-256 checksum
How to use checksums
d99765e0d7f2d1449421a71564b23366f8697b6247a3d124721ad46eaf40ca00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for rms-tabulation 2.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page