2
$\begingroup$

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):

$\endgroup$
0
1
$\begingroup$

After dozens of test, I found the way.

Payload to be sent over POST query:

{
  "kernels": [
     {
      "type": "KERNEL",
      "path": "pds/wgc/mk/latest_lsk_v0004.tm"
    },
    {
      "type": "KERNEL",
      "path": "pds/data/msl-m-spice-6-v1.0/mslsp_1000/extras/mk/msl_v25.tm"
    }


],
  "timeSystem": "UTC",
  "timeFormat": "CALENDAR",
     "intervals": [
       {
         "startTime": "2012-08-06T05:10:00",
         "endTime":   "2012-08-06T05:19:00"
       }
     ],
  "timeStep": 1,
  "timeStepUnits": "SECONDS",

  "calculationType": "STATE_VECTOR",

  "target" : "-76000",
  "targetType": "OBJECT",

  "observer": "MARS",
  "observerType": "OBJECT",

  "referenceFrame": "IAU_MARS",
  "frameLocus": "OBSERVER",
  "aberrationCorrection": "NONE",
  "stateRepresentation": "RECTANGULAR"
}

Please note that specified kernels are not real kernels but actually lists of kernels:

Contents of pds/wgc/mk/latest_lsk_v0004.tm ( https://naif.jpl.nasa.gov/pub/naif/pds/wgc/mk/latest_lsk_v0004.tm )

KPL/MK

   This meta-kernel lists the latest generic LSK file available at the time
   when this meta-kernel was created.

   \begindata

      PATH_VALUES       = (
                           '../kernels'
                          )
      PATH_SYMBOLS      = (
                           'DATA'
                          )

      KERNELS_TO_LOAD   = (
                           '$DATA/lsk/naif0012.tls'
                          )

   \begintext

 

Contents of pds/data/msl-m-spice-6-v1.0/mslsp_1000/extras/mk/msl_v25.tm ( https://naif.jpl.nasa.gov/pub/naif/pds/data/msl-m-spice-6-v1.0/mslsp_1000/extras/mk/msl_v25.tm ) (probably not all these kernels are necessary for EDL):

 \begindata
  PATH_VALUES     = ( './data' )
  PATH_SYMBOLS    = ( 'KERNELS' )
  KERNELS_TO_LOAD = (
                      '$KERNELS/lsk/naif0012.tls'
                      '$KERNELS/pck/pck00008.tpc'
                      '$KERNELS/sclk/msl_lmst_ops120808_v1.tsc'
                      '$KERNELS/sclk/msl_76_sclkscet_refit_s2.tsc'
                      '$KERNELS/fk/msl_v08.tf'

                      '$KERNELS/ik/msl_aux_v00.ti'
                      '$KERNELS/ik/msl_chrmi_20120731_c03.ti'
                      '$KERNELS/ik/msl_hbla_20120731_c03.ti'
                      '$KERNELS/ik/msl_hblb_20120731_c03.ti'
                      '$KERNELS/ik/msl_hbra_20120731_c03.ti'
                      '$KERNELS/ik/msl_hbrb_20120731_c03.ti'
                      '$KERNELS/ik/msl_hfla_20120731_c03.ti'
                      '$KERNELS/ik/msl_hflb_20120731_c03.ti'
                      '$KERNELS/ik/msl_hfra_20120731_c03.ti'
                      '$KERNELS/ik/msl_hfrb_20120731_c03.ti'
                      '$KERNELS/ik/msl_mahli_20120731_c02.ti'
                      '$KERNELS/ik/msl_mardi_20120731_c02.ti'
                      '$KERNELS/ik/msl_ml_20120731_c03.ti'
                      '$KERNELS/ik/msl_mr_20120731_c03.ti'
                      '$KERNELS/ik/msl_nla_20120731_c04.ti'
                      '$KERNELS/ik/msl_nlb_20130530_c05.ti'
                      '$KERNELS/ik/msl_nra_20120731_c04.ti'
                      '$KERNELS/ik/msl_nrb_20130530_c05.ti'
                      '$KERNELS/ik/msl_struct_v01.ti'

                      '$KERNELS/spk/msl_struct_v02.bsp'

                      '$KERNELS/spk/de425s.bsp'
                      '$KERNELS/spk/mar085s.bsp'

                      '$KERNELS/spk/msl_cruise_v1.bsp'

                      '$KERNELS/spk/msl_edl_v01.bsp'

                      '$KERNELS/spk/msl_ls_ops120808_iau2000_v1.bsp'
                      (...cut.... rover kernels for each sol ..... cut ...)

Put above payload into this page and click on SUBMIT CALCULATION. Once the results are ready, you will get a calculation id; click on GET RESULTS to download response.

The page works also offline as long as you add this line:

baseURL = "https://cors-anywhere.herokuapp.com/https://wgc2.jpl.nasa.gov:8443/webgeocalc/api/"; 

after this one:

var baseURL = ourLocation.substring(0, splicePoint) + "/api/"

How it works:

Call function performRequest(urlSuffix, payload, onComplete) a first time using performRequest("calculation/new", payloadText, showProgress) , which means showProgress() will be called once the response is received; preliminary response will look like (once calculation is complete):

{
  "status": "OK",
  "message": "The request was successful.",
  "calculationId": "7a304773-50f2-45c1-bb5a-bfd9fcbd063c",
  "result": {
    "phase": "COMPLETE",
    "expiresIn": 600
  }
}

You should check "phase" while it passes from "LOADING KERNELS" to "COMPLETE".

Once calculation is complete, the response will contain the identifier ("calculationId") to use to request the actual response with results, which will be available only for "expiresIn" seconds.

To request the calculation results, call again performRequest(urlSuffix, payload, onComplete) by performRequest("calculation/" + calculationID + "/results, null, showProgress)

In the final response, response.columns will be an array of the columns of your data.

== Additional notes ==

Kernel https://naif.jpl.nasa.gov/pub/naif/pds/data/msl-m-spice-6-v1.0/mslsp_1000/data/fk/msl_v08.tf contains the list of available reference frames for MSL; most important are:

  • MSL_LANDING_SITE -76900
  • MSL_SITE_1...399 -76501...-76899
  • MSL -76
  • MSL_ROVER -76000
  • MSL_SPACECRAFT -76010 (skycrane + rover + backshell + heatshield?)
  • MSL_CRUISE_STAGE -76020
  • MSL_DESCENT_STAGE -76030 (skycrane or skycrane + rover?)
  • MSL_ROVER_MECH -76040
  • MSL_CACS -76050 (MSL Cruise ACS (Attitude Control System?) frame)
  • MSL_DIMU_A -76031 (Descent Stage IMU)

Created a specific page to download EDL data:

http://win98.altervista.org/space/exploration/EDL/ (specifically http://win98.altervista.org/space/exploration/EDL/edl-retriever.html

)

$\endgroup$
2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.