Skip to main content

OpenGHG gas calibration scale conversion tool

Convert from one calibration scale to another. If multiple conversions are required, conversion functions are chained together, following the shortest path.

Conversions can be defined as a function of the original scale, or as a function of time.

For example, conversion of CO from the WMO-X2014A to the CSIRO-94 scale uses a function:

$$ \chi_{WMO} = (\chi_{CSIRO}+3.17)/0.9898 $$

Or the conversion of the SIO-93 to the SIO-98 scale for N$_2$O involves a 4th order polynomial as a function of time.

The code uses sympy to rearrange the equations to do the conversion in the reverse order, or, in the case of time-based conversions, calculate the inverse. The shortest path between two scales is found using networkx.

Please feel free to propose new scale conversions or bug fixes by submitting a pull request.

Installation

You can clone using git using:

git clone https://github.com/openghg/openghg_calscales.git

Conda and pip installation coming soon.

Usage

For example, to convert a Pandas Series or xarray DataArray from the CSIRO-94 to TU-87 scale for CH4:

from openghg_calscales import convert

ch4_tu1987 = convert(ch4_csiro94, "CH4", "CSIRO-94", "TU-1987")

Add your own functions to data/convert_functions.csv, and submit them as a pull request to share with others.

Metadata

Release files for openghg-calscales 0.1.1

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

Source distribution (sdist)

Source distribution for openghg-calscales 0.1.1
File Size Uploaded
openghg_calscales-0.1.1.tar.gz 7.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for openghg-calscales 0.1.1
File Interpreter ABI Platform
openghg_calscales-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 16.4 kB

Release files / openghg_calscales-0.1.1.tar.gz

Download URL openghg_calscales-0.1.1.tar.gz
Size 7.3 kB
Tags Source
SHA-256 checksum
How to use checksums
0bdbed2b494c94375ef841d8ee152699820dd1ddb42bc1610f48fa8b859d7081
BLAKE2b-256 checksum
How to use checksums
b9c72a282d5bfccbaf531dfce8d2ebb288865eb441fb4b49859673e3912b79a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.3

Release files / openghg_calscales-0.1.1-py3-none-any.whl

Download URL openghg_calscales-0.1.1-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
44b39f1d64ab54a3ce2a561ee48be925f8892be19cb3097aa6debd34b50d5c8d
BLAKE2b-256 checksum
How to use checksums
c852845db7d4d8779a6b937fb719883ac09ffc2d22fad037190935b6e2a5a112
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

0.1.3

2 release files

0.1.2

2 release files

This release

0.1.1 This release

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