Skip to content

Commit

Permalink
Fix Chronice overflow, update spice-kernel-conf-example and fix TimeU…
Browse files Browse the repository at this point in the history
…I startInPointMode
  • Loading branch information
tariqksoliman committed Apr 1, 2024
1 parent ab8bcea commit eb4787d
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 12 deletions.
14 changes: 7 additions & 7 deletions Missions/spice-kernels-conf.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,21 @@
"MOON": {
"description": "MOON",
"kernels": [
"https://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck/pck00011.tpc"
"https://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck/pck00011.tpc",
"https://naif.jpl.nasa.gov/pub/naif/pds/data/lro-l-spice-6-v1.0/lrosp_1000/data/fk/moon_assoc_me.tf",
"https://naif.jpl.nasa.gov/pub/naif/pds/data/lro-l-spice-6-v1.0/lrosp_1000/data/fk/moon_080317.tf",
"https://naif.jpl.nasa.gov/pub/naif/pds/data/lro-l-spice-6-v1.0/lrosp_1000/data/spk/de421.bsp",
"https://naif.jpl.nasa.gov/pub/naif/pds/data/lro-l-spice-6-v1.0/lrosp_1000/data/pck/pck00010.tpc",
"https://naif.jpl.nasa.gov/pub/naif/pds/data/lro-l-spice-6-v1.0/lrosp_1000/data/pck/moon_pa_de421_1900_2050.bpc",
"https://naif.jpl.nasa.gov/pub/naif/pds/data/lro-l-spice-6-v1.0/lrosp_1000/data/lsk/naif0012.tls"
],
"targets": {
"LRO": {
"description": "LRO - Lunar Reconnaissance Orbiter",
"kernels": [
"https://naif.jpl.nasa.gov/pub/naif/pds/data/lro-l-spice-6-v1.0/lrosp_1000/data/lsk/naif0012.tls",
"https://naif.jpl.nasa.gov/pub/naif/pds/data/lro-l-spice-6-v1.0/lrosp_1000/data/sclk/lro_clkcor_2023354_v00.tsc",
"https://naif.jpl.nasa.gov/pub/naif/pds/data/lro-l-spice-6-v1.0/lrosp_1000/data/pck/pck00010.tpc",
"https://naif.jpl.nasa.gov/pub/naif/pds/data/lro-l-spice-6-v1.0/lrosp_1000/data/pck/moon_pa_de421_1900_2050.bpc",
"https://naif.jpl.nasa.gov/pub/naif/pds/data/lro-l-spice-6-v1.0/lrosp_1000/data/fk/lro_dlre_frames_2010132_v04.tf",
"https://naif.jpl.nasa.gov/pub/naif/pds/data/lro-l-spice-6-v1.0/lrosp_1000/data/fk/lro_frames_2012255_v02.tf",
"https://naif.jpl.nasa.gov/pub/naif/pds/data/lro-l-spice-6-v1.0/lrosp_1000/data/fk/moon_assoc_me.tf",
"https://naif.jpl.nasa.gov/pub/naif/pds/data/lro-l-spice-6-v1.0/lrosp_1000/data/fk/moon_080317.tf",
"https://naif.jpl.nasa.gov/pub/naif/pds/data/lro-l-spice-6-v1.0/lrosp_1000/data/spk/de421.bsp",
{
"url": "https://naif.jpl.nasa.gov/pub/naif/pds/data/lro-l-spice-6-v1.0/lrosp_1000/extras/mk/lro_2023_v04.tm",
"mkRoot": "https://naif.jpl.nasa.gov/pub/naif/pds/data/lro-l-spice-6-v1.0/lrosp_1000/data",
Expand Down
21 changes: 19 additions & 2 deletions private/api/chronice.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,25 @@ def chronice(body, target, fromFormat, time):
def sclk2lmst(sclk, target):
if target == 'msl':
s = sclk.split('/')[1].split(':')
seconds = str(round(float(s[3] + '.' + s[4]))).zfill(2)
return f'SOL-{s[0]}M{s[1]}:{s[2]}:{seconds}'
sol = int(s[0])
hour = int(s[1])
minute = int(s[2])
seconds = round(float(s[3] + '.' + s[4]))
if seconds == 60:
minute = minute + 1
seconds = 0
if minute == 60:
hour = hour + 1
minute = 0
if hour == 24:
sol = sol + 1
hour = 0

sol = str(sol).zfill(5)
hour = str(hour).zfill(2)
minute = str(minute).zfill(2)
seconds = str(seconds).zfill(2)
return f'SOL-{sol}M{hour}:{minute}:{seconds}'
def lmst2sclk(lmst, target, partition = 1):
if target == 'msl':
s = lmst.replace(' ', ':').replace('-', ':').replace('M', ':').split(':')
Expand Down
7 changes: 4 additions & 3 deletions src/essence/Ancillary/TimeUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,10 @@ const TimeUI = {
theme: 'blue',
})

if (L_.configData.time?.startInPointMode == true)
if (L_.configData.time?.startInPointMode == true) {
TimeUI.modeIndex = TimeUI.modes.indexOf('Point')
startingModeIndex = TimeUI.modeIndex
}
// Mode dropdown
$('#mmgisTimeUIModeDropdown').html(
Dropy.construct(TimeUI.modes, 'Mode', startingModeIndex, {
Expand Down Expand Up @@ -461,9 +463,8 @@ const TimeUI = {

if (L_.configData.time?.startInPointMode == true)
TimeUI.changeMode(TimeUI.modes.indexOf('Point'))

// Set modeIndex to 1/Point if a deeplink had an endtime but no starttime
if (TimeUI.modeIndex != startingModeIndex)
else if (TimeUI.modeIndex != startingModeIndex)
TimeUI.changeMode(startingModeIndex)
},
fina() {
Expand Down

0 comments on commit eb4787d

Please sign in to comment.