Struct nyx_space::md::trajectory::Traj
source · pub struct Traj<S: InterpState>where
DefaultAllocator: Allocator<f64, S::VecLength> + Allocator<f64, S::Size> + Allocator<f64, S::Size, S::Size>,{
pub segments: BTreeMap<i32, Spline<S>>,
/* private fields */
}
Expand description
Store a trajectory of any State.
Fields§
§segments: BTreeMap<i32, Spline<S>>
Splines are organized as a binary tree map whose index is the number of seconds since the start of this ephemeris rounded down
Implementations§
source§impl<S: InterpState> Traj<S>where
DefaultAllocator: Allocator<f64, S::VecLength> + Allocator<f64, S::Size> + Allocator<f64, S::Size, S::Size>,
impl<S: InterpState> Traj<S>where DefaultAllocator: Allocator<f64, S::VecLength> + Allocator<f64, S::Size> + Allocator<f64, S::Size, S::Size>,
sourcepub fn at(&self, epoch: Epoch) -> Result<S, NyxError>
pub fn at(&self, epoch: Epoch) -> Result<S, NyxError>
Evaluate the trajectory at this specific epoch.
sourcepub fn every(&self, step: Duration) -> TrajIterator<'_, S>
pub fn every(&self, step: Duration) -> TrajIterator<'_, S>
Creates an iterator through the trajectory by the provided step size
sourcepub fn every_between(
&self,
step: Duration,
start: Epoch,
end: Epoch
) -> TrajIterator<'_, S>
pub fn every_between( &self, step: Duration, start: Epoch, end: Epoch ) -> TrajIterator<'_, S>
Creates an iterator through the trajectory by the provided step size between the provided bounds
sourcepub fn find_bracketed<E>(
&self,
start: Epoch,
end: Epoch,
event: &E
) -> Result<S, NyxError>where
E: EventEvaluator<S>,
pub fn find_bracketed<E>( &self, start: Epoch, end: Epoch, event: &E ) -> Result<S, NyxError>where E: EventEvaluator<S>,
Find the exact state where the request event happens. The event function is expected to be monotone in the provided interval.
sourcepub fn find_all<E>(&self, event: &E) -> Result<Vec<S>, NyxError>where
E: EventEvaluator<S>,
pub fn find_all<E>(&self, event: &E) -> Result<Vec<S>, NyxError>where E: EventEvaluator<S>,
Find (usually) all of the states where the event happens. WARNING: The initial search step is 1% of the duration of the trajectory duration! For example, if the trajectory is 100 days long, then we split the trajectory into 100 chunks of 1 day and see whether the event is in there. If the event happens twice or more times within 1% of the trajectory duration, only the one of such events will be found.
sourcepub fn find_minmax<E>(
&self,
event: &E,
precision: Unit
) -> Result<(S, S), NyxError>where
E: EventEvaluator<S>,
pub fn find_minmax<E>( &self, event: &E, precision: Unit ) -> Result<(S, S), NyxError>where E: EventEvaluator<S>,
Find the minimum and maximum of the provided event through the trajectory
source§impl Traj<Orbit>
impl Traj<Orbit>
sourcepub fn to_frame(
&self,
new_frame: Frame,
cosm: Arc<Cosm>
) -> Result<Self, NyxError>
pub fn to_frame( &self, new_frame: Frame, cosm: Arc<Cosm> ) -> Result<Self, NyxError>
Allows converting the source trajectory into the (almost) equivalent trajectory in another frame
sourcepub fn to_csv_with_step(
&self,
filename: &str,
step: Duration,
cosm: Arc<Cosm>
) -> Result<(), NyxError>
pub fn to_csv_with_step( &self, filename: &str, step: Duration, cosm: Arc<Cosm> ) -> Result<(), NyxError>
Exports this trajectory to the provided filename in CSV format with the default headers and the provided step
sourcepub fn to_csv_between_with_step(
&self,
filename: &str,
start: Option<Epoch>,
end: Option<Epoch>,
step: Duration,
cosm: Arc<Cosm>
) -> Result<(), NyxError>
pub fn to_csv_between_with_step( &self, filename: &str, start: Option<Epoch>, end: Option<Epoch>, step: Duration, cosm: Arc<Cosm> ) -> Result<(), NyxError>
Exports this trajectory to the provided filename in CSV format with the default headers and the provided step
sourcepub fn to_csv(&self, filename: &str, cosm: Arc<Cosm>) -> Result<(), NyxError>
pub fn to_csv(&self, filename: &str, cosm: Arc<Cosm>) -> Result<(), NyxError>
Exports this trajectory to the provided filename in CSV format with the default headers, one state per minute
sourcepub fn to_csv_between(
&self,
filename: &str,
start: Option<Epoch>,
end: Option<Epoch>,
cosm: Arc<Cosm>
) -> Result<(), NyxError>
pub fn to_csv_between( &self, filename: &str, start: Option<Epoch>, end: Option<Epoch>, cosm: Arc<Cosm> ) -> Result<(), NyxError>
Exports this trajectory to the provided filename in CSV format with the default headers, one state per minute
sourcepub fn to_groundtrack_csv(
&self,
filename: &str,
body_fixed_frame: Frame,
cosm: Arc<Cosm>
) -> Result<(), NyxError>
pub fn to_groundtrack_csv( &self, filename: &str, body_fixed_frame: Frame, cosm: Arc<Cosm> ) -> Result<(), NyxError>
Exports this trajectory to the provided filename in CSV format with only the epoch, the geodetic latitude, longitude, and height at one state per minute. Must provide a body fixed frame to correctly compute the latitude and longitude.
source§impl Traj<Spacecraft>
impl Traj<Spacecraft>
sourcepub fn to_frame(
&self,
new_frame: Frame,
cosm: Arc<Cosm>
) -> Result<Self, NyxError>
pub fn to_frame( &self, new_frame: Frame, cosm: Arc<Cosm> ) -> Result<Self, NyxError>
Allows converting the source trajectory into the (almost) equivalent trajectory in another frame
sourcepub fn to_csv_with_step(
&self,
filename: &str,
step: Duration,
cosm: Arc<Cosm>
) -> Result<(), NyxError>
pub fn to_csv_with_step( &self, filename: &str, step: Duration, cosm: Arc<Cosm> ) -> Result<(), NyxError>
Exports this trajectory to the provided filename in CSV format with the default headers and the provided step
sourcepub fn to_csv_between_with_step(
&self,
filename: &str,
start: Option<Epoch>,
end: Option<Epoch>,
step: Duration,
cosm: Arc<Cosm>
) -> Result<(), NyxError>
pub fn to_csv_between_with_step( &self, filename: &str, start: Option<Epoch>, end: Option<Epoch>, step: Duration, cosm: Arc<Cosm> ) -> Result<(), NyxError>
Exports this trajectory to the provided filename in CSV format with the default headers and the provided step
sourcepub fn to_csv(&self, filename: &str, cosm: Arc<Cosm>) -> Result<(), NyxError>
pub fn to_csv(&self, filename: &str, cosm: Arc<Cosm>) -> Result<(), NyxError>
Exports this trajectory to the provided filename in CSV format with the default headers, one state per minute
sourcepub fn to_csv_between(
&self,
filename: &str,
start: Option<Epoch>,
end: Option<Epoch>,
cosm: Arc<Cosm>
) -> Result<(), NyxError>
pub fn to_csv_between( &self, filename: &str, start: Option<Epoch>, end: Option<Epoch>, cosm: Arc<Cosm> ) -> Result<(), NyxError>
Exports this trajectory to the provided filename in CSV format with the default headers, one state per minute
sourcepub fn to_groundtrack_csv(
&self,
filename: &str,
body_fixed_frame: Frame,
cosm: Arc<Cosm>
) -> Result<(), NyxError>
pub fn to_groundtrack_csv( &self, filename: &str, body_fixed_frame: Frame, cosm: Arc<Cosm> ) -> Result<(), NyxError>
Exports this trajectory to the provided filename in CSV format with only the epoch, the geodetic latitude, longitude, and height at one state per minute. Must provide a body fixed frame to correctly compute the latitude and longitude.
Trait Implementations§
source§impl<S: InterpState> Add<&Traj<S>> for Traj<S>where
DefaultAllocator: Allocator<f64, S::VecLength> + Allocator<f64, S::Size> + Allocator<f64, S::Size, S::Size>,
impl<S: InterpState> Add<&Traj<S>> for Traj<S>where DefaultAllocator: Allocator<f64, S::VecLength> + Allocator<f64, S::Size> + Allocator<f64, S::Size, S::Size>,
source§impl<S: InterpState> Add<Traj<S>> for Traj<S>where
DefaultAllocator: Allocator<f64, S::VecLength> + Allocator<f64, S::Size> + Allocator<f64, S::Size, S::Size>,
impl<S: InterpState> Add<Traj<S>> for Traj<S>where DefaultAllocator: Allocator<f64, S::VecLength> + Allocator<f64, S::Size> + Allocator<f64, S::Size, S::Size>,
source§impl<S: InterpState> AddAssign<&Traj<S>> for Traj<S>where
DefaultAllocator: Allocator<f64, S::VecLength> + Allocator<f64, S::Size> + Allocator<f64, S::Size, S::Size>,
impl<S: InterpState> AddAssign<&Traj<S>> for Traj<S>where DefaultAllocator: Allocator<f64, S::VecLength> + Allocator<f64, S::Size> + Allocator<f64, S::Size, S::Size>,
source§fn add_assign(&mut self, rhs: &Self)
fn add_assign(&mut self, rhs: &Self)
+=
operation. Read moresource§impl<S: InterpState> AddAssign<Traj<S>> for Traj<S>where
DefaultAllocator: Allocator<f64, S::VecLength> + Allocator<f64, S::Size> + Allocator<f64, S::Size, S::Size>,
impl<S: InterpState> AddAssign<Traj<S>> for Traj<S>where DefaultAllocator: Allocator<f64, S::VecLength> + Allocator<f64, S::Size> + Allocator<f64, S::Size, S::Size>,
source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
+=
operation. Read moreAuto Trait Implementations§
impl<S> RefUnwindSafe for Traj<S>where S: RefUnwindSafe,
impl<S> Send for Traj<S>
impl<S> Sync for Traj<S>
impl<S> Unpin for Traj<S>where S: Unpin,
impl<S> UnwindSafe for Traj<S>where S: UnwindSafe + RefUnwindSafe,
Blanket Implementations§
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Printing<T> for Twhere
T: Display,
impl<T> Printing<T> for Twhere T: Display,
§fn to_str(self) -> String
fn to_str(self) -> String
printing.rs
. §fn to_plainstr(self) -> String
fn to_plainstr(self) -> String
printing.rs
.§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.