pynucastro.rates.temperature_tabular_rate module#

Classes and methods for describing a reaction rate that is tabulated in terms of electron density and temperature.

class pynucastro.rates.temperature_tabular_rate.TempTableInterpolator(*args, **kwargs)[source]#

Bases: TempTableInterpolator

A class that holds a pointer to the rate data and methods that allow us to interpolate the rate

Parameters:
  • log_temp_points (numpy.ndarray) – an array giving the temperature at the points where we tabulate the rate — this is log(T9)

  • log_rate_data (numpy.ndarray) – an array giving the tabulated log(rate) data

class_type = jitclass.TempTableInterpolator#7f5e96338ef0<log_temp_points:array(float64, 1d, A),log_rate_data:array(float64, 1d, A)>#
class pynucastro.rates.temperature_tabular_rate.TemperatureTabularRate(log_t9_data, log_rate_data, rate_source=None, label='temptab', **kwargs)[source]#

Bases: Rate

A rate whose temperature dependence is tabulated.

Note: presently this only supports strong-mediated rates.

Parameters:
  • log_t9_data (numpy.ndarray) – The temperature (in log(T / 1.e9 K)) where we tabulate the rate

  • log_rate_data (numpy.ndarray) – The tabulated log(rate) data, N_A <σv>

eval(T, *, rho=None, comp=None, screen_func=None)[source]#

Evaluate the reaction rate.

Parameters:
  • T (float) – the temperature to evaluate the rate at

  • rho (float) – the density to evaluate the rate at.

  • comp (float) – the composition (of type Composition) to evaluate the rate with.

  • screen_func (Callable) – one of the screening functions from pynucastro.screening – if provided, then the rate will include screening correction.

Return type:

float

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

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

function_string_py()[source]#

Construct the python function that computes the rate.

Return type:

str

plot(*, Tmin=None, Tmax=None, figsize=(6, 6), rho=None, comp=None, screen_func=None)[source]#

Plot the rate as a function of temperature.

Parameters:
  • Tmin (float) – minimum temperature for the plot

  • Tmax (float) – maximum temperature for the plot

  • figsize (tuple) – the horizontal, vertical size (in inches) for the plot

  • rho (float) – the density to evaluate the screening effect.

  • comp (float) – the composition (of type Composition) to evaluate the screening effect.

  • screen_func (Callable) – one of the screening functions from pynucastro.screening – if provided, then the rate will include the screening correction.

Return type:

matplotlib.figure.Figure