OpenGHG gas calibration scale conversion tool
Project description
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
pip
You can install openghg_calcscales
using pip
pip install openghg_calscales
conda
Or with conda
by doing
conda install -c conda-forge -c openghg openghg_calscales
Developer
If you want to make modifications to the package you can use an editable install with pip
First, clone the repository using git
git clone https://github.com/openghg/openghg_calscales.git
And then install the package using pip
pip install -e openghg_calscales/
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.
Development
For the recommended development process please see the OpenGHG documentation
Release
The package is released using GitHub actions and pushed to conda and PyPI.
1. Update the CHANGELOG
- Update the changelog to add the header for the new version and add the date.
- Update the Unreleased header to match the version you're releasing and
...HEAD
.
2. Update pyproject.toml
For a new release the package version must be updated in the pyproject.toml
file. Try and follow the Semantic Versioning method.
3. Tag the commit
Now tag the commit. First we create the tag and add a message (remember to insert correct version numbers here).
git tag -a x.x.x -m "openghg_calscales release vx.x.x"
Next push the tag. This will trigger the automated release by GitHub Actions.
git push origin x.x.x
4. Check GitHub Actions runners
Check the GitHub Actions runners to ensure the tests have all passed and the build for conda and PyPI has run successfully.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file openghg_calscales-0.1.2.tar.gz
.
File metadata
- Download URL: openghg_calscales-0.1.2.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
5fa71122621bc6bee6a807081bdb868cce53354c6f926663e3794671f504162c
|
|
MD5 |
96457b4f2d9825464f7956aad3a99d03
|
|
BLAKE2b-256 |
4f9b69d7ffd8fa0b1b364a7e3e46010372edd9c791ff9b03b83ef4a6dadb16e8
|
Provenance
The following attestation bundles were made for openghg_calscales-0.1.2.tar.gz
:
Publisher:
test_build.yaml
on openghg/openghg_calscales
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
openghg_calscales-0.1.2.tar.gz
-
Subject digest:
5fa71122621bc6bee6a807081bdb868cce53354c6f926663e3794671f504162c
- Sigstore transparency entry: 250005124
- Sigstore integration time:
-
Permalink:
openghg/openghg_calscales@faf5b8130c3765de4825c66ea4630ee33eb65165
-
Branch / Tag:
refs/tags/0.1.2
- Owner: https://github.com/openghg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
test_build.yaml@faf5b8130c3765de4825c66ea4630ee33eb65165
-
Trigger Event:
push
-
Statement type:
File details
Details for the file openghg_calscales-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: openghg_calscales-0.1.2-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
ff50a3edc989ed3c5a83ac28f769dc8906bb0c2ee7b5ebad0213fa3769af0357
|
|
MD5 |
be8d934eb5206ce12d5f708e9ef05d98
|
|
BLAKE2b-256 |
ad49fcbb1e11199dd707837c1422cae7fdc744dff1ff66aa7610be0bd3138f9d
|
Provenance
The following attestation bundles were made for openghg_calscales-0.1.2-py3-none-any.whl
:
Publisher:
test_build.yaml
on openghg/openghg_calscales
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
openghg_calscales-0.1.2-py3-none-any.whl
-
Subject digest:
ff50a3edc989ed3c5a83ac28f769dc8906bb0c2ee7b5ebad0213fa3769af0357
- Sigstore transparency entry: 250005136
- Sigstore integration time:
-
Permalink:
openghg/openghg_calscales@faf5b8130c3765de4825c66ea4630ee33eb65165
-
Branch / Tag:
refs/tags/0.1.2
- Owner: https://github.com/openghg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
test_build.yaml@faf5b8130c3765de4825c66ea4630ee33eb65165
-
Trigger Event:
push
-
Statement type: