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: f64The 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: f64The room background’s ρ: the known one, the fitted one, or 0 without
one.
t0_us: f64The timing offset t0 in µs: the known one, or the fitted one.
flight_path_m: f64The 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: f64The pulse’s R: the known one, or the fitted one.
fwhm_squared_us2: f64The 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.
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.
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: PatchCovariancesEach patch’s covariance of Self::quantities and their joint
covariance across patches.
deviance: f64Each 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: boolWhether 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: usizeNewton steps tried on the shared quantities, those not taken included.
Implementations§
Source§impl CountsMap<'_>
impl CountsMap<'_>
Sourcepub fn residual_rows(&self) -> impl Iterator<Item = [Array2<f64>; 2]> + '_
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§
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> 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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