Skip to main content

ProjectSnapshot

Struct ProjectSnapshot 

Source
pub struct ProjectSnapshot {
Show 85 fields pub schema_version: String, pub created_utc: String, pub software_version: String, pub fitting_type: String, pub data_type: String, pub flight_path_m: f64, pub delay_us: f64, pub proton_charge_sample: f64, pub proton_charge_ob: f64, pub isotope_z: Vec<u32>, pub isotope_a: Vec<u32>, pub isotope_symbol: Vec<String>, pub isotope_density: Vec<f64>, pub isotope_enabled: Vec<bool>, pub isotope_group_z: Vec<u32>, pub isotope_group_names: Vec<String>, pub isotope_group_members_json: Vec<String>, pub isotope_group_density: Vec<f64>, pub isotope_group_enabled: Vec<bool>, pub input_mode: String, pub analysis_mode: String, pub spatial_binning_factor: Option<u8>, pub event_n_bins: u32, pub event_tof_min_us: f64, pub event_tof_max_us: f64, pub event_height: u32, pub event_width: u32, pub solver_method: String, pub max_iter: u32, pub temperature_k: f64, pub fit_temperature: bool, pub resolution_enabled: bool, pub resolution_kind: String, pub delta_t_us: Option<f64>, pub delta_l_m: Option<f64>, pub tabulated_path: Option<String>, pub rois: Vec<[u64; 4]>, pub endf_library: String, pub data_mode: String, pub sample_path: Option<String>, pub open_beam_path: Option<String>, pub spectrum_path: Option<String>, pub hdf5_path: Option<String>, pub hdf5_ob_path: Option<String>, pub spectrum_unit: String, pub spectrum_kind: String, pub rebin_factor: u32, pub rebin_applied: bool, pub sample_data: Option<Array3<f64>>, pub open_beam_data: Option<Array3<f64>>, pub spectrum_values: Option<Vec<f64>>, pub normalized: Option<Array3<f64>>, pub normalized_uncertainty: Option<Array3<f64>>, pub energies: Option<Vec<f64>>, pub dead_pixels: Option<Array2<bool>>, pub density_maps: Option<Vec<Array2<f64>>>, pub uncertainty_maps: Option<Vec<Array2<f64>>>, pub chi_squared_map: Option<Array2<f64>>, pub converged_map: Option<Array2<bool>>, pub temperature_map: Option<Array2<f64>>, pub temperature_uncertainty_map: Option<Array2<f64>>, pub n_converged: Option<usize>, pub n_total: Option<usize>, pub n_failed: Option<usize>, pub result_isotope_labels: Option<Vec<String>>, pub anorm_map: Option<Array2<f64>>, pub background_maps: Option<[Array2<f64>; 3]>, pub single_fit_densities: Option<Vec<f64>>, pub single_fit_uncertainties: Option<Vec<f64>>, pub single_fit_chi_squared: Option<f64>, pub single_fit_temperature: Option<f64>, pub single_fit_temperature_unc: Option<f64>, pub single_fit_converged: Option<bool>, pub single_fit_iterations: Option<usize>, pub single_fit_pixel: Option<(usize, usize)>, pub single_fit_labels: Option<Vec<String>>, pub single_fit_anorm: Option<f64>, pub single_fit_background: Option<[f64; 3]>, pub uncertainty_is_estimated: Option<bool>, pub lm_background_enabled: Option<bool>, pub kl_background_enabled: Option<bool>, pub kl_c_ratio: Option<f64>, pub kl_enable_polish_override: Option<Option<bool>>, pub endf_cache: Vec<(String, ResonanceData)>, pub provenance: Vec<(String, String, String)>,
}
Expand description

Serialization-friendly snapshot of the full session state.

All GUI-specific enums are stored as plain strings so this struct has no dependency on the GUI crate. The GUI handles AppState <-> ProjectSnapshot conversion.

Fields§

§schema_version: String§created_utc: String§software_version: String§fitting_type: String

“spatial” | “single”

§data_type: String

“events” | “pre_normalized” | “transmission”

§flight_path_m: f64§delay_us: f64§proton_charge_sample: f64§proton_charge_ob: f64§isotope_z: Vec<u32>§isotope_a: Vec<u32>§isotope_symbol: Vec<String>§isotope_density: Vec<f64>§isotope_enabled: Vec<bool>§isotope_group_z: Vec<u32>

Z for each group.

§isotope_group_names: Vec<String>

Group display names (e.g., “Hf (nat)”).

§isotope_group_members_json: Vec<String>

Per-group members as JSON: [{“a”:176,“symbol”:“Hf-176”,“ratio”:0.0526}, …]

§isotope_group_density: Vec<f64>

Initial density per group.

§isotope_group_enabled: Vec<bool>

Enabled flag per group.

§input_mode: String

Input mode: “tiff_pair” | “transmission_tiff” | “hdf5_histogram” | “hdf5_event”. Empty string triggers heuristic fallback for old project files.

§analysis_mode: String

Analysis mode: “full_spatial” | “roi_single” | “spatial_binning”.

§spatial_binning_factor: Option<u8>

Binning factor for SpatialBinning analysis mode.

§event_n_bins: u32§event_tof_min_us: f64§event_tof_max_us: f64§event_height: u32§event_width: u32§solver_method: String

“lm” | “poisson_kl”

§max_iter: u32§temperature_k: f64§fit_temperature: bool§resolution_enabled: bool§resolution_kind: String

“gaussian” | “tabulated”

§delta_t_us: Option<f64>§delta_l_m: Option<f64>§tabulated_path: Option<String>§rois: Vec<[u64; 4]>

Each ROI: [y_start, y_end, x_start, x_end].

§endf_library: String§data_mode: String

“linked” | “embedded”

§sample_path: Option<String>§open_beam_path: Option<String>§spectrum_path: Option<String>§hdf5_path: Option<String>§hdf5_ob_path: Option<String>

Path to the HDF5 open beam file (HDF5 modes only).

§spectrum_unit: String

“tof_us” | “energy_ev”

§spectrum_kind: String

“bin_edges” | “bin_centers”

§rebin_factor: u32§rebin_applied: bool§sample_data: Option<Array3<f64>>§open_beam_data: Option<Array3<f64>>§spectrum_values: Option<Vec<f64>>§normalized: Option<Array3<f64>>§normalized_uncertainty: Option<Array3<f64>>

D-1: Per-bin transmission uncertainty σ (same shape as normalized). Previously missing from the snapshot, causing reloaded projects to lose uncertainty information (reconstructed as zeros).

§energies: Option<Vec<f64>>§dead_pixels: Option<Array2<bool>>

D-20: Dead-pixel mask (true = dead). Same spatial dimensions as the transmission data (height × width). None when no mask is available.

§density_maps: Option<Vec<Array2<f64>>>§uncertainty_maps: Option<Vec<Array2<f64>>>§chi_squared_map: Option<Array2<f64>>§converged_map: Option<Array2<bool>>§temperature_map: Option<Array2<f64>>§temperature_uncertainty_map: Option<Array2<f64>>§n_converged: Option<usize>§n_total: Option<usize>§n_failed: Option<usize>§result_isotope_labels: Option<Vec<String>>§anorm_map: Option<Array2<f64>>

Per-pixel normalization factor (background fitting).

§background_maps: Option<[Array2<f64>; 3]>

Per-pixel background [A, B, C] maps (background fitting). Stored as 3 separate Array2 maps (one per coefficient).

§single_fit_densities: Option<Vec<f64>>§single_fit_uncertainties: Option<Vec<f64>>§single_fit_chi_squared: Option<f64>§single_fit_temperature: Option<f64>§single_fit_temperature_unc: Option<f64>§single_fit_converged: Option<bool>§single_fit_iterations: Option<usize>§single_fit_pixel: Option<(usize, usize)>§single_fit_labels: Option<Vec<String>>§single_fit_anorm: Option<f64>

Fitted normalization factor from single-pixel fit (1.0 default).

§single_fit_background: Option<[f64; 3]>

Fitted background [BackA, BackB, BackC] from single-pixel fit.

§uncertainty_is_estimated: Option<bool>

True when per-bin uncertainty was estimated (not measured). Drives chi-squared warning display in the GUI.

§lm_background_enabled: Option<bool>

Whether LM background fitting (Anorm + BackA/B/C) is enabled.

§kl_background_enabled: Option<bool>

Whether KL background fitting (b0 + b1/sqrt(E)) is enabled.

§kl_c_ratio: Option<f64>

Counts-KL proton-charge ratio c = Q_s / Q_ob (memo 35 §P1.3). None for project files predating the field; restore-side defaults to 1.0.

§kl_enable_polish_override: Option<Option<bool>>

Counts-KL Nelder-Mead polish override (memo 38 §6). None = dispatcher auto-disable for multi-pixel; Some(true/false) = forced. Outer Option distinguishes “not stored” from “explicitly None”.

§endf_cache: Vec<(String, ResonanceData)>

(symbol, resonance_data) pairs for offline loading.

§provenance: Vec<(String, String, String)>

(timestamp, kind, message) triples.

Trait Implementations§

Source§

impl Debug for ProjectSnapshot

Source§

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

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

impl Default for ProjectSnapshot

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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
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.

§

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, 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