I found a "javascript gateway" to NASA SPICE data, the "webgeocalc" web api:
https://wgc2.jpl.nasa.gov:8443/webgeocalc/example/perform-calculation.html
It works both online and offline (but offline I have to use a workaround for CORS policy), but I can't get data for Mars Science Laboratory EDL trajectory.
For one of many attempts I used this input:
{
"kernels": [
{
"type": "KERNEL",
"path": "pds/wgc/kernels/lsk/naif0012.tls"
},
{
"type": "KERNEL",
"path": "pds/wgc/kernels/spk/de430.bsp"
},
{
"type": "KERNEL",
"path": "/MSL/kernels/sclk/MSL_76_SCLKSCET.00017.tsc"
},
{
"type": "KERNEL",
"path": "/MSL/kernels/sclk/msl_lmst_ops120808_v1.tsc"
},
{
"type": "KERNEL",
"path": "/MSL/kernels/pck/pck00008.tpc"
},
{
"type": "KERNEL",
"path": "/MSL/kernels/spk/msl_cruise.bsp"
},
{
"type": "KERNEL",
"path": "/MSL/kernels/spk/msl_edl_v01.bsp"
},
{
"type": "KERNEL",
"path": "/MSL/kernels/spk/msl_ls_ops120808_iau2000_v1.bsp"
},
{
"type": "KERNEL",
"path": "/MSL/kernels/spk/msl_atls_ops120808_v1.bsp"
},
{
"type": "KERNEL",
"path": "/MSL/kernels/fk/msl_v08.tf"
},
{
"type": "KERNEL",
"path": "/MSL/kernels/spk/mar085s.bsp"
}
],
"timeSystem": "UTC",
"timeFormat": "CALENDAR",
"times": [
"2012-08-06T05:00:00.000"
],
"timeStep": 1,
"timeStepUnits": "SECONDS",
"calculationType": "STATE_VECTOR",
"targetType": "FIXED_POINT",
"targetLocation": {
"centerBody": "-76030",
"referenceFrame": "MSL_TOPO",
"coordinateRepresentation": "RECTANGULAR",
"x": 0,
"y": 0,
"z": 248.3
},
"observerType": "OBJECT",
"observer": "MARS",
"referenceFrame": "MSL_TOPO",
"frameLocus": "OBSERVER",
"aberrationCorrection": "NONE",
"stateRepresentation": "RECTANGULAR"
}
But I am getting this error ("Insufficient ephemeris data has been loaded"):
{
"status": "ERROR",
"message": "The request has failed.",
"calculationId": "cbcab756-f854-41d1-95e2-077b840155ec",
"error": {
"shortDescription": "CSPICE_N0066: CSPICE.spkcpt: SPICE(SPKINSUFFDATA): [spkcpt_c --> SPKCPT --> SPKCVT --> ZZSPKFZT --> SPKGEO] Insufficient ephemeris data has been loaded to compute the state of -76030 (MSL_DESCENT_STAGE) relative to 499 (MARS) at the ephemeris epoch 2012 AUG 01 05:01:07.183."
}
}
This kernel contains all reference frames available for MSL:
https://naif.jpl.nasa.gov/pub/naif/MSL/kernels/fk/msl_v08.tf
For example:
Landing site and sites:
-----------------------
MSL_LANDING_SITE -76900
MSL_SITE_1...399 -76501...-76899
Cruise and descent stages and the rover:
----------------------------------------
MSL -76
MSL_ROVER -76000
MSL_SPACECRAFT -76010
MSL_CRUISE_STAGE -76020
MSL_DESCENT_STAGE -76030
MSL_ROVER_MECH -76040
MSL_CACS -76050
MSL_DIMU_A -76031
Data should be available for specified date, as NASA Horizons is able to provide them: http://win98.altervista.org/space/exploration/3d/space-explorer-tracker.html?orbiter=-76&body=@499&start=2012-08-06%2005:10:04&stop=2012-08-06%2005:19:00&step=1m
I included the kernels listed in this example from Timecraft.js library, but maybe I am still missing some ones:
https://github.com/NASA-AMMOS/timecraftjs/blob/master/example/index.js
Kernels paths (webgeocalc interface vs NASA NAIF server vs webgeocal server):
- "MSL/" --> https://naif.jpl.nasa.gov/pub/naif/MSL/ --> /group/naif/critical/naifweb/pub/naif/MSL
- "pds/wgc/kernels/" --> https://naif.jpl.nasa.gov/pub/naif/generic_kernels/ --> /group/naif/critical/naifweb/pub/naif/pds/wgc/kernels/