View on GitHub

Masstable

The Nuclear Mass Table Toolkit

Download this project as a .zip file Download this project as a tar.gz file

Nuclear Mass Table Toolkit

The Nuclear Mass Table Toolkit provides utilities to work with nuclear mass tables. At the moment the following tables are supported:

Full documentation: http://masstable.readthedocs.org/en/latest/

Source code: https://github.com/elyase/masstable

Quickstart:

Table creation

Indexing, accessing elements

Table objects support fancy indexing. For example to list all lead(Z=82) isotopes:

>>> ame[82,:]
Out[7]:
          AME2003
Z  N
82 96    3.567800
   98   -1.939209
   99   -3.144762
   100  -6.826135
   101  -7.568734
   102 -11.045339
   ...

>>> ame[82,126:128]
Out[8]:
          AME2003
Z  N
82 126 -21.748455
   127 -17.614440
   128 -14.728292

To access a simple element just do:

>>> ame[82,126]
    Out[9]:
          AME2003
Z  N
82 126 -21.748455

>>> Table('AME1995')[82,126]
Out[11]:
          AME1995
Z  N
82 126 -21.763563

For more complicated relations the select method can be used. For example to select all nuclei with A > 160 we can do:

>>> A_gt_160 = lambda Z,N: Z + N > 160
>>> Table('AME2003').select(A_gt_160)
>>> table = Table('AME2012').even_even.s2n
Z  N 
2  2           NaN
   4      0.975454
   6      2.125034
   8     -1.417666
4  2           NaN
       ...
>>> condition = lambda Z,N: Z > 28 and N > 28
>>> table.select(condition)
30  30    28.016334
    32    23.136434
    34    20.978934
    36    19.037934
    38    17.250334
    40    15.700534
       ...

Derived quantities

** Example: Plot binding energies per nucleon.**

>>> t = Table('AME2012')
>>> (t.binding_energy/t.A).plot()

binding_energies

Install

Just do:

pip install masstable

Requirements

Credits

Yaser Martinez