nuclide¶
Nuclide name parsing, including the spellings the regulations use.
nuclide
¶
Nuclide name parsing, validation and normalisation.
The canonical form used throughout this package is the one OpenMC and GND use,
Co60 and Ag108_m1, because the most common source of an inventory is an
OpenMC material and matching it avoids a translation layer at the boundary.
Regulatory tables spell nuclides differently again (Co-60, Ag-108m,
U-238sec, Sr-90+), so parse_regulatory handles those and
separates the secular-equilibrium marker from the nuclide identity.
Classes:
-
NuclideNameError–Raised when a string cannot be read as a single nuclide.
Functions:
-
parse–Split a nuclide name into element symbol, mass number and metastable level.
-
normalise–Return a nuclide name in canonical form.
-
parse_regulatory–Read a nuclide name as spelled in a regulatory table.
-
element–Return the element symbol of a nuclide, for example
CoforCo60. -
mass_number–Return the mass number of a nuclide, for example 60 for
Co60. -
metastable_state–Return the metastable level of a nuclide, 0 for a ground state.
-
atomic_number–Return the proton number of a nuclide, for example 27 for
Co60. -
is_valid–Whether a string can be read as a single nuclide.
NuclideNameError
¶
Bases: ValueError
Raised when a string cannot be read as a single nuclide.
parse
¶
Split a nuclide name into element symbol, mass number and metastable level.
Parameters:
Returns:
-
str–(symbol, mass_number, metastable_level), where the level is 0 for a -
int–ground state and 1 or 2 for a metastable state. The symbol is returned
-
int–in its canonical capitalisation regardless of the input's.
Raises:
-
NuclideNameError–If the name is not a single nuclide. A bare element such as
Feraises, because a clearance limit applies to a nuclide and silently guessing a mass number would be wrong.
normalise
¶
Return a nuclide name in canonical form.
Co-60 and co 60 both become Co60; Ag-108m becomes
Ag108_m1 and Hf-178n becomes Hf178_m2. A trailing + is stripped, since it marks a secular
equilibrium value rather than a different nuclide, but sec is not
accepted here because a sec value is a separate table entry. Use
parse_regulatory when reading a regulatory table.
Parameters:
Returns:
-
str–The canonical name, such as
Co60orAg108_m1.
Raises:
-
NuclideNameError–If the name is not a single nuclide.
parse_regulatory
¶
Read a nuclide name as spelled in a regulatory table.
Regulatory tables mark parent nuclides whose limit already accounts for
daughters in secular equilibrium, with + for the daughters tabulated
alongside and sec for the whole decay chain. The marker is not part of
the nuclide's identity but it does select a different limit value, so it is
returned separately rather than discarded.
Parameters:
Returns:
Raises:
-
NuclideNameError–If the label is not a single nuclide.
element
¶
Return the element symbol of a nuclide, for example Co for Co60.
mass_number
¶
Return the mass number of a nuclide, for example 60 for Co60.
metastable_state
¶
Return the metastable level of a nuclide, 0 for a ground state.
atomic_number
¶
Return the proton number of a nuclide, for example 27 for Co60.