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.0.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.0.0
File Size Uploaded
rms_tabulation-2.0.0.tar.gz 30.3 kB Details

Built distribution (wheel)

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

Total release size: 46.5 kB

Release files / rms_tabulation-2.0.0.tar.gz

Download URL rms_tabulation-2.0.0.tar.gz
Size 30.3 kB
Tags Source
SHA-256 checksum
How to use checksums
5788a09a49c6c5ef0a1645c2d8b22366afb26815947fbc7eb17e4e0b420f19d2
BLAKE2b-256 checksum
How to use checksums
e511df31f9fedc4124695ba1c26e0f60cb9df94c6403f5803ea1fb17d2b7ec19
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

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

Download URL rms_tabulation-2.0.0-py3-none-any.whl
Size 16.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
db50a0d9719454c99558e366904c7677235801c9ab5458895b8901721cd189dd
BLAKE2b-256 checksum
How to use checksums
ae5ebde0a3421d2f45975dd22f390cbd9e8039ac9d61b4200b0eff9265eef312
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.9

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

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