pynucastro.rates.starlib_rate module#

Classes and methods for describing a reaction rate that is tabulated in terms of and temperature.along with corresponding uncertainties as per the StarLib Library

class pynucastro.rates.starlib_rate.StarLibRate(log_t9_data, log_rate_data, sigma_data, labelprops, rng=None, label='starlib', **kwargs)[source]#

Bases: TemperatureTabularRate

A rate whose temperature dependence and factor uncertainty are tabulated. Upon creation of an instance, rates at all tabulated log(T9) values are sampled.

Parameters:
log_median_rate#

A backup of the median rate, stored so we can resample

Type:

numpy.ndarray

function_string_cxx(dtype='double', specifiers='inline', leave_open=False, extra_args=None)[source]#

Return a string containing the C++ function that computes the rate, taking into account the uncertainty.

Parameters:
  • dtype (str) – The C++ datatype to use for all declarations

  • specifiers (str) – C++ specifiers to add before each function declaration (i.e. “inline”)

  • leave_open (bool) – If true, then we leave the function unclosed (no “}” at the end). This can allow additional functions to add to this output.

  • extra_args (list, tuple) – A list of strings representing additional arguments that should be appended to the argument list when defining the function interface.

Return type:

str

sample_rates(rng=None)[source]#

Sample rate values as median_rate + N(0,1)*sigma for each of the 60 entries in the data for a Starlib rate, given a non-empty seed. Use sampled rates to overwrite interpolator

Parameters:

rng (numpy.random.Generator) – An rng that draws the gaussian deviate required for rate sampling