pynucastro.rates.tabular_rate module#

class pynucastro.rates.tabular_rate.TableIndex(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

An enum-like container for indexing the electron-capture tables

DQ = 3#
GAMMA = 7#
MU = 2#
NU = 6#
RATE = 5#
RHOY = 0#
T = 1#
VS = 4#
class pynucastro.rates.tabular_rate.TableInterpolator(*args, **kwargs)[source]#

Bases: TableInterpolator

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

Parameters:
  • table_rhoy_lines (int) – the number of the (ρ Y_e) values where the rate is tabulated

  • table_temp_lines (int) – the number of T values where the rate is tabulated

  • table_data (numpy.ndarray) – a 2D array giving the tabulated rate data of the form (index, component) where index is a 1D flattened representation of (rhoY, T).

class_type = jitclass.TableInterpolator#7f74f6fbd910<data:array(float64, 2d, A),table_rhoy_lines:int32,table_temp_lines:int32,rhoy:array(float64, 1d, A),temp:array(float64, 1d, A)>#
class pynucastro.rates.tabular_rate.TabularRate(rfile=None)[source]#

Bases: Rate

A rate tabulated in terms of log10(ρ Y_e) and log10(T).

Parameters:

rfile (str, pathlib.Path, io.StringIO) – the file containing the data table

eval(T, *, rho=None, comp=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 (not needed for ReacLib rates).

  • comp (float) – the composition (of type Composition) to evaluate the rate with (not needed for ReacLib rates).

Return type:

float

function_string_py()[source]#

Construct the python function that computes the rate.

Return type:

str

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

Evaluate the neutrino loss for the 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.

Return type:

float

get_rate_id()[source]#

Get an identifying string for this rate.

Return type:

str

get_tabular_rate()[source]#

Read the rate data from .dat file

plot(*, Tmin=None, Tmax=None, rhoYmin=None, rhoYmax=None, color_field='rate', figsize=(10, 10))[source]#

Plot the rate or neutrino loss in the log10(ρ Y_e) and log10(T) plane.

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

  • Tmax (float) – maximum temperature for the plot

  • rhoYmin (float) – minimum (ρ Y_e) for the plto

  • rhoYmax (float) – maximum (ρ Y_e) for the plto

  • color_field (str) – the field to plot. Possible values are “rate” or “nu_loss”

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

Return type:

matplotlib.figure.Figure