Struct Instrument
pub struct Instrument {
pub q_to_i: EulerParameter,
pub offset_i: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>,
pub fov: FovShape,
}Expand description
Instrument is defined by a mounting Euler Parameter, a mounting translation (“level arm”), and a field of view of the instrument. Notations: frame N is inertial; frame B is body; frame I is instrument.
Fields§
§q_to_i: EulerParameterThe static rotation from the Parent Frame to the instrument Frame. (How the camera is bolted onto the bus).
offset_i: Matrix<f64, Const<3>, Const<1>, ArrayStorage<f64, 3, 1>>The translation offset from the Parent Frame origin (CoM) to the instrument origin. (The “Lever Arm”).
fov: FovShapeThe geometric definition of the field of view.
Implementations§
§impl Instrument
impl Instrument
pub fn transform_state(
&self,
q_sc_to_b: EulerParameter,
sc_state: CartesianState,
) -> Result<(EulerParameter, CartesianState), PhysicsError>
pub fn transform_state( &self, q_sc_to_b: EulerParameter, sc_state: CartesianState, ) -> Result<(EulerParameter, CartesianState), PhysicsError>
Computes the state (orientation + Cartesian state) of the instrument at a specific instant, given the spacecraft’s state.
NOTE: This call will return an error if the reference frames are not adequate. Example:
- If the mounting quaterion (q_to_i) frame does not match in sc_attitude_to_body “to” frame IDs
:type q_sc_to_b: Quaternion :type sc_state: Orbit :rtype: tuple[Quaternion, Orbit]
pub fn fov_margin_deg(
&self,
sc_q_to_b: EulerParameter,
sc_state: CartesianState,
target_state: CartesianState,
) -> Result<f64, PhysicsError>
pub fn fov_margin_deg( &self, sc_q_to_b: EulerParameter, sc_state: CartesianState, target_state: CartesianState, ) -> Result<f64, PhysicsError>
Calculates the angular margin to the FOV boundary in degrees.
§Arguments
- sc_q_to_b: rotation from the sc_state frame to the body frame in which is expressed the instrument rotation.
- sc_state: state of the spacecraft, typically in an inertial frame
- target_state: state of the target object in the same frame as the sc_state, e.g. IAU Moon if sc_state is in IAU Moon
This is a continuous function suitable for event detection (root finding).
> 0.0: Target is INSIDE.< 0.0: Target is OUTSIDE.= 0.0: Target is ON THE BOUNDARY.
NOTE: This call will return an error if the reference frames are not adequate. Example:
- If the mounting rotation “from” frame does not match in sc_attitude_to_body “to” frame IDs
- If the target state frame ID is not identical to the instrument’s inertial state given the sc_attitude Euler Parameter.
:type sc_q_to_b: Quaternion :type sc_state: Orbit :type target_state: Orbit :rtype: float
pub fn is_target_in_fov(
&self,
sc_attitude_inertial_to_body: EulerParameter,
sc_state: CartesianState,
target_state: CartesianState,
) -> Result<bool, PhysicsError>
pub fn is_target_in_fov( &self, sc_attitude_inertial_to_body: EulerParameter, sc_state: CartesianState, target_state: CartesianState, ) -> Result<bool, PhysicsError>
Checks if a target is visible within the Field of View.
:type sc_attitude_inertial_to_body: Quaternion :type sc_state: Orbit :type target_state: Orbit :rtype: bool
pub fn footprint(
&self,
sc_q_n_to_b: EulerParameter,
sc_state_target: CartesianState,
q_n_to_target: EulerParameter,
resolution: usize,
) -> Result<Vec<CartesianState>, PhysicsError>
pub fn footprint( &self, sc_q_n_to_b: EulerParameter, sc_state_target: CartesianState, q_n_to_target: EulerParameter, resolution: usize, ) -> Result<Vec<CartesianState>, PhysicsError>
Computes the footprint (swath) of the instrument on a target body.
This function projects the edges of the Field of View onto the provided target ellipsoid.
§Arguments
sc_q_n_to_b- The orientation of the spacecraft body relative to Inertial.sc_state_target- The inertial state (position/velocity) of the spacecraft.q_n_to_target- The orientation of the target body frame relative to Inertial.resolution- The number of points to generate along the FOV boundary.
§Returns
A vector of Orbit objects, each representing a point on the surface of the target
expressed in the target_frame (Fixed).
:type sc_q_n_to_b: Quaternion :type sc_state_target: Orbit :type q_n_to_target: Quaternion :type resolution: int :rtype: list[Orbit]
Trait Implementations§
§impl Clone for Instrument
impl Clone for Instrument
§fn clone(&self) -> Instrument
fn clone(&self) -> Instrument
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl DataSetT for Instrument
impl DataSetT for Instrument
§impl Debug for Instrument
impl Debug for Instrument
§impl<'a> Decode<'a> for Instrument
impl<'a> Decode<'a> for Instrument
§impl Default for Instrument
impl Default for Instrument
§fn default() -> Instrument
fn default() -> Instrument
§impl Display for Instrument
impl Display for Instrument
§impl Encode for Instrument
impl Encode for Instrument
§fn encoded_len(&self) -> Result<Length, Error>
fn encoded_len(&self) -> Result<Length, Error>
§fn encode(&self, encoder: &mut impl Writer) -> Result<(), Error>
fn encode(&self, encoder: &mut impl Writer) -> Result<(), Error>
Writer].§fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>
fn encode_to_slice<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8], Error>
§fn encode_to_vec(&self, buf: &mut Vec<u8>) -> Result<Length, Error>
fn encode_to_vec(&self, buf: &mut Vec<u8>) -> Result<Length, Error>
§impl<'a, 'py> FromPyObject<'a, 'py> for Instrumentwhere
Instrument: Clone,
impl<'a, 'py> FromPyObject<'a, 'py> for Instrumentwhere
Instrument: Clone,
§type Error = PyClassGuardError<'a, 'py>
type Error = PyClassGuardError<'a, 'py>
§fn extract(
obj: Borrowed<'a, 'py, PyAny>,
) -> Result<Instrument, <Instrument as FromPyObject<'a, 'py>>::Error>
fn extract( obj: Borrowed<'a, 'py, PyAny>, ) -> Result<Instrument, <Instrument as FromPyObject<'a, 'py>>::Error>
§impl<'py> IntoPyObject<'py> for Instrument
impl<'py> IntoPyObject<'py> for Instrument
§type Target = Instrument
type Target = Instrument
§type Output = Bound<'py, <Instrument as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <Instrument as IntoPyObject<'py>>::Target>
§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Instrument as IntoPyObject<'py>>::Output, <Instrument as IntoPyObject<'py>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Instrument as IntoPyObject<'py>>::Output, <Instrument as IntoPyObject<'py>>::Error>
§impl PartialEq for Instrument
impl PartialEq for Instrument
§impl PyClass for Instrument
impl PyClass for Instrument
§impl PyTypeInfo for Instrument
impl PyTypeInfo for Instrument
§const NAME: &'static str = <Self as ::pyo3::PyClass>::NAME
const NAME: &'static str = <Self as ::pyo3::PyClass>::NAME
prefer using ::type_object(py).name() to get the correct runtime value
§const MODULE: Option<&'static str> = <Self as ::pyo3::impl_::pyclass::PyClassImpl>::MODULE
const MODULE: Option<&'static str> = <Self as ::pyo3::impl_::pyclass::PyClassImpl>::MODULE
prefer using ::type_object(py).module() to get the correct runtime value
§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
§fn is_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_type_of(object: &Bound<'_, PyAny>) -> bool
object is an instance of this type or a subclass of this type.§fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
fn is_exact_type_of(object: &Bound<'_, PyAny>) -> bool
object is an instance of this type.impl Copy for Instrument
impl DerefToPyAny for Instrument
impl StructuralPartialEq for Instrument
Auto Trait Implementations§
impl Freeze for Instrument
impl RefUnwindSafe for Instrument
impl Send for Instrument
impl Sync for Instrument
impl Unpin for Instrument
impl UnsafeUnpin for Instrument
impl UnwindSafe for Instrument
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
self into an owned Python object, dropping type information.§fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>
self into an owned Python object, dropping type information and unbinding it
from the 'py lifetime.§fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>
self into a Python object. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
§impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
impl<T> PyTypeCheck for Twhere
T: PyTypeInfo,
§const NAME: &'static str = T::NAME
const NAME: &'static str = T::NAME
Use ::classinfo_object() instead and format the type name at runtime. Note that using built-in cast features is often better than manual PyTypeCheck usage.
§fn type_check(object: &Bound<'_, PyAny>) -> bool
fn type_check(object: &Bound<'_, PyAny>) -> bool
§fn classinfo_object(py: Python<'_>) -> Bound<'_, PyAny>
fn classinfo_object(py: Python<'_>) -> Bound<'_, PyAny>
isinstance and issubclass function. Read more§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.