Skip to content

Repository files navigation

Important

Development has moved to a new repo - https://github.com/php1ic/nuclearmasses - This repo will soon be archived

PyNCH - The Python Nuclear CHart

Unit Testscodecov

Introduction

The nuclear mass tables produced by NUBASE and AME are parsed into pandas dataframes. These dataframes are then read with the dash module to create an interactive webpage to allow the user to interogate the data they are interested in.

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.

Additional functionality and polish will be added as I learn more about dash. In the meantime, suggestions are welcome via issues or a pull request.

Setup

As is the standard, you can confirm you have the necessary modules using the requirements.txt file

pip install --user -r requirements.txt

Running

With all of the necessary requirements installed, the below will start the app

python3 app.py

The console will tell you where to point your browser - likely http://127.0.0.1:8050/.

Mass tables

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.

Additional uses

If you want to do your own thing with the data, you could import this module, 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

>>>importpynch.mass_tableasmt>>>df=mt.MassTable().full_data>>>df[(df['A'] ==18) & (df['Z'] ==5)][['Experimental', 'NubaseMassExcess', 'NubaseMassExcessError', 'NubaseRelativeError', 'DiscoveryYear']]
ExperimentalNubaseMassExcessNubaseMassExcessErrorNubaseRelativeErrorDiscoveryYearTableYear2003False52320.0800.00.01529119002012True51850.0170.00.00327920102016True51790.0200.00.00386220102020True51790.0200.00.0038622010

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

>>>importpynch.mass_tableasmt>>>df=mt.MassTable().full_data>>>df.query('TableYear == 2012 and A == 100 and NubaseMassExcessError < 10.0')[['A', 'Z', 'Symbol', 'DiscoveryYear']]
AZSymbolDiscoveryYearTableYear201210040Zr1970201210041Nb1967201210042Mo1930201210043Tc1952201210044Ru1931201210047Ag1970201210048Cd1970

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?

>>>importpynch.mass_tableasmt>>>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)
AZSymbolNubaseMassExcessAMEMassExcessNUBASE-AMETableYear202022191Pa20370.020374.937-4.93720205723V-44440.0-44435.063-4.937202010250Sn-64930.0-64934.8964.896202016875Re-35790.0-35794.8894.889202020989Ac8840.08844.887-4.887202024193Np54320.054315.1154.885202012156Ba-70740.0-70744.8474.847202012255Cs-78140.0-78144.7694.769202020689Ac13480.013484.754-4.7542020239F3290.03285.2634.737

These are slightly contrived examples, but hopefully you get the idea. The data can be manipulated and added to as required.

About

python dash app to interrogate nuclear mass data

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages