Function load_nuclides

pub fn load_nuclides<N>(
    nuclides: &[N],
    rad_type: RadType,
) -> HashMap<String, Vec<Record>>
where N: TryInto<Nuclide> + Clone,
Expand description

Load multiple nuclides from pre-fetched data

Retrieve the RecordSet for the specified nuclides. The returned hashmap is a dictionary of key value pairs where:

  • key : Nuclide name, e.g. “Co60”
  • value : List of all matching Records

Note this will accept a collection of Nuclides or any &str, String, or &String that will parse into a Nuclide.

For example:

// Try to get the records for Sodium-22 and Cesium-137
let nuclide_data = load_nuclides(&["na22", "cs137"], RadType::Gamma);

for (name, records) in nuclide_data {
    println!("{name}:");
    for r in records {
        println!(" - {} keV", r.energy.display())
    }
}
Cs137:
 - 283.5 keV
 - 661.657 keV
 - 4.966 keV
 - 31.816 keV
 - 32.193 keV
 - 36.482 keV
 - 36.827 keV
 - 37.255 keV
Na22:
 - 1274.537 keV
 - 511 keV
 - 0.848 keV
 - 0.848 keV

For details of the data structure and associated convenience methods see the Record type.