SpicePosition¶
giant.utilities.spice_interface
:
- class giant.utilities.spice_interface.SpicePosition(target, reference_frame, corrections, observer)[source]¶
This class creates a callable that returns the position (in km) of one object to another given a python datetime.
This class works by storing the “static” inputs to the call to the spice function
spkpos
(specifically the target, reference frame, corrections, and observer). This makes it easy to define an object that can be used throughout GIANT in theSceneObj
. In addition, this class provides access to the light time computation from spice usinglight_time()
and both the position and light time usingposition_light_time()
. The interface to spice is provided through spiceypy.For more details, refer to the NAIF spice documentation for spkpos at https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/FORTRAN/spicelib/spkpos.html.
This class should be preferred over the
create_callable_position()
because it works much better with pickle and provides more functionality.- Parameters:
target (str) – The name/integer spice id for the object we are computing the position vector to as a string.
reference_frame (str) – The frame we are computing the position vector in as a string
corrections (str) – The corrections to use when computing the position vector (usually for GIANT this should be
'NONE'
observer (str) – The name/integer spice id for the object we are computing the position vector from as a string.
- target: str¶
The object we are computing the position vector to as a string.
This usually is the name of the object or its integer spice id as a string. This is passed to the
TARG
input for spkpos.
- reference_frame: str¶
The frame we are to compute the position vector in as a string
For GIANT this should usually be the inertial frame
'J200'
. This is passed to theREF
input for spkpos.
- corrections: str¶
The corrections we are to apply when computing the position vector.
Valid inputs are
'NONE'
for no correction,'LT'
for light time only corrections,'LT+S'
for light time plus stellar aberration corrections,'CN'
for converged light time only corrections, and'CN+S'
for converged light time plus aberration corrections.For GIANT this should usually be
'NONE'
since it does its own corrections. This is passed to theABCORR
input for spkpos.
- observer: str¶
The object we are computing the position vector from as a string.
This usually is the name of the object or its integer spice id as a string. This is passed to the
OBS
input for spkpos.
Summary of Methods
Make the call to spkpos given the stored settings at the input date returning only the light time in TDB seconds. |
|
Make the call to spkpos given the stored settings at the input date returning both the position vector in kilometers and the light time in TDB seconds. |