pub struct SubshellBindingTable { /* private fields */ }Expand description
Subshell binding energies for a set of elements, with provenance.
Invariants: non-blank provenance; at least one atom; atoms strictly
increasing in Z (no duplicates). Coverage of a required range of Z is
checked separately by SubshellBindingTable::require_coverage, because
a table for a few elements is legitimate.
No table is committed to this repository: the redistribution terms of the
candidate source (EADL, as distributed in EPICS2017) are an open question
(docs/data-provenance.md). A user supplies a local copy and reads it with
SubshellBindingTable::from_endf6_mf28_file.
Implementations§
Source§impl SubshellBindingTable
impl SubshellBindingTable
Sourcepub fn new(
provenance: impl Into<String>,
atoms: Vec<AtomBindings>,
) -> Result<Self, ElectronDataError>
pub fn new( provenance: impl Into<String>, atoms: Vec<AtomBindings>, ) -> Result<Self, ElectronDataError>
Build a validated table; atoms in increasing Z.
Sourcepub fn provenance(&self) -> &str
pub fn provenance(&self) -> &str
Provenance string (to be copied into run metadata).
Sourcepub fn atoms(&self) -> &[AtomBindings]
pub fn atoms(&self) -> &[AtomBindings]
All atoms, in increasing Z.
Sourcepub fn atom(&self, z: u8) -> Option<&AtomBindings>
pub fn atom(&self, z: u8) -> Option<&AtomBindings>
The atom with this Z, if tabulated.
Sourcepub fn missing(&self, range: RangeInclusive<u8>) -> Vec<u8> ⓘ
pub fn missing(&self, range: RangeInclusive<u8>) -> Vec<u8> ⓘ
The Z in range that the table lacks.
Sourcepub fn require_coverage(
&self,
range: RangeInclusive<u8>,
) -> Result<(), ElectronDataError>
pub fn require_coverage( &self, range: RangeInclusive<u8>, ) -> Result<(), ElectronDataError>
An error naming the missing elements unless every Z in range is
tabulated.
Sourcepub fn from_toml_str(text: &str) -> Result<Self, ElectronDataError>
pub fn from_toml_str(text: &str) -> Result<Self, ElectronDataError>
Parse and validate the TOML form:
provenance = "..."
[[atoms]]
z = 1
shells = [{ subshell = 1, binding_energy_ev = 13.6, occupancy = 1.0 }]Sourcepub fn to_toml_string(&self) -> Result<String, ElectronDataError>
pub fn to_toml_string(&self) -> Result<String, ElectronDataError>
Serialize to the TOML form.
Sourcepub fn eadl2017() -> Self
pub fn eadl2017() -> Self
The committed EADL2017 table, Z = 1..92 (EADL as distributed in
EPICS2017; D. E. Cullen, IAEA-NDS-224 Rev. 1 (April 2018), issued by the
IAEA Nuclear Data Section and the NNDC). The data and the credit
notice are in eadl2017_binding.toml, embedded in the library; the
provenance row is in docs/data-provenance.md.
§Panics
Never in a correct build: the embedded file is validated by the test suite.
Sourcepub fn from_endf6_mf28_str(
text: &str,
provenance: &str,
) -> Result<Self, ElectronDataError>
pub fn from_endf6_mf28_str( text: &str, provenance: &str, ) -> Result<Self, ElectronDataError>
Read subshell binding energies and occupancies from ENDF-6 File 28 (MF = 28, MT = 533, atomic relaxation data), the format in which EADL is distributed (ENDF-6 Formats Manual, CSEWG Document ENDF-102, BNL-203218-2018-INRE (2018), section 28.2).
For each material the section is a HEAD record [ZA, AWR, 0, 0, NSS, 0] followed by NSS LIST records [SUBI, 0, 0, 0, NW, NTR / EBI, ELN, 0, 0, 0, 0, (SUBJ, SUBK, ETR, FTR, 0, 0) x NTR] with NW = 6 (1 + NTR). Only SUBI (designator), EBI (binding energy, eV) and ELN
(electrons in the neutral atom) are kept; the transition data are
skipped. Lines of other files and sections are ignored. Materials with
Z beyond the crate’s element table (92) are skipped; every other
record must be well formed, or the whole read fails.
provenance is required (non-blank): name the file, its version and
where it was retrieved, so the run metadata records it.
Sourcepub fn from_endf6_mf28_file(
path: impl AsRef<Path>,
provenance: &str,
) -> Result<Self, ElectronDataError>
pub fn from_endf6_mf28_file( path: impl AsRef<Path>, provenance: &str, ) -> Result<Self, ElectronDataError>
SubshellBindingTable::from_endf6_mf28_str on a file.
Trait Implementations§
Source§impl Clone for SubshellBindingTable
impl Clone for SubshellBindingTable
Source§fn clone(&self) -> SubshellBindingTable
fn clone(&self) -> SubshellBindingTable
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SubshellBindingTable
impl Debug for SubshellBindingTable
Source§impl<'de> Deserialize<'de> for SubshellBindingTable
impl<'de> Deserialize<'de> for SubshellBindingTable
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for SubshellBindingTable
impl PartialEq for SubshellBindingTable
Source§impl Serialize for SubshellBindingTable
impl Serialize for SubshellBindingTable
impl StructuralPartialEq for SubshellBindingTable
Auto Trait Implementations§
impl Freeze for SubshellBindingTable
impl RefUnwindSafe for SubshellBindingTable
impl Send for SubshellBindingTable
impl Sync for SubshellBindingTable
impl Unpin for SubshellBindingTable
impl UnsafeUnpin for SubshellBindingTable
impl UnwindSafe for SubshellBindingTable
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more