Utils#
Spice Utils#
- pykep.utils.spice_version()#
Retrieves the installed version of the NAIF spice toolkit.
- Returns:
string
: SPICE toolbox version installed in the system.
- pykep.utils.load_spice_kernels(paths)#
Loads one or more kernels for use with the NAIF spice toolkit.
- Args:
paths (
string
orlist
): The path (or paths) of the kernels to load
- pykep.utils.unload_spice_kernels(paths)#
Unloads from memory one or more kernels for use with the NAIF spice toolkit.
- Args:
paths (
string
orlist
): The path (or paths) of the kernels to load
- pykep.utils.inspect_spice_kernel(path)#
Detects the objects contained in a specific kernel. This is useful to understand the possibile queries to make for a certain kernel.
- Args:
path (
string
): The path (or paths) of the kernels to load- Returns:
list
: the NAIF ids of the objects found in the kernels.
- pykep.utils.name2naifid(name)#
Retreives the NAIF id of some planet/comet/spacecraft
- Args:
name (
string
): The name of the planet/comet/spacecraft to be found- Returns:
int
the NAIF id of the the planet/comet/spacecraft
- pykep.utils.framename2naifid(name)#
Retreives the NAIF id of some reference frame
- Args:
name (
string
): The name of the reference frame to be found- Returns:
int
the NAIF id of the reference frame
- pykep.utils.rotation_matrix(origin, destination, ep=2000-01-01T00:00:00.000000)#
Rotation matrix between frames at epoch.
- Args:
origin (
string
): The name of the origin reference frame.destination (
string
): The name of the destination reference frame.ep (
epoch
): Epoch. Defaults to pk.epoch(0).- Returns:
npumpy.ndarray
: The rotation matrix.
Encoding Utils#
- pykep.alpha2direct(alphas)#
Converts from alpha encoded to transfer times.
- pykep.direct2alpha(tofs)#
Converts from transfer times to alpha encoded.
- pykep.eta2direct(etas, max_tof)#
Converts from eta encoded to transfer times.
- pykep.direct2eta(tofs, max_tof)#
Converts from transfer times to eta encoded.
Miscellanea#
- pykep.utils.planet_to_keplerian(pla, when: epoch, mu=None)#
Transforms a planet to its Keplerian version
The
planet
returned will be Keplerian, with elements identical to the osculating elements at t0 of the input planet. Hence its ephemerides can be computed at any epoch, but will only be matching the original ones at t0.This utility is useful to extend the validity range of some
planet
’s ephemerides.