pub struct FlightTimeGrid { /* private fields */ }Expand description
Uniform flight-time grid over a window, with the probability that each grid point’s neutrons are counted in each bin.
Implementations§
Source§impl FlightTimeGrid
impl FlightTimeGrid
Sourcepub fn new(
time_edges_us: &[f64],
t0_us: f64,
pulse: &Arc<IkedaCarpenter>,
) -> Result<Self, FlightTimeGridError>
pub fn new( time_edges_us: &[f64], t0_us: f64, pulse: &Arc<IkedaCarpenter>, ) -> Result<Self, FlightTimeGridError>
The grid for bins time_edges_us (µs) with timing offset t0_us,
the flight path taken from pulse. The step, half the pulse’s
shorter rise at the two ends of the range, is a starting step: the
counts are converged once Self::halved no longer changes them.
§Errors
See FlightTimeGridError.
Sourcepub fn halved(&self) -> Result<Self, FlightTimeGridError>
pub fn halved(&self) -> Result<Self, FlightTimeGridError>
Sourcepub fn flight_times_us(&self) -> &[f64]
pub fn flight_times_us(&self) -> &[f64]
The grid’s flight times in µs, ascending.
Sourcepub fn energies_ev(&self) -> Vec<f64>
pub fn energies_ev(&self) -> Vec<f64>
The energy, in eV, of each grid point, descending.
Sourcepub fn predict(&self, values: &[f64]) -> Result<Vec<f64>, FlightTimeGridError>
pub fn predict(&self, values: &[f64]) -> Result<Vec<f64>, FlightTimeGridError>
step · Σ_j v_j P_k(u_j) for each bin k: the counts a beam of
values[j] neutrons per µs at each grid point predicts, or, for any
other per-point values, the same linear map. It differs from the
trapezoid rule by half a step of the end points’ terms, where P_k
is zero, or at most NEGLIGIBLE_ARRIVAL_PROBABILITY at the fast end
for an unfolded pulse. Features of the values narrower than the step
are not resolved.
§Errors
FlightTimeGridError::ValuesLength unless values has one entry
per grid point.
Trait Implementations§
Source§impl Clone for FlightTimeGrid
impl Clone for FlightTimeGrid
Source§fn clone(&self) -> FlightTimeGrid
fn clone(&self) -> FlightTimeGrid
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for FlightTimeGrid
impl RefUnwindSafe for FlightTimeGrid
impl Send for FlightTimeGrid
impl Sync for FlightTimeGrid
impl Unpin for FlightTimeGrid
impl UnsafeUnpin for FlightTimeGrid
impl UnwindSafe for FlightTimeGrid
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