irfpy.pep.pep_spice

Top-level module of PEP-dedicated spice information.

Warning

Deprecated and replaced by irfpy.juice.jspice.

PepSpice provides all the functionality for PEP-dedicated spice. Also refer to the document PEP dedicated SPICE information (Deprecated 121022). The module includes natural bodies’ position and directions. Also, natural body related frames are handled. You may need to use irfpy.pep.galileo_spice for Galileo spacecraft or irfpy.pep.juice_spice for JUICE mission orbit data..

The work flow is as follows.

First, one can get PepSpice instance using get_default_pepspice() function.

>>> spep = get_default_pepspice()

Then, you can use PepSpice.get_posvel() method to get the position and velocity of the respective bodies.

Note that the kernels to be loaded should be added to the .irfpyrc. Section [pep] and the entry spicekernels is the corresponding one. You can specify the files as a comma separated list.

[pep]
spicekernels = /Jupiter/spice/naif0009.tls, /Jupiter/spice/pck00010.tpc , /Jupiter/spice/de421.bsp , /Jupiter/spice/jup230l.bsp

Spice Kernels

Spice kernels below must be downloaded from ftp://naif.jpl.nasa.gov/pub/naif/generic_kernels

  • naif0009.tls

  • pck00010.tpc

  • de421.bsp

  • jup230l.bsp

Version of above files may be changed without notification in the future. In such cases, you can download the latest version, and change the .irfpyrc file.

Private spice kernels

Private spice kernel to convert JSE frame is made and loaded automatically. Refer to Private kernel.

class irfpy.pep.pep_spice.PepSpice(rcfilenames=None)[source]

Bases: object

Class handling PEP-dedicated SPICE kernels.

default_pepspice = None
get_posvel(object, t, frame, center)[source]

Get the position and velocity of bodies

Get position and velocity for the given object at the time of t in the specified frame with the origin of the given body. A wrapper to SPICE function of spkezr.

Kernels should be read prior to this method (normally done during the instancing). Easy way of adding your kernels is to specify the kernel path into the .irfpyrc entry ([pep] spicekernel).

Parameters
  • object – A body name in SPICE

  • t (datetime.datetime) – Time

  • frame – A frame name defined in SPICE

  • center – A object name in SPICE to specify the origin.

>>> spep = PepSpice()
>>> t0 = datetime.datetime(2025, 1, 1, 0, 0, 0)
>>> pos, vel = spep.get_posvel('Jupiter', t0, "J2000", "Sun")
>>> print('%.3e %.3e %.3e' % (pos[0], pos[1], pos[2]))
1.580e+08 6.850e+08 2.898e+08
>>> print('%.2f %.2f %.2f' % (vel[0], vel[1], vel[2]))
-12.94 2.95 1.58
convert_vector(vector, from_frame, to_frame, t)[source]

Convert vector from a frame to another frame.

A wrapper to SPICE function pxform.

Parameters
  • vector (np.array with shape of (3, ).) – Numpy array of the vector in from_frame.

  • from_frame – Frame name defined in SPICE.

  • to_frame – Frame name defined in SPICE.

  • t (datetime.datetime instance) – Time

Returns

A vector in to_frame

Return type

np.array with shape of (3, ).

classmethod get_default_pepspice()[source]
irfpy.pep.pep_spice.get_default_pepspice()[source]

Return the default pepspice instance.

A high-level function that produces a default PepSpice.

irfpy.pep.pep_spice.doctests()[source]