A python package to parse and store the various files published by AME and NUBASE
Project description
Nuclear Masses
Introduction
Python package to parse the various files published by the AME and NUBASE. The files produced by the AME and NUBASE have unique formats so this package does the hard work for you and parses the data into a pandas dataframe for simple access.
No guarantee is supplied with regards to the accuracy of the data presented. Estimated values are included, please always refer to the original sources. All data should, however, be accurate.
Mass tables
The data files released by the papers linked below are used to create the mass tables read by this code. There was no AME data published in 1997, but the 1995 AME matches the 1997 NUBASE according to section 4, "The tables" on P31 of these proceedings. As a result the 1997 NUBASE data is referred to as being from 1995 for simplicity when merging data.
There are published papers for 1971 and 1977, but I can't find the associated data files. If you are reading this and know of someone with a copy, or have any information, please let me know via this issue #13
- AME1983
- AME1993
- AME1995 + NUBASE1997
- AME2003 + NUBASE2003
- AME2012 + NUBASE2012
- AME2016 + NUBASE2016
- AME2020 + NUBASE2020
The NUBASE files are read for all of the data values, with the AME files being used to populate an additional mass excess data field. No comparison or validation is done on common values.
Setup
The package is available on the Python Package Index so can be installed via pip
pip install nuclearmasses
Or you can clone the latest version from github.
All work is done on a feature branch so cloning and using main should be the same as using the latest installed version from pip.
git clone https://github.com/php1ic/nuclearmasses
Usage
[!IMPORTANT] While every effort is made to maintain a stable API, this module is relatively new so users should not be surprised if there are changes between versions. If a breaking change has been introduced, it will always be highlighted in the CHANGELOG.
The combination of AME and NUBASE values from all years is available as a single dataframe
>>> from nuclearmasses.mass_table import MassTable
>>> df = MassTable().data
You can then interrogate, or extract, whatever information you want. For example, how has the mass excess and it's accuracy changed overtime for 190Re according to the AME
>>> df[(df['A'] == 190) & (df['Symbol'] == 'Re')][['AMEMassExcess', 'AMEMassExcessError']]
AMEMassExcess AMEMassExcessError
16054 -35536.605 200.029
16055 -35557.789 145.549
16056 -35568.032 212.151
16057 -35566.326 149.248
16058 -35634.992 70.542
16059 -35635.830 70.852
16060 -35583.015 4.870
Or how does the mass excess of gold vary across the isotopic chain according to NUBASE in the most recent table for both experimentally measured and theoretical values
>>> df.query("TableYear == 2020 and Symbol == 'Au'")[['A', 'NUBASEMassExcess', 'NUBASEMassExcessError', 'Experimental']]
A NUBASEMassExcess NUBASEMassExcessError Experimental
14084 168 2530.0 400.0 False
14189 169 -1790.0 300.0 False
14291 170 -3700.0 200.0 False
14391 171 -7562.0 21.0 True
14492 172 -9320.0 60.0 True
14591 173 -12832.0 23.0 True
14687 174 -14060.0 100.0 False
14781 175 -17400.0 40.0 True
14874 176 -18520.0 30.0 True
14968 177 -21546.0 10.0 True
15060 178 -22303.0 10.0 True
15153 179 -24989.0 12.0 True
15244 180 -25626.0 5.0 True
15334 181 -27871.0 20.0 True
15419 182 -28304.0 19.0 True
15503 183 -30191.0 9.0 True
15588 184 -30319.0 22.0 True
15673 185 -31858.1 2.6 True
15757 186 -31715.0 21.0 True
15842 187 -33029.0 22.0 True
15926 188 -32371.3 2.7 True
16007 189 -33582.0 20.0 True
16088 190 -32834.0 3.0 True
16164 191 -33798.0 5.0 True
16243 192 -32772.0 16.0 True
16320 193 -33405.0 9.0 True
16401 194 -32211.9 2.1 True
16480 195 -32567.1 1.1 True
16560 196 -31138.7 3.0 True
16637 197 -31139.8 0.5 True
16713 198 -29580.8 0.5 True
16788 199 -29093.8 0.5 True
16861 200 -27240.0 27.0 True
16935 201 -26401.0 3.0 True
17012 202 -24353.0 23.0 True
17089 203 -23143.0 3.0 True
17163 204 -20390.0 200.0 False
17237 205 -18570.0 200.0 False
17308 206 -14190.0 300.0 False
17382 207 -10640.0 300.0 False
17456 208 -5910.0 300.0 False
17528 209 -2230.0 400.0 False
17603 210 2680.0 400.0 False
Contributing
If you have ideas for additional functionality or find bugs please create an issue or better yet a pull request.
We use a combination of ruff and mypy to keep things tidy and hopefully catch errors and bugs before they happen. The command below returns no errors or issues so should be run after any code changes. We might add a CI pipeline in the future, but for the moment, it's a manual process.
ruff format && ruff check && mypy src
Known issues
- #6 The decay mode field from the NUBASE data is stored 'as-is' from the file. It looks like it can be split on the ';' character for isotopes where there is more than one mode. A dictionary of {decay mode: fraction} may be the best way to store all of this information.
- #7 Information from anything other than the ground state of an isotope is ignored when parsing the NUBASE file. The selection of what is and what is not included appears random to me which is why I simply ignored for the moment.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nuclearmasses-0.1.0.tar.gz.
File metadata
- Download URL: nuclearmasses-0.1.0.tar.gz
- Upload date:
- Size: 4.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09e8fa7b7ce96c370e7693862c4e335ab5850cca8cdd8962d435272c164a9a3e
|
|
| MD5 |
e110773a98f59e197b7d28fd27e758dc
|
|
| BLAKE2b-256 |
823d37185a9f0992e6fe09899953182401b5ce16377da9d1c0f615b6c2e3b73d
|
Provenance
The following attestation bundles were made for nuclearmasses-0.1.0.tar.gz:
Publisher:
publish-to-pypi.yml on php1ic/nuclearmasses
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nuclearmasses-0.1.0.tar.gz -
Subject digest:
09e8fa7b7ce96c370e7693862c4e335ab5850cca8cdd8962d435272c164a9a3e - Sigstore transparency entry: 1239403061
- Sigstore integration time:
-
Permalink:
php1ic/nuclearmasses@18d052209571bde1de5f2b7b9cd9c762e4ebf3a7 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/php1ic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@18d052209571bde1de5f2b7b9cd9c762e4ebf3a7 -
Trigger Event:
push
-
Statement type:
File details
Details for the file nuclearmasses-0.1.0-py3-none-any.whl.
File metadata
- Download URL: nuclearmasses-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
168b0b086c83c74f249682dbd9d1ecc5d4a33262586aa4793434a59b043770dc
|
|
| MD5 |
65ec146d00062112f69d1ad583bbfe9d
|
|
| BLAKE2b-256 |
1358858ebed2c5da4b7d627db9e4b633adc4189c245786cbdd31fa170975e49b
|
Provenance
The following attestation bundles were made for nuclearmasses-0.1.0-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on php1ic/nuclearmasses
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nuclearmasses-0.1.0-py3-none-any.whl -
Subject digest:
168b0b086c83c74f249682dbd9d1ecc5d4a33262586aa4793434a59b043770dc - Sigstore transparency entry: 1239403063
- Sigstore integration time:
-
Permalink:
php1ic/nuclearmasses@18d052209571bde1de5f2b7b9cd9c762e4ebf3a7 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/php1ic
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@18d052209571bde1de5f2b7b9cd9c762e4ebf3a7 -
Trigger Event:
push
-
Statement type: