use crate::acquisition::ChemicalShiftReference;
use crate::acquisition::ResolvedComponentTransform;
use crate::processing::contracts::polarity::PolarityState;
use crate::processing::contracts::profile::PositivePeaksV1;
use std::sync::Arc;
use super::{
DelaySource, FourierExponentSign, PhaseCorrection, SpectrumOperation, TimeDomainResidualPolicy,
Window,
};
#[non_exhaustive]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum BaselineProfile {
PositivePeaksV1(PositivePeaksV1),
}
impl From<PositivePeaksV1> for BaselineProfile {
fn from(value: PositivePeaksV1) -> Self {
Self::PositivePeaksV1(value)
}
}
#[non_exhaustive]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum AttemptFailure {
NoUsableSignal,
ObjectiveUndefined,
OptimizationDidNotConverge,
}
#[non_exhaustive]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum ProcessingDiagnostic {
ContinuedAfterPhaseFailure,
AmbiguousPolarity,
UnknownCoordinateQuality,
}
#[non_exhaustive]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum Projection {
Real,
RealAbsorptive,
RealSigned,
Magnitude,
UnphasedReal,
}
#[non_exhaustive]
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum PhaseFailurePolicy {
Fail,
ContinueUnphasedReal,
}
#[non_exhaustive]
#[derive(Clone, Debug, PartialEq)]
pub enum FrequencyFrame {
Hertz,
Ppm(ReferenceSource),
}
#[non_exhaustive]
#[derive(Clone, Debug, PartialEq)]
pub enum ReferenceSource {
AxisEvidence,
Explicit(ChemicalShiftReference),
}
#[non_exhaustive]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum DirectDelayMode {
Automatic,
TimeDomainShiftFoldV1(DelaySource, TimeDomainResidualPolicy),
FrequencyDomainPhaseRampV1(DelaySource),
NoDelay,
}
#[non_exhaustive]
#[derive(Clone, Debug, PartialEq)]
pub enum ResolvedOperation {
EstimatedBaseline {
values: Vec<f64>,
coefficients: Vec<f64>,
},
AutomaticPhase {
correction: PhaseCorrection,
objective: f64,
evaluations: usize,
},
Spectrum(SpectrumOperation),
#[non_exhaustive]
AcknowledgeZeroDelayV1 {
evidence: crate::acquisition::NormalizationEvidence,
},
Window(Window),
#[non_exhaustive]
ZeroFill {
target_points: usize,
},
FourierTransform(FourierExponentSign),
#[non_exhaustive]
FrequencyDomainPhaseRampV1 {
delay: f64,
sign: FourierExponentSign,
},
#[non_exhaustive]
TimeDomainShiftFoldV1 {
applied_delay: f64,
skip: usize,
fold: usize,
residual: f64,
},
PhaseCorrection(PhaseCorrection),
#[non_exhaustive]
ComponentTransform {
transform: ResolvedComponentTransform,
observation_ordinals: Option<Arc<[usize]>>,
grid_origin: i64,
},
#[non_exhaustive]
Projection {
projection: Projection,
polarity: PolarityState,
},
#[non_exhaustive]
ResolveFrequencyFrame {
frame: FrequencyFrame,
reference: Option<ChemicalShiftReference>,
},
ReverseAxis,
BaselineCorrection(BaselineProfile),
}