pynucastro.mesa_utils module#
A collection of methods for accessing data from a MESA models as read by py_mesa_reader, and putting them into a form that pynucastro can use.
- class pynucastro.mesa_utils.MesaModel(model)[source]#
Bases:
objectRead data from a MESA model and store the thermodynamic state for each zone in a pynucastro-compatible format.
- Parameters:
model (
mesa_reader.MesaData) – The MESA model as read bymesa_reader.MesaData
- get_data_array(var='T')[source]#
Return an array of a single variable indexed by zone
- Parameters:
var (str) – The name of the variable to access. This must be a member of
MesaZoneState.- Return type:
- get_peak_index(var)[source]#
Return the index in the MESA model with the highest value of var.
- Parameters:
var (str) – The name of the variable to access. This must be a member of
MesaZoneState.- Return type:
- class pynucastro.mesa_utils.MesaZoneState(r, m, rho, T, comp)[source]#
Bases:
objectA container for a single MESA zone’s data
- comp#
the composition of the zone
- Type:
- pynucastro.mesa_utils.get_nuclei(model)[source]#
Return a list of nuclei contained in the MESA model.
- pynucastro.mesa_utils.get_zone_data(model, i, *, nuclei=None)[source]#
Return a tuple of (rho, T, composition) for a single zone from the MESA model. These are the thermodynamic conditions needed to evaluate a pynucastro network’s rates.
- Parameters:
model (
mesa_reader.MesaData) – The MESA model as read bymesa_reader.MesaDatai (int) – The MESA zone index
nuclei (list(Nucleus)) – The list of nuclei in the MESA model. This will be read from the model if not provided, but if you are looping over multiple zones in succession, passing a cached list in can speed up the reading.
- Return type: