Bagaimana cara mengambil lintasan MSL EDL menggunakan Javascript dan webgeocalc API?
Saya menemukan " gerbang javascript" ke data SPICE NASA , api web "webgeocalc":
https://wgc2.jpl.nasa.gov:8443/webgeocalc/example/perform-calculation.html
Ini berfungsi baik online maupun offline (tetapi offline saya harus menggunakan solusi untuk kebijakan CORS ), tetapi saya tidak bisa mendapatkan data untuk lintasan EDL Laboratorium Sains Mars.
Untuk salah satu dari banyak upaya saya menggunakan input ini:
{
"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"
}
Tetapi saya mendapatkan kesalahan ini ("Data ephemeris tidak cukup telah dimuat"):
{
"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."
}
}
Kernel ini berisi semua kerangka referensi yang tersedia untuk MSL:
https://naif.jpl.nasa.gov/pub/naif/MSL/kernels/fk/msl_v08.tf
Sebagai contoh:
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 harus tersedia untuk tanggal yang ditentukan, karena NASA Horizons dapat menyediakannya: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
Saya menyertakan kernel yang terdaftar dalam contoh ini dari perpustakaan Timecraft.js, tetapi mungkin saya masih melewatkan beberapa:
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/
Jawaban
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
)