Skip to main content

CountsMap

Struct CountsMap 

Source
pub struct CountsMap<'a> {
Show 31 fields pub patches: Array2<Patch>, pub fits: Array2<Option<RegionFit>>, pub failed: Array2<Option<String>>, pub empty: Option<RegionFit>, pub densities: Vec<Array2<f64>>, pub density_sd: Vec<Array2<f64>>, pub temperature_k: Array2<f64>, pub temperature_sd_k: Array2<f64>, pub overdispersion: [Array2<f64>; 2], pub identified: Array2<bool>, pub normalization: f64, pub time_background: [f64; 3], pub room_background: f64, pub t0_us: f64, pub flight_path_m: f64, pub alpha: [f64; 2], pub beta: [f64; 2], pub r: f64, pub fwhm_squared_us2: f64, pub r_high: Option<f64>, pub detector_tail: Option<[f64; 2]>, pub shared: Vec<&'static str>, pub shared_covariance: Option<FlatMatrix>, pub measured_pulls: Option<Vec<f64>>, pub pulse_consistency: Option<Consistency>, pub quantities: Vec<String>, pub covariances: PatchCovariances, pub deviance: f64, pub converged: bool, pub unconverged: Option<String>, pub steps: usize, /* private fields */
}
Expand description

The fitted map, one value per patch.

Fields§

§patches: Array2<Patch>

Each patch’s kind, as MapMeasurement::patches.

§fits: Array2<Option<RegionFit>>

Each Patch::Sample’s fit, the shared quantities held at the map’s answer; None where the patch is not fitted or Self::failed.

§failed: Array2<Option<String>>

Why the fit of a Patch::Sample left out of the shared quantities at the end failed: an error, no convergence, or a fitted temperature at 1 K or 5000 K, at the shared values it was last fitted at, marked when those are a halved step not taken. None where the patch is not left out or not fitted.

§empty: Option<RegionFit>

The empty pixels’ fit; None when every one is excluded, or when their refit at the map’s shared values fails, which ends the map unconverged.

§densities: Vec<Array2<f64>>

Each isotope’s areal density in atoms/barn, in the material’s order: the known one, or the fitted one; NaN where the patch has no fit.

§density_sd: Vec<Array2<f64>>

Standard deviation of each density, from PatchCovariances::covariance; NaN where the density is known, held on a bound or not determined by the counts, alone or through a shared quantity, where the patch has no fit, or where the map did not converge.

§temperature_k: Array2<f64>

The temperature in K: the known one, or the fitted one; NaN where the patch has no fit.

§temperature_sd_k: Array2<f64>

Standard deviation of the temperature in K, as Self::density_sd.

§overdispersion: [Array2<f64>; 2]

Each patch’s RegionFit::overdispersion of the open-beam run, then of the sample run; NaN where it is None or the patch has no fit.

§identified: Array2<bool>

Whether the map converged, the patch did not fail, and the counts determine each of its fitted densities and its fitted temperature: each has a finite standard deviation or, for a density, is 0. Whether the model describes the patch’s counts is its Self::overdispersion; neither says whether the values are right.

§normalization: f64

The normalization a: the known one, or the fitted one.

§time_background: [f64; 3]

The time background’s [C, A, τ], each the known or the fitted one.

§room_background: f64

The room background’s ρ: the known one, the fitted one, or 0 without one.

§t0_us: f64

The timing offset t0 in µs: the known one, or the fitted one.

§flight_path_m: f64

The flight path in m: the known one, or the fitted one.

§alpha: [f64; 2]

The pulse’s [α₀, α₁], each the known or the fitted one.

§beta: [f64; 2]

The pulse’s [β₀, β₁], each the known or the fitted one.

§r: f64

The pulse’s R: the known one, or the fitted one.

§fwhm_squared_us2: f64

The square of the pulse’s triangle FWHM, h² in µs²: the known one, or the fitted one.

§r_high: Option<f64>

The pulse’s R_high, the known or the fitted one; None without one.

§detector_tail: Option<[f64; 2]>

The detector tail’s [f, τ_D], each the known or the fitted one; None without one.

§shared: Vec<&'static str>

The fitted shared quantities, among the normalization, the time background’s C, A and τ, the room background’s ρ, t0, flight path, α₀, α₁, β₀, β₁, R, h², R_high, f and τ_D, in that order.

§shared_covariance: Option<FlatMatrix>

Covariance of Self::shared: the inverse of the information on them of every patch that did not fail and of the empty pixels, each with its own quantities and beam profiled out, plus 1/sd² for each measured shared quantity and the pulse calibration’s prior. The row and column of one on a bound or not determined by the counts are NaN, and the rest are conditional on one on a bound held there. None when the map did not converge.

§measured_pulls: Option<Vec<f64>>

For each measured one of Self::shared, in that order, its value without the bounds less its measurement over √(sd² − variance), the variance also without the bounds, as CountsFit::measured_pulls. None when the map did not converge, or when the fit of a patch or of the empty pixels gives no Gaussian without its bounds.

§pulse_consistency: Option<Consistency>

Whether the counts accept the pulse’s calibration, as CountsFit::pulse_consistency, from Self::shared and the quantities of every patch not Self::failed, without their bounds. None without a calibration, when Self::measured_pulls is, or when consistency gives none.

§quantities: Vec<String>

A patch’s fitted quantities: each fitted density, in the material’s order, the temperature and the thickness variance if fitted, each fitted background term, and the gamma transmission, capture gammas and in-scatter if fitted.

§covariances: PatchCovariances

Each patch’s covariance of Self::quantities and their joint covariance across patches.

§deviance: f64

Each fit’s half Poisson deviance over the overdispersion it weighted each run with, summed over the patches with a fit and the empty pixels, outside the sample runs’ RegionFit::excluded_bins.

§converged: bool

Whether the Newton decrement of the shared quantities fell below NEWTON_DECREMENT_TOL at an answer whose window bins are those the patches left out.

§unconverged: Option<String>

Why the map did not converge: the empty pixels’ failure, the step limit, or a step none of whose halvings lowered the objective. None when it converged.

§steps: usize

Newton steps tried on the shared quantities, those not taken included.

Implementations§

Source§

impl CountsMap<'_>

Source

pub fn residual_rows(&self) -> impl Iterator<Item = [Array2<f64>; 2]> + '_

For each patch row in turn, for the open-beam run, then the sample run, the signed deviance residual sign(y − μ)·√(2(y·ln(y/μ) + μ − y)) of each patch’s counts y in the measurement the map was fitted to and its fit’s predicted counts μ in each bin, in (time bin, patch column): −√(2μ) where y is 0, NaN where the patch has no fit. Their squares over twice the overdispersion each run was weighted with, summed outside the sample runs’ RegionFit::excluded_bins over every patch row with the empty pixels’ alike, are Self::deviance.

Trait Implementations§

Source§

impl<'a> Clone for CountsMap<'a>

Source§

fn clone(&self) -> CountsMap<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for CountsMap<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for CountsMap<'a>

§

impl<'a> RefUnwindSafe for CountsMap<'a>

§

impl<'a> Send for CountsMap<'a>

§

impl<'a> Sync for CountsMap<'a>

§

impl<'a> Unpin for CountsMap<'a>

§

impl<'a> UnsafeUnpin for CountsMap<'a>

§

impl<'a> UnwindSafe for CountsMap<'a>

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<T> ByRef<T> for T

§

fn by_ref(&self) -> &T

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
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<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,