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.