Skip to content

Commit e1a3180

Browse files
#504 ShadeTool Improvements and Multi-missionize (#507)
* #504 ShadeTool - User settable AzElRange * #504 SPICE kernel scheduled downloads * #504 update shadetool css * #504 Update docs for SPICE conf
1 parent c47c2d8 commit e1a3180

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1000
-1065
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
/config/pre/toolConfigs.json
1818
/src/pre/tools.js
1919

20+
/spice/kernels/*
21+
!/spice/kernels/.gitkeep
22+
/Missions/spice-kernels-conf.json
23+
!/Missions/spice-kernels-conf.example.json
24+
2025
/build/*
2126
/data/*
2227
*__pycache__
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
{
2+
"body": {
3+
"description": "If the MMGIS ENV 'SPICE_SCHEDULED_KERNEL_DOWNLOAD=true', then at every other midnight, MMGIS will read /Missions/spice-kernels-conf.json and re/download all the specified kernels to /spice/kernels.'body' names and 'target' names must be valid NAIF SPICE names/ids. Meta-kernels (.tm) can also be set for download by using an object instead of a string (see example below).",
4+
"MARS": {
5+
"description": "MARS",
6+
"kernels": [
7+
"https://naif.jpl.nasa.gov/pub/naif/generic_kernels/lsk/naif0012.tls",
8+
"https://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck/pck00011.tpc",
9+
"https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/planets/de440.bsp",
10+
"https://naif.jpl.nasa.gov/pub/naif/MARS2020/kernels/spk/mar097s.bsp",
11+
"https://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck/mars_iau2000_v1.tpc"
12+
],
13+
"targets": {
14+
"MRO": {
15+
"description": "MRO - Mars Reconnaissance Orbiter",
16+
"kernels": [
17+
"https://naif.jpl.nasa.gov/pub/naif/MRO/kernels/spk/mro_psp.bsp"
18+
]
19+
},
20+
"MSL": {
21+
"description": "MSL - Mars Science Laboratory",
22+
"kernels": [
23+
"https://naif.jpl.nasa.gov/pub/naif/MSL/kernels/spk/msl_atls_ops120808_v1.bsp",
24+
"https://naif.jpl.nasa.gov/pub/naif/MSL/kernels/spk/msl_ls_ops120808_iau2000_v1.bsp",
25+
"https://naif.jpl.nasa.gov/pub/naif/MSL/kernels/sclk/MSL_76_SCLKSCET.00019.tsc",
26+
"https://naif.jpl.nasa.gov/pub/naif/MSL/kernels/sclk/msl_lmst_ops120808_v1.tsc",
27+
"https://naif.jpl.nasa.gov/pub/naif/MSL/kernels/fk/msl_v08.tf"
28+
]
29+
},
30+
"-202": {
31+
"description": "MVN - MAVEN - Mars Atmosphere and Volatile Evolution",
32+
"kernels": [
33+
"https://naif.jpl.nasa.gov/pub/naif/MAVEN/kernels/spk/maven_orb.bsp"
34+
]
35+
},
36+
"-53": {
37+
"description": "ODY - 2001 Mars Odyssey",
38+
"kernels": [
39+
"https://naif.jpl.nasa.gov/pub/naif/M01/kernels/spk/m01_map.bsp"
40+
]
41+
},
42+
"-143": {
43+
"description": "TGO - ExoMars Trace Gas Orbiter",
44+
"kernels": [
45+
{
46+
"url": "https://naif.jpl.nasa.gov/pub/naif/EXOMARS2016/kernels/mk/em16_ops.tm",
47+
"mkRoot": "https://naif.jpl.nasa.gov/pub/naif/EXOMARS2016/kernels",
48+
"mkRegex": ".*/spk/em16_tgo_fsp.*.bsp"
49+
}
50+
]
51+
}
52+
}
53+
},
54+
"MOON": {
55+
"description": "MOON",
56+
"kernels": [
57+
"https://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck/pck00011.tpc"
58+
],
59+
"targets": {
60+
"LRO": {
61+
"description": "LRO - Lunar Reconnaissance Orbiter",
62+
"kernels": [
63+
"https://naif.jpl.nasa.gov/pub/naif/pds/data/lro-l-spice-6-v1.0/lrosp_1000/data/lsk/naif0012.tls",
64+
"https://naif.jpl.nasa.gov/pub/naif/pds/data/lro-l-spice-6-v1.0/lrosp_1000/data/sclk/lro_clkcor_2023354_v00.tsc",
65+
"https://naif.jpl.nasa.gov/pub/naif/pds/data/lro-l-spice-6-v1.0/lrosp_1000/data/pck/pck00010.tpc",
66+
"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",
67+
"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",
68+
"https://naif.jpl.nasa.gov/pub/naif/pds/data/lro-l-spice-6-v1.0/lrosp_1000/data/fk/lro_frames_2012255_v02.tf",
69+
"https://naif.jpl.nasa.gov/pub/naif/pds/data/lro-l-spice-6-v1.0/lrosp_1000/data/fk/moon_assoc_me.tf",
70+
"https://naif.jpl.nasa.gov/pub/naif/pds/data/lro-l-spice-6-v1.0/lrosp_1000/data/fk/moon_080317.tf",
71+
"https://naif.jpl.nasa.gov/pub/naif/pds/data/lro-l-spice-6-v1.0/lrosp_1000/data/spk/de421.bsp",
72+
{
73+
"url": "https://naif.jpl.nasa.gov/pub/naif/pds/data/lro-l-spice-6-v1.0/lrosp_1000/extras/mk/lro_2023_v04.tm",
74+
"mkRoot": "https://naif.jpl.nasa.gov/pub/naif/pds/data/lro-l-spice-6-v1.0/lrosp_1000/data",
75+
"mkRegex": ".*/spk/lrorg.*.bsp"
76+
}
77+
]
78+
}
79+
}
80+
}
81+
}
82+
}

docs/pages/Configure/SPICE/SPICE.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
---
2+
layout: page
3+
title: SPICE
4+
permalink: /configure/spice
5+
parent: Configure
6+
nav_order: 3
7+
---
8+
9+
# SPICE
10+
11+
> SPICE (Spacecraft Planet Instrument C-matrix Events) is a NASA ancillary information system used to compute geometric information used in planning and analyzing science observations obtained from robotic spacecraft. It is also used in planning missions and conducting numerous engineering functions needed to carry out those missions.
12+
13+
[Link to NAIF SPICE](https://naif.jpl.nasa.gov/naif/)
14+
15+
MMGIS utilizes SPICE through [spiceypy](https://github.com/AndrewAnnex/SpiceyPy). Some of MMGIS' tools may need to be configured properly with regards to SPICE. The following tools require relevant SPICE kernels (mission-specific files that SPICE needs to perform certain computations and transformations) to be set:
16+
17+
- ShadeTool
18+
19+
## Configuring
20+
21+
MMGIS has a SPICE kernel download scheduler that, when configured, periodically downloads all the latest specified kernels (because they are regularly updated).
22+
23+
- To begin, set the ENV `SPICE_SCHEDULED_KERNEL_DOWNLOAD=true`.
24+
- Next there is a sample SPICE kernel configuration file under the `/Missions/` directory called `spice-kernels-conf.example.json`.
25+
- Copy `spice-kernels-conf.example.json` to `spice-kernels-conf.json` in the same directory.
26+
27+
### ENVs
28+
29+
#### `SPICE_SCHEDULED_KERNEL_DOWNLOAD=`
30+
31+
If true, then at every other midnight, MMGIS will read /Missions/spice-kernels-conf.json and re/download all the specified kernels. See /Missions/spice-kernels-conf.example.json | boolean | default `false`
32+
33+
#### `SPICE_SCHEDULED_KERNEL_DOWNLOAD_ON_START=`
34+
35+
If true, then also triggers the kernel download when MMGIS starts | boolean | default `false`
36+
37+
#### `SPICE_SCHEDULED_KERNEL_CRON_EXPR=`
38+
39+
A cron schedule expression for use in the [node-schedule npm library](https://www.npmjs.com/package/node-schedule) | string | default `"0 0 */2 * *"` (every other day)
40+
41+
### spice-kernels-conf.json
42+
43+
- If the MMGIS ENV 'SPICE_SCHEDULED_KERNEL_DOWNLOAD=true' MMGIS will read /Missions/spice-kernels-conf.json and re/download all the specified kernels to `/spice/kernels`.
44+
45+
- 'body' names and 'targets' names must be valid NAIF SPICE names/ids. Meta-kernels (.tm) can also be set for download by using an object instead of a string.
46+
47+
The schema works as follows:
48+
49+
```json
50+
{
51+
"body": {
52+
"{NAIF_BODY_NAME_OR_ID}": {
53+
"desciption": "If a function uses this BODY, it will furnsh() all these direct kernels.",
54+
"kernels": [
55+
"Full URL to kernel to download",
56+
"Or an object that indicates a meta-kernel (a kernel that lists out other kernels to download):",
57+
{
58+
"url": "Full URL to a meta-kernel to download (file extension .tm)",
59+
"mkRoot": "Root path to replace the meta-kernel's '$KERNELS' prefixes with.",
60+
"mkRegex": "A JavaScript regular expression to filter down which meta-kernel kernels to download. For instance '.*/spk/.*.bsp'"
61+
}
62+
],
63+
"targets": {
64+
"{NAIF_TARGET_NAME_OR_ID}": {
65+
"description": "If a function uses this BODY and TARGET, it will also furnsh() all these kernels.",
66+
"kernels": [
67+
"Full URL to kernel to download",
68+
"Or an object that indicates a meta-kernel (a kernel that lists out other kernels to download):",
69+
{
70+
"url": "Full URL to a meta-kernel to download (file extension .tm)",
71+
"mkRoot": "Root path to replace the meta-kernel's '$KERNELS' prefixes with.",
72+
"mkRegex": "A JavaScript regular expression to filter down which meta-kernel kernels to download. For instance '.*/spk/.*.bsp'"
73+
}
74+
]
75+
}
76+
}
77+
}
78+
}
79+
}
80+
```

docs/pages/Setup/ENVs/ENVs.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,3 +139,15 @@ If true, MMGIS will not auto-login returning users. This can be useful when logi
139139
#### `GENERATE_SOURCEMAP=`
140140

141141
If true at build-time, JavaScript source maps will also be built | boolean | default `false`
142+
143+
#### `SPICE_SCHEDULED_KERNEL_DOWNLOAD=`
144+
145+
If true, then at every other midnight, MMGIS will read /Missions/spice-kernels-conf.json and re/download all the specified kernels. See /Missions/spice-kernels-conf.example.json | boolean | default `false`
146+
147+
#### `SPICE_SCHEDULED_KERNEL_DOWNLOAD_ON_START=`
148+
149+
If true, then also triggers the kernel download when MMGIS starts | boolean | default `false`
150+
151+
#### `SPICE_SCHEDULED_KERNEL_CRON_EXPR=`
152+
153+
A cron schedule expression for use in the [node-schedule npm library](https://www.npmjs.com/package/node-schedule) | string | default `"0 0 */2 * *"` (every other day)

package-lock.json

Lines changed: 34 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
"memorystore": "^1.6.2",
8989
"nipplejs": "^0.8.5",
9090
"node-fetch": "^2.6.1",
91-
"node-schedule": "^1.3.2",
91+
"node-schedule": "^2.1.1",
9292
"pg-promise": "^10.6.1",
9393
"png-js": "^1.0.0",
9494
"proj4": "^2.8.1",

private/api/BandsToProfile.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ def latLonsToPixel(latLonPairs):
117117
type = str(sys.argv[4]) # xyorll
118118
bands = ast.literal_eval(unquote(sys.argv[5])) # bands
119119

120+
120121
latLonPair = [[lat, lon]]
121122

122123
# Open the image

0 commit comments

Comments
 (0)