Class IsotopeTable

Class Documentation

class IsotopeTable

Reads the isotope data HDF5 file and holds every isotope’s IsotopeData record, indexed by (Z, A)

The underlying HDF5 file (see data/tools/elem/ build_isotope_table.py, which builds it from slug2’s own lib/yields/isotope_data.txt) stores the ragged per-isotope daughter lists in a flat CSR layout – parallel Z/A/lifetime datasets plus a daughterOffset index into flat daughterZ/ daughterA/branchingRatio datasets – read here in one pass per dataset rather than opening one HDF5 group per isotope.

Public Functions

explicit IsotopeTable(const std::string &fileName = "data/elem/isotopes.h5")

Construct an IsotopeTable by reading an isotope data HDF5 file.

Parameters:

fileName – Path to the isotope data HDF5 file, resolved via utils::getFilePath (current directory, then SLUG_DIR, then REPO_DIR)

Throws:

std::runtime_error – if fileName cannot be found, or the file’s contents are malformed

inline auto table() const noexcept -> const std::map<std::pair<unsigned int, unsigned int>, IsotopeData>&

Return the full table, indexed by (Z, A)

inline auto size() const noexcept -> std::size_t

Return the number of isotopes in the table.