pynucastro.nucdata package#

Properties of nuclei needed in construction reaction rates (in particular, the binding energies)

Submodules#

pynucastro.nucdata.elements module#

class pynucastro.nucdata.elements.Element(abbreviation, name, Z)[source]#

Bases: object

class pynucastro.nucdata.elements.PeriodicTable[source]#

Bases: object

classmethod lookup_Z(Z)[source]#
classmethod lookup_abbreviation(abbrev)[source]#
table = {'ac': <pynucastro.nucdata.elements.Element object>, 'ag': <pynucastro.nucdata.elements.Element object>, 'al': <pynucastro.nucdata.elements.Element object>, 'am': <pynucastro.nucdata.elements.Element object>, 'ar': <pynucastro.nucdata.elements.Element object>, 'as': <pynucastro.nucdata.elements.Element object>, 'at': <pynucastro.nucdata.elements.Element object>, 'au': <pynucastro.nucdata.elements.Element object>, 'b': <pynucastro.nucdata.elements.Element object>, 'ba': <pynucastro.nucdata.elements.Element object>, 'be': <pynucastro.nucdata.elements.Element object>, 'bh': <pynucastro.nucdata.elements.Element object>, 'bi': <pynucastro.nucdata.elements.Element object>, 'bk': <pynucastro.nucdata.elements.Element object>, 'br': <pynucastro.nucdata.elements.Element object>, 'c': <pynucastro.nucdata.elements.Element object>, 'ca': <pynucastro.nucdata.elements.Element object>, 'cd': <pynucastro.nucdata.elements.Element object>, 'ce': <pynucastro.nucdata.elements.Element object>, 'cf': <pynucastro.nucdata.elements.Element object>, 'cl': <pynucastro.nucdata.elements.Element object>, 'cm': <pynucastro.nucdata.elements.Element object>, 'cn': <pynucastro.nucdata.elements.Element object>, 'co': <pynucastro.nucdata.elements.Element object>, 'cr': <pynucastro.nucdata.elements.Element object>, 'cs': <pynucastro.nucdata.elements.Element object>, 'cu': <pynucastro.nucdata.elements.Element object>, 'db': <pynucastro.nucdata.elements.Element object>, 'ds': <pynucastro.nucdata.elements.Element object>, 'dy': <pynucastro.nucdata.elements.Element object>, 'er': <pynucastro.nucdata.elements.Element object>, 'es': <pynucastro.nucdata.elements.Element object>, 'eu': <pynucastro.nucdata.elements.Element object>, 'f': <pynucastro.nucdata.elements.Element object>, 'fe': <pynucastro.nucdata.elements.Element object>, 'fl': <pynucastro.nucdata.elements.Element object>, 'fm': <pynucastro.nucdata.elements.Element object>, 'fr': <pynucastro.nucdata.elements.Element object>, 'ga': <pynucastro.nucdata.elements.Element object>, 'gd': <pynucastro.nucdata.elements.Element object>, 'ge': <pynucastro.nucdata.elements.Element object>, 'h': <pynucastro.nucdata.elements.Element object>, 'he': <pynucastro.nucdata.elements.Element object>, 'hf': <pynucastro.nucdata.elements.Element object>, 'hg': <pynucastro.nucdata.elements.Element object>, 'ho': <pynucastro.nucdata.elements.Element object>, 'hs': <pynucastro.nucdata.elements.Element object>, 'i': <pynucastro.nucdata.elements.Element object>, 'in': <pynucastro.nucdata.elements.Element object>, 'ir': <pynucastro.nucdata.elements.Element object>, 'k': <pynucastro.nucdata.elements.Element object>, 'kr': <pynucastro.nucdata.elements.Element object>, 'la': <pynucastro.nucdata.elements.Element object>, 'li': <pynucastro.nucdata.elements.Element object>, 'lr': <pynucastro.nucdata.elements.Element object>, 'lu': <pynucastro.nucdata.elements.Element object>, 'lv': <pynucastro.nucdata.elements.Element object>, 'mc': <pynucastro.nucdata.elements.Element object>, 'md': <pynucastro.nucdata.elements.Element object>, 'mg': <pynucastro.nucdata.elements.Element object>, 'mn': <pynucastro.nucdata.elements.Element object>, 'mo': <pynucastro.nucdata.elements.Element object>, 'mt': <pynucastro.nucdata.elements.Element object>, 'n': <pynucastro.nucdata.elements.Element object>, 'na': <pynucastro.nucdata.elements.Element object>, 'nb': <pynucastro.nucdata.elements.Element object>, 'nd': <pynucastro.nucdata.elements.Element object>, 'ne': <pynucastro.nucdata.elements.Element object>, 'nh': <pynucastro.nucdata.elements.Element object>, 'ni': <pynucastro.nucdata.elements.Element object>, 'no': <pynucastro.nucdata.elements.Element object>, 'np': <pynucastro.nucdata.elements.Element object>, 'o': <pynucastro.nucdata.elements.Element object>, 'og': <pynucastro.nucdata.elements.Element object>, 'os': <pynucastro.nucdata.elements.Element object>, 'p': <pynucastro.nucdata.elements.Element object>, 'pa': <pynucastro.nucdata.elements.Element object>, 'pb': <pynucastro.nucdata.elements.Element object>, 'pd': <pynucastro.nucdata.elements.Element object>, 'pm': <pynucastro.nucdata.elements.Element object>, 'po': <pynucastro.nucdata.elements.Element object>, 'pr': <pynucastro.nucdata.elements.Element object>, 'pt': <pynucastro.nucdata.elements.Element object>, 'pu': <pynucastro.nucdata.elements.Element object>, 'ra': <pynucastro.nucdata.elements.Element object>, 'rb': <pynucastro.nucdata.elements.Element object>, 're': <pynucastro.nucdata.elements.Element object>, 'rf': <pynucastro.nucdata.elements.Element object>, 'rg': <pynucastro.nucdata.elements.Element object>, 'rh': <pynucastro.nucdata.elements.Element object>, 'rn': <pynucastro.nucdata.elements.Element object>, 'ru': <pynucastro.nucdata.elements.Element object>, 's': <pynucastro.nucdata.elements.Element object>, 'sb': <pynucastro.nucdata.elements.Element object>, 'sc': <pynucastro.nucdata.elements.Element object>, 'se': <pynucastro.nucdata.elements.Element object>, 'sg': <pynucastro.nucdata.elements.Element object>, 'si': <pynucastro.nucdata.elements.Element object>, 'sm': <pynucastro.nucdata.elements.Element object>, 'sn': <pynucastro.nucdata.elements.Element object>, 'sr': <pynucastro.nucdata.elements.Element object>, 'ta': <pynucastro.nucdata.elements.Element object>, 'tb': <pynucastro.nucdata.elements.Element object>, 'tc': <pynucastro.nucdata.elements.Element object>, 'te': <pynucastro.nucdata.elements.Element object>, 'th': <pynucastro.nucdata.elements.Element object>, 'ti': <pynucastro.nucdata.elements.Element object>, 'tl': <pynucastro.nucdata.elements.Element object>, 'tm': <pynucastro.nucdata.elements.Element object>, 'ts': <pynucastro.nucdata.elements.Element object>, 'u': <pynucastro.nucdata.elements.Element object>, 'v': <pynucastro.nucdata.elements.Element object>, 'w': <pynucastro.nucdata.elements.Element object>, 'xe': <pynucastro.nucdata.elements.Element object>, 'y': <pynucastro.nucdata.elements.Element object>, 'yb': <pynucastro.nucdata.elements.Element object>, 'zn': <pynucastro.nucdata.elements.Element object>, 'zr': <pynucastro.nucdata.elements.Element object>}#
exception pynucastro.nucdata.elements.UnidentifiedElement[source]#

Bases: Exception

pynucastro.nucdata.halflife_table module#

class pynucastro.nucdata.halflife_table.HalfLifeTable(filename=None)[source]#

Bases: object

Read the table of halflives (in seconds) extracted from the Nubase compilation in halflife2020.txt

get_halflife(a, z)[source]#

pynucastro.nucdata.mass_table module#

class pynucastro.nucdata.mass_table.MassTable(filename=None)[source]#

Bases: object

The purpose of this class is to:

  1. Create a dictionary mapping nuclides to their mass excess A_nuc - A measured in MeV from the table mass_excess2020.txt.

  2. Parse the information of the previously defined dictionary to the Nucleus class.

The only required variable to construct an instance of this class is : var filename: that contains the .txt table file with the nuclei and their mass excess. If this variable is not provided, then mass_excess2020.txt is considered by default.

get_mass_diff(a, z)[source]#

pynucastro.nucdata.nucleus module#

Classes and methods to interface with files storing rate data.

class pynucastro.nucdata.nucleus.Nucleus(name, dummy=False)[source]#

Bases: object

A nucleus that participates in a reaction.

Parameters:
  • name (str) – name of the nucleus (e.g. “c12”)

  • dummy (bool) – a dummy nucleus is one that we can use where a nucleus is needed, but it is not considered to be part of the network

Z#

atomic number

Type:

float

N#

neutron number

Type:

float

A#

atomic mass

Type:

float

short_spec_name#

nucleus abbreviation (e.g. “he4”)

Type:

str

caps_name#

capitalized short species name (e.g. “He4”)

Type:

str

el#

element name (e.g. “he”)

Type:

str

pretty#

LaTeX formatted version of the nucleus name

Type:

str

dm#

mass excess (MeV)

Type:

float

nucbind#

nuclear binding energy (MeV / nucleon)

Type:

float

A_nuc#

nuclear mass (amu)

Type:

float

mass#

nuclear mass (MeV)

Type:

float

tau#

half life (s)

Type:

float

spin_states#

the ground state spin

Type:

int

partition_function#

the PartitionFunction object for this nucleus, which allows for the evaluation of the temperature-dependent partition function.

Type:

PartitionFunction

dummy#

is this a dummy nucleus

Type:

bool

nse#

an NSE proton has the same properties as a proton but compares as being distinct

Type:

bool

c()[source]#

Return the capitalized-style name

classmethod cast(obj)[source]#

Create a Nucleus from a string

Parameters:

obj (str or Nucleus) – the object to cast. If it is a Nucleus, then we simply return it.

Return type:

Nucleus

classmethod cast_list(lst, *, allow_None=False, allow_single=False)[source]#

Convert a list of objects into a list of Nucleus objects

Parameters:
  • lst (list) – a list of str or Nucleus

  • allow_None (bool) – allow lst = None and simply return None

  • allow_single (bool) – allow lst to be a single str or Nucleus instead of a list

Return type:

list

cindex()[source]#

Return the name for C++ indexing

classmethod from_Z_A(Z, A, dummy=False)[source]#

Create a nucleus given Z and A

Parameters:
  • Z (int) – atomic number

  • A (int) – atomic weight

  • dummy (bool) – a dummy nucleus is one that we can use where a nucleus is needed, but it is not considered to be part of the network

Return type:

Nucleus

classmethod from_cache(name, dummy=False)[source]#

Check if we’ve already created this nucleus, and if so, return a reference to it from the cache.

Parameters:
  • name (str) – name of the nucleus (e.g. “c12”)

  • dummy (bool) – a dummy nucleus is one that we can use where a nucleus is needed, but it is not considered to be part of the network

Return type:

Nucleus

exception pynucastro.nucdata.nucleus.UnsupportedNucleus[source]#

Bases: Exception

pynucastro.nucdata.nucleus.get_all_nuclei()[source]#

Return a list with every Nucleus that has a known mass

Return type:

list

pynucastro.nucdata.nucleus.get_nuclei_in_range(zmin, zmax, amin, amax)[source]#

Given a range of Z = [zmin, zmax], and A = [amin, amax], return a list of Nucleus objects for all nuclei in this range

Parameters:
  • zmin (int) – minimum atomic number

  • zmax (int) – maximum atomic number

  • amin (int) – minimum atomic weight

  • amax (int) – maximum atomic weight

Return type:

list

pynucastro.nucdata.partition_function module#

class pynucastro.nucdata.partition_function.PartitionFunction(nucleus, name, temperature, partition_function, interpolant_order=3)[source]#

Bases: object

This class holds the tabulated data for the partition function for a specific nucleus, which can be combined with other (non-overlapping) partition functions by addition and evaluated for different temperature values.

Adding two PartitionFunction objects is implemented by simply appending the temperature and partition function arrays of the higher-temperature partition function to those of the lower-temperature partition function. If the temperature ranges overlap, however, an exception is generated.

If either of the PartitionFunction objects added have already had a spline interpolant constructed, then construct a new spline interpolant for the returned PartitionFunction of order equal to the maximum order of the added PartitionFunction objects.

Variables:
  • nucleus – a string composed by a lowercase element and the atomic number, e.g. "ni56"

  • name – the name of the table on which the nucleus is read

  • temperature – a sorted array of all the temperatures involved

  • partition_function – an array with all the partition function values given in the same order as temperature

  • interpolant_order – the interpolation spline order, must be between 1 and 5, inclusive

construct_spline_interpolant(order=3)[source]#

Construct an interpolating univariate spline of order >= 1 and order <= 5 using the scipy InterpolatedUnivariateSpline implementation.

Interpolate in log space for the partition function and in GK for temperature.

eval(T)[source]#

Return the interpolated partition function value for the temperature T.

lower_partition()[source]#

Return the partition function value for lower_temperature().

lower_temperature()[source]#

Return the lowest temperature this object supports.

upper_partition()[source]#

Return the partition function value for upper_temperature().

upper_temperature()[source]#

Return the highest temperature this object supports.

class pynucastro.nucdata.partition_function.PartitionFunctionCollection(use_high_temperatures=True, use_set='frdm')[source]#

Bases: object

This class holds a collection of PartitionFunctionTable objects in a dictionary keyed by the name of the tables.

In our discussion we have two different sets of tables: FRDM and ETFSI-Q.

Variables:
  • use_high_temperatures – whether to incorporate the high-temperature data tables

  • use_set – selects between the FRDM ('frdm') and ETFSI-Q ('etfsiq') data sets.

get_nuclei()[source]#

Return a set of all the nuclei this collection supports.

get_partition_function(nuc)[source]#

Return the PartitionFunction object for a specific nucleus.

class pynucastro.nucdata.partition_function.PartitionFunctionTable(file_name)[source]#

Bases: object

Class for reading a partition function table file. A PartitionFunction object is constructed for each nucleus and stored in a dictionary keyed by the lowercase nucleus name in the form e.g. “ni56”. The table files are stored in the PartitionFunction subdirectory.

Variables:
  • name – the name of the table (as defined in the data file)

  • temperatures – an array of temperature values

get_nuclei()[source]#

Return a set of the nuclei this table supports.

get_partition_function(nuc)[source]#

Return the PartitionFunction object for a specific nucleus.

pynucastro.nucdata.spin_table module#

class pynucastro.nucdata.spin_table.SpinTable(datafile=None, reliable=False)[source]#

Bases: object

This class stores the spins2020.txt table information in a dictionary data structure that maps nuclides to their number of nuclear spin states. Therefore, after setting an SpinTable class in rates.py, we can retrieve the spin states for a designated Nucleus class.

The variable reliable switch between using all the values of the tables, excluding the nuclei where only intervals are given and the values measured by strong experimental arguments.

get_spin_states(a, z)[source]#