Skip to content
PL1

Compute distance on target without an explicit frame

In some cases, a target body can be defined without a FRAME_<ID>_NAME nor a valid spice.cidfrm(<ID>). In theses cases, it is not possible to compute the position of the observer in the target frame (as expected), but it is possible compute it's position in the observer frame.

>>> tour = TourConfig(mk='plan', spacecraft='Juice', target='3I/ATLAS')
>>> traj = tour['2025-09-01':'2025-11-30':'1 day']

>>> traj.dist
KeyError: '`FRAME_1004083_NAME` was not found in the kernel pool.'

In theses cases it should be possible to compute the relative distance between the two body without raising a KeyError.

One way to work around this issue is to use traj.distance_to() method with the target name:

>>> traj.distance_to('3I/ATLAS')
[4.83236569e+08, ...]

Related issue: #85 (to support trajectory without observer)

Edited by benoit seignovert