create_callable_position

giant.utilities.spice_interface:

giant.utilities.spice_interface.create_callable_position(target, frame, corrections, observer)[source]

This function generates a partial function of the spkpos method from spice with the target, frame, abcorr, and observer inputs already set (so that the only remaining input is the ephemeris time).

This function can only be used if the spiceypy package is installed and available for the current python implementation. The resulting callable from this method will return the position vector from the observer to the target expressed in the specified frame using the input corrections.

Calls to the output from this function are equivalent to

>>> import spiceypy
>>> et = 5.23
>>> state, _ = spiceypy.spkpos(target, et, frame, corrections, observer)

where et is the ephemeris time passed to the output from this function.

Parameters:
  • target (str) – The target to return the position of (targ)

  • frame (str) – The frame to return the position vector in (ref)

  • corrections (str) – The flag for aberration and light time corrections (abcorr)

  • observer (str) – The origin of the position vector (obs)

Returns:

A partial function wrapper around the spiceypy.spkpos function which only requires the ephemeris time to be input

Return type:

Callable