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: str, name: str, Z: int)[source]#
Bases:
object
- class pynucastro.nucdata.elements.PeriodicTable[source]#
Bases:
object
- 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>}#
pynucastro.nucdata.halflife_table module#
pynucastro.nucdata.mass_table module#
- class pynucastro.nucdata.mass_table.MassTable(filename: str | Path = None)[source]#
Bases:
object
The purpose of this class is to:
Create a dictionary mapping nuclides to their mass excess A_nuc - A measured in MeV from the table mass_excess2020.txt.
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.
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 – we store it in a class to hold its properties, define a sorting, and give it a pretty printing string.
- Variables:
Z – atomic number
N – neutron number
A – atomic mass
nucbind – nuclear binding energy (MeV / nucleon)
short_spec_name – nucleus abbreviation (e.g. “he4”)
caps_name – capitalized short species name (e.g. “He4”)
el – element name (e.g. “he”)
pretty – LaTeX formatted version of the nucleus name
dm – mass excess (MeV)
A_nuc – nuclear mass (amu)
mass – nuclear mass (MeV)
tau – half life (s)
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.
- lower_partition()[source]#
Return the partition function value for
lower_temperature()
.
- upper_partition()[source]#
Return the partition function value for
upper_temperature()
.
- 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_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 thePartitionFunction
subdirectory.- Variables:
name – the name of the table (as defined in the data file)
temperatures – an array of temperature values
- 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: str | Path = None, reliable: bool = False)[source]#
Bases:
object
This class stores the nubase2020_1.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.