Skip to main content

SubshellBindingTable

Struct SubshellBindingTable 

Source
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

Source

pub fn new( provenance: impl Into<String>, atoms: Vec<AtomBindings>, ) -> Result<Self, ElectronDataError>

Build a validated table; atoms in increasing Z.

Source

pub fn provenance(&self) -> &str

Provenance string (to be copied into run metadata).

Source

pub fn atoms(&self) -> &[AtomBindings]

All atoms, in increasing Z.

Source

pub fn atom(&self, z: u8) -> Option<&AtomBindings>

The atom with this Z, if tabulated.

Source

pub fn missing(&self, range: RangeInclusive<u8>) -> Vec<u8> ⓘ

The Z in range that the table lacks.

Source

pub fn require_coverage( &self, range: RangeInclusive<u8>, ) -> Result<(), ElectronDataError>

An error naming the missing elements unless every Z in range is tabulated.

Source

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 }]
Source

pub fn to_toml_string(&self) -> Result<String, ElectronDataError>

Serialize to the TOML form.

Source

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.

Source

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.

Source

pub fn from_endf6_mf28_file( path: impl AsRef<Path>, provenance: &str, ) -> Result<Self, ElectronDataError>

Trait Implementations§

Source§

impl Clone for SubshellBindingTable

Source§

fn clone(&self) -> SubshellBindingTable

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SubshellBindingTable

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for SubshellBindingTable

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for SubshellBindingTable

Source§

fn eq(&self, other: &SubshellBindingTable) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for SubshellBindingTable

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for SubshellBindingTable

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V