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

source

pub fn at(&self, epoch: Epoch) -> Result<S, NyxError>

Evaluate the trajectory at this specific epoch.

source

pub fn first(&self) -> S

Returns the first state in this ephemeris

source

pub fn last(&self) -> S

Returns the last state in this ephemeris

source

pub fn every(&self, step: Duration) -> TrajIterator<'_, S>

Creates an iterator through the trajectory by the provided step size

source

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

source

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.

source

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.

source

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>

source

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

source

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

source

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

source

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

source

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

source

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

pub fn to_csv_custom( &self, filename: &str, headers: Vec<&str>, step: Duration, cosm: Arc<Cosm> ) -> Result<(), NyxError>

Exports this trajectory to the provided filename in CSV format with the provided headers and the provided step

source§

impl Traj<Spacecraft>

source

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

source

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

source

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

source

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

source

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

source

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

pub fn to_csv_custom( &self, filename: &str, headers: Vec<&str>, step: Duration, cosm: Arc<Cosm> ) -> Result<(), NyxError>

Exports this trajectory to the provided filename in CSV format with the provided headers and the provided step

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

source§

fn add(self, other: &Traj<S>) -> Self::Output

Add one trajectory to another. If they do not overlap to within 10ms, a warning will be printed.

§

type Output = Traj<S>

The resulting type after applying the + operator.
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>,

source§

fn add(self, other: Traj<S>) -> Self::Output

Add one trajectory to another. If they do not overlap to within 10ms, a warning will be printed.

§

type Output = Traj<S>

The resulting type after applying the + operator.
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>,

source§

fn add_assign(&mut self, rhs: &Self)

Performs the += operation. Read more
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>,

source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
source§

impl<S: Clone + InterpState> Clone for Traj<S>where DefaultAllocator: Allocator<f64, S::VecLength> + Allocator<f64, S::Size> + Allocator<f64, S::Size, S::Size>,

source§

fn clone(&self) -> Traj<S>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<S: InterpState> Display for Traj<S>where DefaultAllocator: Allocator<f64, S::VecLength> + Allocator<f64, S::Size> + Allocator<f64, S::Size, S::Size>,

source§

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

Formats the value using the given formatter. Read more

Auto 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§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · 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> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Printing<T> for Twhere T: Display,

§

fn to_str(self) -> String

Method to serialize. Decorates Vecs with square brackets and tuples with round ones. Implementation code is in printing.rs.
§

fn to_plainstr(self) -> String

Method to serialize in minimal form (space separated, no brackets) Implementation code is in printing.rs.
§

fn rd(self) -> String

Printable in red
§

fn gr(self) -> String

Printable in green
§

fn bl(self) -> String

Printable in blue
§

fn yl(self) -> String

Printable in yellow
§

fn mg(self) -> String

Printable in magenta
§

fn cy(self) -> String

Printable in cyan
§

fn wvec(self, f: &mut File) -> Result<(), Error>

Method to write vector(s) to file f (space separated, without brackets). Passes up io errors
§

fn pvec(self)

Method to print vector(s) to stdout (space separated,without brackets).
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T, Right> ClosedAdd<Right> for Twhere T: Add<Right, Output = T> + AddAssign<Right>,