SPK2OEM is one of many of SPICE tools available here:
https://naif.jpl.nasa.gov/naif/utilities_PC_Windows_32bit.html
I am trying to extract ephemeris from one of the SPK files listed here:
https://naif.jpl.nasa.gov/pub/naif/ORX/kernels/spk/
So I also downloaded a leap seconds file (LSK) from here as requested, and created an input file as requested, adapting an example for MRO taken from documentation:
\begindata
OBJECT_NAME = 'MRO'
INPUT_SPK_FILE = 'spk_psp_rec0605_0601_1388_p-v1.bsp'
OUTPUT_OEM_FILE = 'spk_psp_rec0605_0601_1388_p-v1.oem'
LEAPSECONDS_FILE = '/kernels/gen/lsk/leapseconds.ker'
INTERPOLATION_METHOD = 'LAGRANGE'
STRING_MAPPING = ( 'J2000', 'EME2000',
'<object_id>', '074' )
\begintext
But I keep getting several different errors rgardless of how I change&tune my input parameters.
So I tried the above setup file with an MRO SPK/LSK couple; I didn't get any error... but the output file contains only comments, no ephemeris data!
Can anybody help figuring out how to get human readable ephemeris for this SPK file, for dates 2020-10-20 to 2020-10-21 ? I'd need (x,y,z) coordinates of Osiris Rex spacecraft with respect to a given point on the surface of Bennu asteroid.
https://naif.jpl.nasa.gov/pub/naif/ORX/kernels/spk/orx_201020_201110_201021_od293-N_v1.bsp
Does it exist any other CLI tool than SPK2OEM?
Please note that SPK2OEM is just the best I was able to find, it's not the mandatory solution; my preferred solution would be a javascript library allowing me to extract/calculate such data from the SPICE kernel. Python is not an option as I should learn it quite from scratch, unlike javascript.
I found this javascript library which looks very promising:
https://github.com/NASA-AMMOS/timecraftjs
Potentially it could be extended to implement spkezr_c function, which does extacly what I need.
From documentation:
Procedure
void spkezr_c ( ConstSpiceChar *targ,
SpiceDouble et,
ConstSpiceChar *ref,
ConstSpiceChar *abcorr,
ConstSpiceChar *obs,
SpiceDouble starg[6],
SpiceDouble *lt )
Abstract
Return the state (position and velocity) of a target body
relative to an observing body, optionally corrected for light
time (planetary aberration) and stellar aberration.
But I have no idea about how to convert such function into javascript.
spk2oem
is the best fit ? $\endgroup$