curryer.compute.pointing¶
Pointing related calculations.
@author: Brandon Stone
Attributes¶
Classes¶
Types of planetary occultation. |
|
Class for working with TIM pointing data. |
Functions¶
|
Calculate the cosine angle between a boresight vector and one or more |
|
Calculate the cosine between an instruments boresight and target. |
|
Check if there was an FOV event at the specified time. |
|
Check if there was an FOV event at the specified time. |
|
Calculate the cosine angle between an instrument's boresight and an |
Module Contents¶
- curryer.compute.pointing.logger¶
- curryer.compute.pointing.calc_cosine(target_state, boresight_vector)¶
Calculate the cosine angle between a boresight vector and one or more state vectors. Vectors will be normalized (inplace).
- Parameters:
target_state (numpy.ndarray) – Array of state vectors [N, 3] or [3].
boresight_vector (numpy.ndarray) – Boresight vector [3].
- Returns:
Cosine values. Return is a scalar if target_state was a 1D array.
- Return type:
float or numpy.ndarray
- curryer.compute.pointing.boresight_dot_object(instrument, target, ugps_times)¶
Calculate the cosine between an instruments boresight and target.
- Parameters:
instrument (str or sds_spice.spicierpy.obj.Instrument) – Instrument to calculate the cosine angles for. If an Instrument object, it must contain a “frame” and “spacecraft”. Otherwise they are inferred from the instrument string.
target (str or sds_spice.spicierpy.obj.Body) – Target ephemeris object (e.g., Earth, Sun).
ugps_times (int or list of ints or numpy.ndarray) – One or more uGPS times to calculate values at.
- Returns:
Cosine angle between the boresight and target, in the instrument frame.
- Return type:
float or numpy.ndarray
Notes
The boresight is retrieve from the instrument’s kernel (IK).
- curryer.compute.pointing.check_fov(ugps_times, instrument, target='MOON', observer=True, correction='LT+S', allow_nans=False)¶
Check if there was an FOV event at the specified time.
- class curryer.compute.pointing.OccultType¶
Bases:
enum.IntEnumTypes of planetary occultation. See: https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/occult_c.html
- TOTAL_TARGET1_BY_TARGET2 = -3¶
- ANNULAR_TARGET1_BY_TARGET2 = -2¶
- PARTIAL_TARGET1_BY_TARGET2 = -1¶
- NO_OCCULT = 0¶
- PARTIAL_TARGET2_BY_TARGET1 = 1¶
- ANNULAR_TARGET2_BY_TARGET1 = 2¶
- TOTAL_TARGET2_BY_TARGET1 = 3¶
- curryer.compute.pointing.check_occult(ugps_times, observer, target1='MOON', target2='SUN', correction='LT')¶
Check if there was an FOV event at the specified time.
- class curryer.compute.pointing.PointingData(observer, qf_map=None, with_geolocate=False, microsecond_cadence=None)¶
Bases:
curryer.compute.abstract.AbstractMissionDataClass for working with TIM pointing data.
- DEFAULT_CADENCE = 10000000¶
- DEFAULT_QF_MAP¶
- observer¶
- qf_map¶
- with_geolocate = False¶
- max_deltat = 0¶
- get_pointing(ugps_times)¶
Determine pointing values.
- Parameters:
ugps_times (int or iter of int) – Determine pointing at 1 or more times (uGPS).
- Returns:
Table of [?] at each time.
- Return type:
pandas.DataFrame
- curryer.compute.pointing.legacy_instrument_dot_object(spacecraft_to_eci_rotation, spacecraft_in_eci_state, object_in_eci_state, boresight_in_instrument_vector, spacecraft_to_instrument_rotation=None)¶
Calculate the cosine angle between an instrument’s boresight and an object (planet).
- Parameters:
spacecraft_to_eci_rotation (numpy.ndarray) – Rotation matrix (3x3 or Nx3x3) from the spacecraft’s reference frame to the ECI (earth centered inertial) reference frame.
spacecraft_in_eci_state (numpy.ndarray) – State vector (3 or Nx3; x,y,z) of the spacecraft’s location in the ECI reference frame.
object_in_eci_state (numpy.ndarray) – State vector (3 or Nx3; x,y,z) of the object’s location in the ECI reference frame. The object is typically a planet. For example, the vector would be all zeros if the object was Earth.
boresight_in_instrument_vector (numpy.ndarray) – Pointing vector (3; x,y,z) of the instrument’s boresight, in the instrument’s reference frame (e.g., [1, 0, 0]).
spacecraft_to_instrument_rotation (numpy.ndarray, optional) – Rotation matrix (3x3) from the spacecraft’s reference frame to the instrument’s reference frame. Default assumes they are the same.
- Returns:
Cosine angle based on the normalized dot product of the instrument boresight and the object’s state vector(s). The return is a scalar numpy float if spacecraft_to_eci_rotation was a 2D array, otherwise it’s a 1D array of floats.
- Return type:
numpy.float64 or numpy.ndarray
Notes
ECI and J2000 are considered the same spatial reference frame.
- Based on the java implementation in tim_processing:
src/java/processing/tim/pointing_data/TCTEPointingDataServer.java
Java implementation difference - A “Quat4d” & “Vector3d” transformation
includes a matrix transposition; likely a quaternion format difference.