Trajectory

class heliopy.spice.Trajectory(target)

Bases: object

A 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 attributes times, x, y, and z.

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.

Attributes Summary

coords

A SkyCoord object.

generated

True if positions have been generated, False otherwise.

observing_body

Observing Body.

r

Magnitude of position vectors.

speed

Speed (magnitude of velocity vectors).

spice_frame

The coordinate frame used by SPICE.

target

The Body whose coordinates are being calculated.

times

A Time object containing the times sampled.

velocity

Velocity.

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 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 SkyCoord object.

Notes

The following frames are supported:

Spice name

SkyCoord class

IAU_SUN

HeliographicCarrington

If 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

True if positions have been generated, False otherwise.

observing_body

Observing Body. The position vectors are all specified relative to this body.

r

Magnitude of position vectors.

speed

Speed (magnitude of velocity vectors).

spice_frame

The coordinate frame used by SPICE.

target

The Body whose coordinates are being calculated.

times

A Time object containing the times sampled.

velocity

Velocity.

Returned as a shape (n, 3) array, where the n axis 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