pub struct ReconstructionCheckpoint { /* private fields */ }Expand description
Serializable algorithm state used to resume a reconstruction exactly.
Built-in pupil-recovering algorithms capture object and pupil arrays after
their iteration-boundary gauge projection. Older valid checkpoints are
projected immediately after restoration. Problem-aware validation requires
the stored pupil support to equal the compiled model support, not only to
have the same shape. Format version 2 uses algorithm_auxiliary as an
extension point for solver state. Readers predating a particular auxiliary
enum variant cannot deserialize checkpoints containing that variant.
Implementations§
Source§impl ReconstructionCheckpoint
impl ReconstructionCheckpoint
Sourcepub fn capture(
completed_iterations: usize,
state: &ReconstructionState,
trace: &ReconstructionTrace,
) -> Self
pub fn capture( completed_iterations: usize, state: &ReconstructionState, trace: &ReconstructionTrace, ) -> Self
Clones resumable state and trace after completed_iterations complete passes.
Sourcepub const fn format_version(&self) -> u32
pub const fn format_version(&self) -> u32
Returns the serialized checkpoint format version.
Sourcepub const fn completed_iterations(&self) -> usize
pub const fn completed_iterations(&self) -> usize
Returns the number of complete iterations represented by this state.
Sourcepub fn object_spectrum(&self) -> ArrayView2<'_, Complex64>
pub fn object_spectrum(&self) -> ArrayView2<'_, Complex64>
Borrows the centered high-resolution complex object spectrum.
Sourcepub fn illumination_corrections(&self) -> Option<&[(f64, f64)]>
pub fn illumination_corrections(&self) -> Option<&[(f64, f64)]>
Borrows optional per-source (row, column) corrections in Fourier-grid pixels.
Sourcepub fn frame_gains(&self) -> Option<&[f64]>
pub fn frame_gains(&self) -> Option<&[f64]>
Borrows optional positive calibration gains in acquisition-frame order.
Sourcepub fn background(&self) -> Option<&[f64]>
pub fn background(&self) -> Option<&[f64]>
Borrows optional additive intensity backgrounds in acquisition-frame order.
Sourcepub fn physical_illumination_calibration(
&self,
) -> Option<&IlluminationCalibrationState>
pub fn physical_illumination_calibration( &self, ) -> Option<&IlluminationCalibrationState>
Borrows physical planar-array calibration state, when joint calibration is active.
Sourcepub fn calibrated_model(&self) -> Option<&ImagePlaneModel>
pub fn calibrated_model(&self) -> Option<&ImagePlaneModel>
Borrows the illumination-refreshed model used at checkpoint capture.
Sourcepub fn algorithm_auxiliary(&self) -> Option<&AlgorithmAuxiliaryState>
pub fn algorithm_auxiliary(&self) -> Option<&AlgorithmAuxiliaryState>
Borrows optional solver-specific resumable state.
Sourcepub const fn trace(&self) -> &ReconstructionTrace
pub const fn trace(&self) -> &ReconstructionTrace
Borrows the iteration trace accumulated before capture.
Sourcepub fn save(&self, path: impl AsRef<Path>) -> Result<()>
pub fn save(&self, path: impl AsRef<Path>) -> Result<()>
Validates and serializes this checkpoint as JSON.
Sourcepub fn load(path: impl AsRef<Path>) -> Result<Self>
pub fn load(path: impl AsRef<Path>) -> Result<Self>
Deserializes and validates a JSON checkpoint independently of a problem.
Sourcepub fn load_for_problem<M: MeasurementRead>(
path: impl AsRef<Path>,
problem: &ReconstructionProblem<M>,
) -> Result<Self>
pub fn load_for_problem<M: MeasurementRead>( path: impl AsRef<Path>, problem: &ReconstructionProblem<M>, ) -> Result<Self>
Loads a checkpoint and verifies all dimensions, the exact pupil support, and calibration counts against the problem that will resume it.
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Validates integrity that does not depend on a reconstruction problem.
Sourcepub fn validate_for_problem<M: MeasurementRead>(
&self,
problem: &ReconstructionProblem<M>,
) -> Result<()>
pub fn validate_for_problem<M: MeasurementRead>( &self, problem: &ReconstructionProblem<M>, ) -> Result<()>
Validates checkpoint dimensions and calibration variables for problem.
Trait Implementations§
Source§impl Clone for ReconstructionCheckpoint
impl Clone for ReconstructionCheckpoint
Source§fn clone(&self) -> ReconstructionCheckpoint
fn clone(&self) -> ReconstructionCheckpoint
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 ReconstructionCheckpoint
impl Debug for ReconstructionCheckpoint
Source§impl<'de> Deserialize<'de> for ReconstructionCheckpoint
impl<'de> Deserialize<'de> for ReconstructionCheckpoint
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>,
Auto Trait Implementations§
impl Freeze for ReconstructionCheckpoint
impl RefUnwindSafe for ReconstructionCheckpoint
impl Send for ReconstructionCheckpoint
impl Sync for ReconstructionCheckpoint
impl Unpin for ReconstructionCheckpoint
impl UnsafeUnpin for ReconstructionCheckpoint
impl UnwindSafe for ReconstructionCheckpoint
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,
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