1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//! Errors produced by the `orbitprop` module.
use numeris::ode;
use thiserror::Error;
use crate::Frame;
/// Errors that can occur while configuring or executing orbit propagation.
#[derive(Debug, Error)]
pub enum Error {
// -- propagator-internal errors --------------------------------------
/// Returned when the integrated state matrix has an unexpected
/// number of columns.
#[error("Invalid number of columns: {c}")]
InvalidStateColumns { c: usize },
/// Returned by the dense-output interp helpers when the underlying
/// ODE solution does not carry interpolation data.
#[error("No Dense Output in Solution")]
NoDenseOutputInSolution,
/// Wraps an [`ode::OdeError`] surfaced by the chosen integrator.
/// `OdeError` does not implement `std::error::Error` (numeris keeps
/// it as a plain `Display`-only enum), so this variant is built
/// manually rather than via `#[from]`.
#[error("ODE Error: {0}")]
OdeError(ode::OdeError),
/// RODAS4 does not support state transition matrix propagation
/// (`C == 7`).
#[error("RODAS4 does not support state transition matrix propagation")]
RODAS4NoSTM,
/// Gauss-Jackson 8 does not support state transition matrix
/// propagation (`C == 7`).
#[error("Gauss-Jackson 8 does not support state transition matrix propagation")]
GaussJackson8NoSTM,
// -- precomputed.rs --------------------------------------------------
/// Returned by [`Precomputed::interp`](crate::orbitprop::Precomputed::interp)
/// when the requested time falls outside the precomputed range.
#[error("Precomputed::interp: time {time} is outside of precomputed range : {begin} to {end}")]
PrecomputedOutOfRange {
time: String,
begin: String,
end: String,
},
/// Wraps an error surfaced while building a
/// [`Precomputed`](crate::orbitprop::Precomputed) interp table from
/// JPL ephemeris data.
#[error(transparent)]
Jplephem(#[from] crate::jplephem::Error),
// -- satstate.rs -----------------------------------------------------
/// Returned by [`SatState::set_pos_uncertainty`](crate::orbitprop::SatState::set_pos_uncertainty),
/// [`SatState::set_vel_uncertainty`](crate::orbitprop::SatState::set_vel_uncertainty),
/// and the internal `cov_frame_to_gcrf` helper when the supplied
/// frame is not one of the supported orbital or inertial frames.
#[error("Unsupported frame for uncertainty: {frame}. Must be GCRF, LVLH, RIC, or NTW")]
UnsupportedUncertaintyFrame { frame: Frame },
// -- settings.rs -----------------------------------------------------
/// Returned by [`PropSettings::set_gravity`](crate::orbitprop::PropSettings::set_gravity)
/// when `order > degree`.
#[error("Gravity order ({order}) must be ≤ degree ({degree})")]
InvalidGravityOrder { order: u16, degree: u16 },
}
impl From<ode::OdeError> for Error {
fn from(e: ode::OdeError) -> Self {
Self::OdeError(e)
}
}
/// Convenient type alias used throughout the `orbitprop` module.
pub type Result<T> = std::result::Result<T, Error>;