pynucastro.nucdata.nucleus module#

Classes and methods to interface with files storing rate data.

class pynucastro.nucdata.nucleus.Nucleus(name, dummy=False)[source]#

Bases: object

A nucleus that participates in a reaction.

Parameters:
  • name (str) – name of the nucleus (e.g. “c12” or “12C”). This is case-insensitive.

  • dummy (bool) – a dummy nucleus is one that we can use where a nucleus is needed, but it is not considered to be part of the network

Z#

atomic number

Type:

float

N#

neutron number

Type:

float

A#

atomic mass

Type:

float

short_spec_name#

nucleus abbreviation (e.g. “he4”)

Type:

str

caps_name#

capitalized short species name (e.g. “He4”)

Type:

str

el#

element name (e.g. “he”)

Type:

str

pretty#

LaTeX formatted version of the nucleus name

Type:

str

dm#

mass excess (MeV)

Type:

float

nucbind#

nuclear binding energy (MeV / nucleon)

Type:

float

A_nuc#

nuclear mass (amu)

Type:

float

mass#

nuclear mass (MeV)

Type:

float

tau#

half life (s)

Type:

float

spin_states#

the ground state spin

Type:

int

partition_function#

the PartitionFunction object for this nucleus, which allows for the evaluation of the temperature-dependent partition function.

Type:

PartitionFunction

dummy#

is this a dummy nucleus

Type:

bool

nse#

an NSE proton has the same properties as a proton but compares as being distinct

Type:

bool

spin_reliable#

whether the number of spin states is supported by experimentally strong arguments

Type:

bool

c()[source]#

Return the capitalized-style name

classmethod cast(obj)[source]#

Create a Nucleus from a string

Parameters:

obj (str or Nucleus) – the object to cast. If it is a Nucleus, then we simply return it.

Return type:

Nucleus

classmethod cast_list(lst, *, allow_None=False, allow_single=False)[source]#

Convert a list of objects into a list of Nucleus objects

Parameters:
  • lst (list) – a list of str or Nucleus

  • allow_None (bool) – allow lst = None and simply return None

  • allow_single (bool) – allow lst to be a single str or Nucleus instead of a list

Return type:

list

cindex()[source]#

Return the name for C++ indexing

classmethod from_Z_A(Z, A, dummy=False)[source]#

Create a nucleus given Z and A

Parameters:
  • Z (int) – atomic number

  • A (int) – atomic weight

  • dummy (bool) – a dummy nucleus is one that we can use where a nucleus is needed, but it is not considered to be part of the network

Return type:

Nucleus

classmethod from_cache(name, dummy=False)[source]#

Check if we’ve already created this nucleus, and if so, return a reference to it from the cache.

Parameters:
  • name (str) – name of the nucleus (e.g. “c12”)

  • dummy (bool) – a dummy nucleus is one that we can use where a nucleus is needed, but it is not considered to be part of the network

Return type:

Nucleus

get_part_func_threshold_temp()[source]#

Return the temperature corresponding to the last value where the partition function is equal to 1. For temperatures higher than this, the partition function is not equal to 1.

Return type:

float

summary()[source]#

Print a summary of the nuclear properties

exception pynucastro.nucdata.nucleus.UnsupportedNucleus[source]#

Bases: Exception

Exception for a nucleus that we do not know about.

pynucastro.nucdata.nucleus.get_all_nuclei()[source]#

Return a list with every Nucleus that has a known mass.

Return type:

list

pynucastro.nucdata.nucleus.get_nuclei_in_range(name=None, *, Z_range=None, A_range=None, neutron_excess_range=None)[source]#

Create a range of nuclei. Both the proton number(s) and mass range need to be specified. This can be done in several ways:

  • proton number: give either a single element name via name (e.g., “Fe”) or the range of proton numbers via Z_range

  • masses: give either the range of atomic weights via A_range or the range of neutron excess, neutron_excess_range.

Parameters:
  • name (str) – the element name for a single atomic number

  • Z_range (Iterable(int)) – minimum and maximum atomic number

  • A_range (Iterable(int)) – minimum and maximum atomic weight

  • neutron_excess_range (Iterable(int)) – the minimum and maximum value of N-Z

Return type:

list(Nucleus)

Examples

Get all of the oxygen isotopes that have anywhere from 2 fewer neutrons than protons to 2 more neutrons than protons:

>>> nuc = get_nuclei_in_range("O", neutron_excess_range=[-2, 2])

Get all the iron, cobalt, and nickel nuclei with masses in the range 52 to 64

>>> nuc = get_nuclei_in_range(Z_range=[26, 28], A_range=[52, 64])