The nuclear mass tables produced by NUBASE and AME have unique formats. This package does the hard work for you and parses the files into a single pandas dataframe for simpler 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.
Suggestions are welcome via issues or a pull request.
The data files released by the papers linked below are used to create the mass tables read by this code
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.
Until the package is added to Python Package Index, the local clone of the repo must be installed from within the top level directory.
pip install -e .
Import the module to access MassTable().full_data
, then sort, slice and filter the resultant dataframe to your heart's content.
For example, track how the accuracy of the mass excess of 18B changes once it is experimentally measured
>>> import pynch.mass_table as mt
>>> df = mt.MassTable().full_data
>>> df[(df['A'] == 18) & (df['Z'] == 5)][['Experimental', 'NUBASEMassExcess', 'NUBASEMassExcessError', 'NUBASERelativeError', 'DiscoveryYear']]
Experimental NUBASEMassExcess NUBASEMassExcessError NUBASERelativeError DiscoveryYear
TableYear
2003 False 52320.0 800.0 0.015291 1900
2012 True 51850.0 170.0 0.003279 2010
2016 True 51790.0 200.0 0.003862 2010
2020 True 51790.0 200.0 0.003862 2010
Or for all of the A=100 isotopes from the 2012 table that have a mass-excess error < 10.0keV, print the A, Z, symbol and year of discovery
>>> import pynch.mass_table as mt
>>> df = mt.MassTable().full_data
>>> df.query('TableYear == 2012 and A == 100 and NUBASEMassExcessError < 10.0')[['A', 'Z', 'Symbol', 'DiscoveryYear']]
A Z Symbol DiscoveryYear
TableYear
2012 100 40 Zr 1970
2012 100 41 Nb 1967
2012 100 42 Mo 1930
2012 100 43 Tc 1952
2012 100 44 Ru 1931
2012 100 47 Ag 1970
2012 100 48 Cd 1970
Or how does the NUBASE mass-excess compare with the AME value for experimentally measured isotopes from the latest table? Which are the 10 isotopes with the biggest differences?
>>> import pynch.mass_table as mt
>>> df = mt.MassTable().full_data
>>> # Create a new column comparing the measured values
>>> df['NUBASE-AME'] = df['NUBASEMassExcess'] - df['AMEMassExcess']
>>> # Extract the data for measured isotopes and from the latest table
>>> df_comparison = df.query('TableYear == 2020 and Experimental == True')
>>> # Sort the difference in measured data by absolute value and print the columns we are interested in
>>> df_comparison.sort_values(by=['NUBASE-AME'], key=abs, ascending=False)[['A', 'Z', 'Symbol', 'NUBASEMassExcess', 'AMEMassExcess', 'NUBASE-AME']].head(n=10)
A Z Symbol NUBASEMassExcess AMEMassExcess NUBASE-AME
TableYear
2020 221 91 Pa 20370.0 20374.937 -4.937
2020 57 23 V -44440.0 -44435.063 -4.937
2020 102 50 Sn -64930.0 -64934.896 4.896
2020 168 75 Re -35790.0 -35794.889 4.889
2020 209 89 Ac 8840.0 8844.887 -4.887
2020 241 93 Np 54320.0 54315.115 4.885
2020 121 56 Ba -70740.0 -70744.847 4.847
2020 122 55 Cs -78140.0 -78144.769 4.769
2020 206 89 Ac 13480.0 13484.754 -4.754
2020 23 9 F 3290.0 3285.263 4.737
These are slightly contrived examples, but hopefully you get the idea. The data can be manipulated and added to as required.