Function lupnt::spk_extract

Function Documentation

segment_t *lupnt::spk_extract(char const *path, long *segs)

Extract all Chebyshev-position-only (Type 2) segments from an SPK file into a heap-allocated array of segment_t, without requiring the SPICE library afterwards.

Called once by spice::LoadSpiceKernel on de440.bsp (planetary/lunar ephemeris), producing the segment table that spice::GetBodyPosVelBase searches (by target/center body codes) and evaluates via cheby_posvel_ad for every spice::GetBodyPosVel call.

Parameters:
  • path – SPK (.bsp) file path

  • segs – Output: number of segments in the returned array

Returns:

Heap-allocated array of *segs segment descriptors, or nullptr on error (e.g. not a valid SPK / no Chebyshev position-only segments)