Struct SpiceLock

Source
pub struct SpiceLock { /* private fields */ }
Available on crate feature lock only.
Expand description

A wrapper singleton struct around the API to prevent concurrent calls to SPICE functions from multiple threads. Exposes all functions as methods with identical signatures besides the added &self argument. Only available with the lock feature enabled.

Implementations§

Source§

impl SpiceLock

Source

pub fn try_acquire() -> Result<Self, &'static str>

Attempt to create a SpiceLock instance. Will be Err if an instance already exists.

Source§

impl SpiceLock

Source

pub fn bodc2n(&self, code: i32) -> (String, bool)

Translate the SPICE integer code of a body into a common name for that body.

See raw::bodc2n for the raw interface.

Source§

impl SpiceLock

Source

pub fn timout(&self, et: f64, pictur: &str) -> String

This routine converts an input epoch represented in TDB seconds past the TDB epoch of J2000 to a character string formatted to the specifications of a user’s format picture.

See raw::timout for the raw interface.

Source§

impl SpiceLock

Source

pub fn dskp02(&self, handle: i32, dladsc: DLADSC) -> Vec<[i32; 3]>

Fetch triangular plates from a type 2 DSK segment.

See raw::dskp02 for the raw interface.

Source§

impl SpiceLock

Source

pub fn dskv02(&self, handle: i32, dladsc: DLADSC) -> Vec<[f64; 3]>

Fetch vertices from a type 2 DSK segment.

See raw::dskv02 for the raw interface.

Source§

impl SpiceLock

Source

pub fn kdata( &self, which: i32, kind: &str, ) -> (String, String, String, i32, bool)

Fetch vertices from a type 2 DSK segment.

See raw::kdata for the raw interface.

Source§

impl SpiceLock

Source

pub fn bodfnd(&self, body: i32, item: &str) -> bool

Determine whether values exist for some item for any body in the kernel pool.

Source§

impl SpiceLock

Source

pub fn bodn2c(&self, name: &str) -> (i32, bool)

Translate the name of a body or object to the corresponding SPICE integer ID code.

Source§

impl SpiceLock

Source

pub fn dascls(&self, handle: i32)

close a das file.

Source§

impl SpiceLock

Source

pub fn dasopr(&self, fname: &str) -> i32

Open a DAS file for reading.

Source§

impl SpiceLock

Source

pub fn dlabfs(&self, handle: i32) -> (DLADSC, bool)

Begin a forward segment search in a DLA file.

Source§

impl SpiceLock

Source

pub fn dskgd(&self, handle: i32, dladsc: DLADSC) -> DSKDSC

Return the DSK descriptor from a DSK segment identified by a DAS handle and DLA descriptor.

Source§

impl SpiceLock

Source

pub fn dskn02(&self, handle: i32, dladsc: DLADSC, plid: i32) -> [f64; 3]

Compute the unit normal vector for a specified plate from a type 2 DSK segment.

Source§

impl SpiceLock

Source

pub fn dskobj(&self, dsk: &str) -> Cell

Find the set of body ID codes of all objects for which topographic data are provided in a specified DSK file.

Source§

impl SpiceLock

Source

pub fn dskx02( &self, handle: i32, dladsc: DLADSC, vertex: [f64; 3], raydir: [f64; 3], ) -> (i32, [f64; 3], bool)

Determine the plate ID and body-fixed coordinates of the intersection of a specified ray with the surface defined by a type 2 DSK plate model.

Source§

impl SpiceLock

Source

pub fn dskz02(&self, handle: i32, dladsc: DLADSC) -> (i32, i32)

Return plate model size parameters—plate count and vertex count—for a type 2 DSK segment.

Plate first, vertices second.

See [neat::dskp02] for the raw interface.

Source§

impl SpiceLock

Source

pub fn georec(&self, lon: f64, lat: f64, alt: f64, re: f64, f: f64) -> [f64; 3]

Convert geodetic coordinates to rectangular coordinates.

Source§

impl SpiceLock

Source

pub fn illumf( &self, method: &str, target: &str, ilusrc: &str, et: f64, fixref: &str, abcorr: &str, obsrvr: &str, spoint: [f64; 3], ) -> (f64, [f64; 3], f64, f64, f64, bool, bool)

Compute the illumination angles—phase, incidence, and emission—at a specified point on a target body. Return logical flags indicating whether the surface point is visible from the observer’s position and whether the surface point is illuminated.

The target body’s surface is represented using topographic data provided by DSK files, or by a reference ellipsoid.

The illumination source is a specified ephemeris object.

Source§

impl SpiceLock

Source

pub fn furnsh(&self, name: &str)

Load one or more SPICE kernels into a program.

Source§

impl SpiceLock

Source

pub fn kclear(&self)

Clear the KEEPER subsystem: unload all kernels, clear the kernel pool, and re-initialize the subsystem. Existing watches on kernel variables are retained.

Source§

impl SpiceLock

Source

pub fn ktotal(&self, kind: &str) -> i32

Return the current number of kernels that have been loaded via the KEEPER interface that are of a specified type.

Source§

impl SpiceLock

Source

pub fn latrec(&self, radius: f64, longitude: f64, latitude: f64) -> [f64; 3]

Convert from latitudinal coordinates to rectangular coordinates.

Source§

impl SpiceLock

Source

pub fn mxv(&self, m1: [[f64; 3]; 3], vin: [f64; 3]) -> [f64; 3]

Multiply a 3x3 double precision matrix with a 3-dimensional double precision vector.

Source§

impl SpiceLock

Source

pub fn occult( &self, targ1: &str, shape1: &str, frame1: &str, targ2: &str, shape2: &str, frame2: &str, abcorr: &str, obsrvr: &str, et: f64, ) -> i32

Determines the occultation condition (not occulted, partially, etc.) of one target relative to another target as seen by an observer at a given time, with targets modeled as points, ellipsoids, or digital shapes (DSK)

Source§

impl SpiceLock

Source

pub fn pxform(&self, from: &str, to: &str, et: f64) -> [[f64; 3]; 3]

Return the matrix that transforms position vectors from one specified frame to another at a specified epoch.

Source§

impl SpiceLock

Source

pub fn pxfrm2( &self, from: &str, to: &str, etfrom: f64, etto: f64, ) -> [[f64; 3]; 3]

Return the 3x3 matrix that transforms position vectors from one specified frame at a specified epoch to another specified frame at another specified epoch.

Source§

impl SpiceLock

Source

pub fn radrec(&self, range: f64, ra: f64, dec: f64) -> [f64; 3]

Convert range, right ascension, and declination to rectangular coordinates

Source§

impl SpiceLock

Source

pub fn recrad(&self, rectan: [f64; 3]) -> (f64, f64, f64)

Convert rectangular coordinates to range, right ascension, and declination.

Source§

impl SpiceLock

Source

pub fn sincpt( &self, method: &str, target: &str, et: f64, fixred: &str, abcorr: &str, obsrvr: &str, dref: &str, dvec: [f64; 3], ) -> ([f64; 3], f64, [f64; 3], bool)

Compute, for a given observer and a ray emanating from the observer, the surface intercept of the ray on a target body at a specified epoch, optionally corrected for light time and stellar aberration.

The surface of the target body may be represented by a triaxial ellipsoid or by topographic data provided by DSK files.

This routine supersedes srfxpt.

Source§

impl SpiceLock

Source

pub fn spkcls(&self, handle: i32)

Close a SPK file opened for read or write.

Source§

impl SpiceLock

Source

pub fn spkopn(&self, fname: &str, ifname: &str, ncomch: i32) -> i32

Create a new SPK file, returning the handle of the opened file

Source§

impl SpiceLock

Source

pub fn spkw09( &self, handle: i32, body: i32, center: i32, frame: &str, first: f64, last: f64, segid: &str, degree: i32, n: i32, states: &mut [[f64; 6]], epochs: &mut [f64], )

Write a type 9 segment to an SPK file.

Source§

impl SpiceLock

Source

pub fn spkpos( &self, targ: &str, et: f64, frame: &str, abcorr: &str, obs: &str, ) -> ([f64; 3], f64)

Return the position of a target body relative to an observing body, optionally corrected for light time (planetary aberration) and stellar aberration.

Source§

impl SpiceLock

Source

pub fn spkezr( &self, targ: &str, et: f64, frame: &str, abcorr: &str, obs: &str, ) -> ([f64; 6], f64)

Return the state (position and velocity) of a target body relative to an observing body, optionally corrected for light time (planetary aberration) and stellar aberration.

Source§

impl SpiceLock

Source

pub fn str2et(&self, targ: &str) -> f64

Convert a string representing an epoch to a double precision value representing the number of TDB seconds past the J2000 epoch corresponding to the input epoch.

Source§

impl SpiceLock

Source

pub fn surfpt( &self, positn: [f64; 3], u: [f64; 3], a: f64, b: f64, c: f64, ) -> ([f64; 3], bool)

Determine the intersection of a line-of-sight vector with the surface of an ellipsoid.

Source§

impl SpiceLock

Source

pub fn unload(&self, name: &str)

Unload a SPICE kernel.

Source§

impl SpiceLock

Source

pub fn vsep(&self, v1: [f64; 3], v2: [f64; 3]) -> f64

Find the separation angle in radians between two double precision, 3-dimensional vectors. This angle is defined as zero if either vector is zero.

Source§

impl SpiceLock

Source

pub fn vdot(&self, v1: [f64; 3], v2: [f64; 3]) -> f64

Compute the dot product of two double precision, 3-dimensional vectors.

Source§

impl SpiceLock

Source

pub fn vcrss(&self, v1: [f64; 3], v2: [f64; 3]) -> [f64; 3]

Compute the cross product of two 3-dimensional vectors.

Source§

impl SpiceLock

Source

pub fn xpose(&self, m1: [[f64; 3]; 3]) -> [[f64; 3]; 3]

Transpose a 3x3 matrix.

Trait Implementations§

Source§

impl Drop for SpiceLock

Source§

fn drop(&mut self)

Executes the destructor for this 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.

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.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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

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

fn is_in_subset(&self) -> bool

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

fn to_subset_unchecked(&self) -> SS

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

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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.