Trajectory¶
-
class
heliopy.spice.Trajectory(target)¶ Bases:
objectA class for the trajectory of a single body.
Objects are initially created using only the body. To perform the actual trajectory calculation run
generate_positions(). The generated positions are then available via. the attributestimes,x,y, andz.- Parameters
target (str) – Name of the target. The name must be present in the loaded kernels.
Notes
When an instance of this class is created, a leapseconds kernel and a planets kernel are both automatically loaded.
See also
furnishfor loading in local spice kernels.
Attributes Summary
A
SkyCoordobject.Trueif positions have been generated,Falseotherwise.Observing
Body.Magnitude of position vectors.
Speed (magnitude of velocity vectors).
The coordinate frame used by SPICE.
The
Bodywhose coordinates are being calculated.A
Timeobject containing the times sampled.Velocity.
x component of velocity.
y component of velocity.
z component of velocity.
x coordinates of position.
y coordinates of position.
z coordinates of position.
Methods Summary
change_units(unit)Convert the positions to different units.
generate_positions(times, observing_body, frame)Generate positions from a spice kernel.
Attributes Documentation
-
coords¶ A
SkyCoordobject.Notes
The following frames are supported:
Spice name
SkyCoord class
IAU_SUN
HeliographicCarringtonIf you need the coordinates in another frame, generate them using the ‘IAU_SUN’ frame and then use
transform_to()to transform them into the desired coordinate frame.
-
generated¶ Trueif positions have been generated,Falseotherwise.
-
r¶ Magnitude of position vectors.
-
speed¶ Speed (magnitude of velocity vectors).
-
spice_frame¶ The coordinate frame used by SPICE.
-
velocity¶ Velocity.
Returned as a shape
(n, 3)array, where thenaxis is the time axis.
-
vx¶ x component of velocity.
-
vy¶ y component of velocity.
-
vz¶ z component of velocity.
-
x¶ x coordinates of position.
-
y¶ y coordinates of position.
-
z¶ z coordinates of position.
Methods Documentation
-
change_units(unit)¶ Convert the positions to different units.
- Parameters
unit (astropy.units.Quantity) – Must be a unit of length (e.g. km, m, AU).
-
generate_positions(times, observing_body, frame, abcorr=None)¶ Generate positions from a spice kernel.
- Parameters
times (time like) – An object that can be parsed by
Time.observing_body (str or int) – The observing body. Output position vectors are given relative to the position of this body. See https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/req/naif_ids.html for a list of bodies.
frame (str) – The coordinate system to return the positions in. See https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/req/frames.html for a list of frames.
abcorr (str, optional) – By default no aberration correciton is performed. See the documentaiton at https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/spkezr_c.html for allowable values and their effects.