Skip to content

Commit

Permalink
#504 ShadeTool Improvements and Multi-missionize (#507)
Browse files Browse the repository at this point in the history
* #504 ShadeTool - User settable AzElRange

* #504 SPICE kernel scheduled downloads

* #504 update shadetool css

* #504 Update docs for SPICE conf
  • Loading branch information
tariqksoliman authored Mar 7, 2024
1 parent c47c2d8 commit e1a3180
Show file tree
Hide file tree
Showing 42 changed files with 1,000 additions and 1,065 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
/config/pre/toolConfigs.json
/src/pre/tools.js

/spice/kernels/*
!/spice/kernels/.gitkeep
/Missions/spice-kernels-conf.json
!/Missions/spice-kernels-conf.example.json

/build/*
/data/*
*__pycache__
Expand Down
82 changes: 82 additions & 0 deletions Missions/spice-kernels-conf.example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"body": {
"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).",
"MARS": {
"description": "MARS",
"kernels": [
"https://naif.jpl.nasa.gov/pub/naif/generic_kernels/lsk/naif0012.tls",
"https://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck/pck00011.tpc",
"https://naif.jpl.nasa.gov/pub/naif/generic_kernels/spk/planets/de440.bsp",
"https://naif.jpl.nasa.gov/pub/naif/MARS2020/kernels/spk/mar097s.bsp",
"https://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck/mars_iau2000_v1.tpc"
],
"targets": {
"MRO": {
"description": "MRO - Mars Reconnaissance Orbiter",
"kernels": [
"https://naif.jpl.nasa.gov/pub/naif/MRO/kernels/spk/mro_psp.bsp"
]
},
"MSL": {
"description": "MSL - Mars Science Laboratory",
"kernels": [
"https://naif.jpl.nasa.gov/pub/naif/MSL/kernels/spk/msl_atls_ops120808_v1.bsp",
"https://naif.jpl.nasa.gov/pub/naif/MSL/kernels/spk/msl_ls_ops120808_iau2000_v1.bsp",
"https://naif.jpl.nasa.gov/pub/naif/MSL/kernels/sclk/MSL_76_SCLKSCET.00019.tsc",
"https://naif.jpl.nasa.gov/pub/naif/MSL/kernels/sclk/msl_lmst_ops120808_v1.tsc",
"https://naif.jpl.nasa.gov/pub/naif/MSL/kernels/fk/msl_v08.tf"
]
},
"-202": {
"description": "MVN - MAVEN - Mars Atmosphere and Volatile Evolution",
"kernels": [
"https://naif.jpl.nasa.gov/pub/naif/MAVEN/kernels/spk/maven_orb.bsp"
]
},
"-53": {
"description": "ODY - 2001 Mars Odyssey",
"kernels": [
"https://naif.jpl.nasa.gov/pub/naif/M01/kernels/spk/m01_map.bsp"
]
},
"-143": {
"description": "TGO - ExoMars Trace Gas Orbiter",
"kernels": [
{
"url": "https://naif.jpl.nasa.gov/pub/naif/EXOMARS2016/kernels/mk/em16_ops.tm",
"mkRoot": "https://naif.jpl.nasa.gov/pub/naif/EXOMARS2016/kernels",
"mkRegex": ".*/spk/em16_tgo_fsp.*.bsp"
}
]
}
}
},
"MOON": {
"description": "MOON",
"kernels": [
"https://naif.jpl.nasa.gov/pub/naif/generic_kernels/pck/pck00011.tpc"
],
"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",
"mkRegex": ".*/spk/lrorg.*.bsp"
}
]
}
}
}
}
}
80 changes: 80 additions & 0 deletions docs/pages/Configure/SPICE/SPICE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
---
layout: page
title: SPICE
permalink: /configure/spice
parent: Configure
nav_order: 3
---

# SPICE

> 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.
[Link to NAIF SPICE](https://naif.jpl.nasa.gov/naif/)

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:

- ShadeTool

## Configuring

MMGIS has a SPICE kernel download scheduler that, when configured, periodically downloads all the latest specified kernels (because they are regularly updated).

- To begin, set the ENV `SPICE_SCHEDULED_KERNEL_DOWNLOAD=true`.
- Next there is a sample SPICE kernel configuration file under the `/Missions/` directory called `spice-kernels-conf.example.json`.
- Copy `spice-kernels-conf.example.json` to `spice-kernels-conf.json` in the same directory.

### ENVs

#### `SPICE_SCHEDULED_KERNEL_DOWNLOAD=`

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`

#### `SPICE_SCHEDULED_KERNEL_DOWNLOAD_ON_START=`

If true, then also triggers the kernel download when MMGIS starts | boolean | default `false`

#### `SPICE_SCHEDULED_KERNEL_CRON_EXPR=`

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)

### spice-kernels-conf.json

- 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`.

- '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.

The schema works as follows:

```json
{
"body": {
"{NAIF_BODY_NAME_OR_ID}": {
"desciption": "If a function uses this BODY, it will furnsh() all these direct kernels.",
"kernels": [
"Full URL to kernel to download",
"Or an object that indicates a meta-kernel (a kernel that lists out other kernels to download):",
{
"url": "Full URL to a meta-kernel to download (file extension .tm)",
"mkRoot": "Root path to replace the meta-kernel's '$KERNELS' prefixes with.",
"mkRegex": "A JavaScript regular expression to filter down which meta-kernel kernels to download. For instance '.*/spk/.*.bsp'"
}
],
"targets": {
"{NAIF_TARGET_NAME_OR_ID}": {
"description": "If a function uses this BODY and TARGET, it will also furnsh() all these kernels.",
"kernels": [
"Full URL to kernel to download",
"Or an object that indicates a meta-kernel (a kernel that lists out other kernels to download):",
{
"url": "Full URL to a meta-kernel to download (file extension .tm)",
"mkRoot": "Root path to replace the meta-kernel's '$KERNELS' prefixes with.",
"mkRegex": "A JavaScript regular expression to filter down which meta-kernel kernels to download. For instance '.*/spk/.*.bsp'"
}
]
}
}
}
}
}
```
12 changes: 12 additions & 0 deletions docs/pages/Setup/ENVs/ENVs.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,15 @@ If true, MMGIS will not auto-login returning users. This can be useful when logi
#### `GENERATE_SOURCEMAP=`

If true at build-time, JavaScript source maps will also be built | boolean | default `false`

#### `SPICE_SCHEDULED_KERNEL_DOWNLOAD=`

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`

#### `SPICE_SCHEDULED_KERNEL_DOWNLOAD_ON_START=`

If true, then also triggers the kernel download when MMGIS starts | boolean | default `false`

#### `SPICE_SCHEDULED_KERNEL_CRON_EXPR=`

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)
78 changes: 34 additions & 44 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"memorystore": "^1.6.2",
"nipplejs": "^0.8.5",
"node-fetch": "^2.6.1",
"node-schedule": "^1.3.2",
"node-schedule": "^2.1.1",
"pg-promise": "^10.6.1",
"png-js": "^1.0.0",
"proj4": "^2.8.1",
Expand Down
1 change: 1 addition & 0 deletions private/api/BandsToProfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ def latLonsToPixel(latLonPairs):
type = str(sys.argv[4]) # xyorll
bands = ast.literal_eval(unquote(sys.argv[5])) # bands


latLonPair = [[lat, lon]]

# Open the image
Expand Down
Loading

0 comments on commit e1a3180

Please sign in to comment.