You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Let get_spice_cmatrix() answer in a SPICE frame other than the instrument's #216
Let get_spice_cmatrix express the observation's pointing in a SPICE frame other than the instrument's, for example get_spice_cmatrix(frame='CASSINI_SC_COORD'), returning the J2000 rotation into that frame rather than into spice_frame_name.
The conversion is pxform(other_frame, spice_frame_name, t)^T . get_spice_cmatrix(time=t).
A matching set_spice_cmatrix(matrix, frame=...) would close the pair.
Why
The frame a C-kernel tabulates is usually not the instrument frame. CASSINI_SC_COORD is 119.94 degrees from CASSINI_ISS_NAC and NH_SPACECRAFT is 120.31 degrees from NH_LORRI; only Galileo SSI and the Voyager NACs coincide with the object their kernels describe. So a caller writing a corrected kernel has to convert, and a caller re-pointing an observation must not.
Both are legitimate, and which one a caller wants is a property of the call rather than of the API. Offering the frame as an argument answers the question per call: the instrument frame stays the default, because that is where a navigated offset is measured and where a round trip through the FOV has to close, and a kernel writer asks for the object frame explicitly.
Effect
Small for us -- it replaces about five lines in our C-kernel segment writer, which currently computes F = pxform(ck_frame, camera_frame, midtime) and applies F^-1 itself. The value is mostly that it makes the choice explicit at the call site instead of leaving each consumer to discover that the distinction exists.
Activity