-
Notifications
You must be signed in to change notification settings - Fork 10
moved ale quickstart from ale docs to here #129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
0b1796a
137c236
5c14fa3
6362a3f
d9284a0
c56aad0
5130b03
5c01a66
03f8768
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,180 @@ | ||
# ALE SPICE Data Setup & Driver Types | ||
|
||
<div class="grid cards" markdown> | ||
|
||
- [:octicons-arrow-left-24: ALE - Getting Started](../../getting-started/using-ale/index.md) | ||
|
||
- [:octicons-arrow-right-24: ALE on the Command Line](../../getting-started/using-ale/isd-generate.md) | ||
|
||
</div> | ||
|
||
## To use ALE, you will need: | ||
|
||
- [ ] An [ALE Installation](https://github.com/DOI-USGS/ale/blob/main/README.md). | ||
- [ ] An image ([Locating Image Data](../../getting-started/using-isis-first-steps/locating-and-ingesting-image-data.md)) | ||
formatted according to your driver type. | ||
- [ ] ***SPICE Data according to your driver type***. | ||
|
||
## ALE Driver Types and their requirements | ||
|
||
=== "IsisLabel + NaifSpice" | ||
|
||
For **NaifSpice + IsisLabel** Drivers, you will need: | ||
|
||
- An image [imported](../../getting-started/using-isis-first-steps/locating-and-ingesting-image-data.md#introduction-to-importing) into [ISIS](../../how-to-guides/environment-setup-and-maintenance/installing-isis-via-anaconda.md) cube (.cub) format with a [`-2isis` app](https://isis.astrogeology.usgs.gov/Application/index.html). | ||
|
||
- NAIF SPICE Kernels (See [Setting up NAIF Data](#setting-up-naif-data) below). | ||
|
||
|
||
=== "IsisLabel + IsisSpice" | ||
|
||
For **IsisLabel + IsisSpice** Drivers, you will need: | ||
|
||
- An image [imported](../../getting-started/using-isis-first-steps/locating-and-ingesting-image-data.md#introduction-to-importing) into [ISIS](../../how-to-guides/environment-setup-and-maintenance/installing-isis-via-anaconda.md) cube (.cub) format with a [`-2isis` app](https://isis.astrogeology.usgs.gov/Application/index.html), | ||
|
||
- AND the resulting ISIS cube must be [`spiceinit`ed](https://isis.astrogeology.usgs.gov/Application/presentation/Tabbed/spiceinit/spiceinit.html) with `spiceinit from=<your.cub>`. | ||
|
||
|
||
=== "Pds3Label + NaifSpice" | ||
|
||
For **NaifSpice + Pds3Label** Drivers, you will need: | ||
|
||
- An image in PDS3 format | ||
|
||
- NAIF SPICE Kernels (See [Setting up NAIF Data](#setting-up-naif-data) below). | ||
|
||
----- | ||
|
||
??? info "How Each Driver Mixin Works - *NaifSpice, IsisSpice, IsisLabel, and Pds3Label*" | ||
|
||
**NaifSpice** drivers use the NAIF Kernels to look up spice data to an image, while **IsisSpice** drivers depend on an ISIS cube already having spice data attached with `spiceinit`. | ||
|
||
**IsisLabel** drivers use images in the ISIS cube (.cub) format, while **Pds3Label** drivers use images in the PDS format. | ||
|
||
There are 3 possible combinations of these mixins: `IsisLabel + NaifSpice`, `IsisLabel + IsisSpice`, and `Pds3Label + NaifSpice`. | ||
|
||
**NaifSpice + IsisLabel** is the most commonly used driver type, but you can check the ALE driver to find out if IsisLabel + IsisSpice or Pds3Label + NaifSpice drivers are available instead or in addition: | ||
|
||
1. Look at the [drivers in the ALE repository](https://github.com/DOI-USGS/ale/tree/main/ale/drivers). | ||
1. Click on the drivers for the spacecraft that captured your image. | ||
1. Find the class for your sensor, and look for NaifSpice, IsisSpice, IsisLabel, or Pds3Label next to the class name. | ||
|
||
There may be a class for both NaifSpice and IsisSpice; in that case you can use either, or use the `-n` or `-i` argument to specify which one to use. You might use `-i` for IsisSpice if you want to avoid re-`spiceinit`ing a .cub. | ||
|
||
By default, ALE will run through different drivers until either it finds the first one that works (at which point it will use that driver and complete its run), or all drivers fail. | ||
|
||
## Setting Up NAIF Data | ||
|
||
For use of NAIF Data with ISIS, see the [ISIS Data Area](../../how-to-guides/environment-setup-and-maintenance/isis-data-area.md). For use of NAIF data with ALE, continue below. | ||
|
||
### Downloading NAIF SPICE Data with wget | ||
|
||
!!! warning "" | ||
|
||
[[NAIF SPICE Data Home](https://naif.jpl.nasa.gov/naif/data.html)] | ||
[[Getting Spice Kernels from the NAIF Server](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/Tutorials/pdf/individual_docs/34_naif_server.pdf)] | ||
|
||
If you have enough space, NAIF recommends downloading the entire dataset for your spacecraft, detailed below. | ||
Otherwise, you can try subsetting the data as detailed in the [NAIF Server tutorial](https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/Tutorials/pdf/individual_docs/34_naif_server.pdf). | ||
You will need `wget`, a common download utility. | ||
|
||
Let's download the Clementine archive as a test. | ||
|
||
1. Find your mission on the [PDS SPICE Archives](https://naif.jpl.nasa.gov/naif/data_archived.html) and copy the **Archive Link**. | ||
|
||
- The url for the Clementine archive is: | ||
`https://naif.jpl.nasa.gov/pub/naif/pds/data/clem1-l-spice-6-v1.0/clsp_1000` | ||
|
||
1. `cd` into you spice folder, the folder you have or will set as `$ALESPICEROOT`. | ||
|
||
1. Piece together the `wget` command. | ||
1. Starting with this base command... (Don't run it yet!) | ||
`wget -m -nH --cut-dirs=5 -R 'index.html*'` | ||
|
||
1. add the url... | ||
`-nv https://naif.jpl.nasa.gov/pub/naif/pds/data/clem1-l-spice-6-v1.0/` | ||
|
||
1. then filter by the directory path (last half of url)... | ||
`-I pub/naif/pds/data/clem1-l-spice-6-v1.0/` | ||
|
||
1. and download into this folder (just the folder at the end of the url). | ||
`-P clem1-l-spice-6-v1.0/` | ||
|
||
1. Run the complete wget command: | ||
|
||
```sh | ||
wget -m -nH --cut-dirs=5 -R 'index.html*' -nv https://naif.jpl.nasa.gov/pub/naif/pds/data/clem1-l-spice-6-v1.0/clsp_1000 -I pub/naif/pds/data/clem1-l-spice-6-v1.0/clsp_1000 -P clem1-l-spice-6-v1.0/ | ||
``` | ||
|
||
----- | ||
*The Mars Reconnaissansce Orbiter (MRO) archive, which corresponds to the B10_013341_1010_XN_79S172W | ||
used in the related tutorials, is 340 GB. A subset of SPICE data is provided in the tutorials, but if you will be | ||
working with more MRO images, and you have the space, you can try downloading the MRO Spice data.* | ||
|
||
### Setting $ALESPICEROOT | ||
|
||
!!! warning "" | ||
|
||
When you are using a NaifSpice Driver, ALE looks under the `$ALESPICEROOT` directory for SPICE Kernels. | ||
You can echo it to see if it is set. | ||
|
||
```sh | ||
echo $ALESPICEROOT | ||
``` | ||
|
||
To work with MRO images for example, you might download the MRO NAIF SPICE Kernels to a data drive. | ||
If your directory structure looks like `/Volumes/data/spice-data/mro-m-spice-6-v1.0/mrosp_1000`, | ||
then you should set `$ALESPICEROOT` like: | ||
|
||
```sh | ||
export ALESPICEROOT=/Volumes/data/spice-data | ||
``` | ||
|
||
### Setting the Path Value in a metakernel | ||
|
||
!!! warning "" | ||
|
||
When using a NaifSpice Driver, $ALESPICEROOT must point to the relevant NAIF SPICE Data, | ||
and the metakernel within that data must be set. | ||
|
||
```sh | ||
isd_generate -n -v B10_013341_1010_XN_79S172W.cub | ||
``` | ||
|
||
If the path value in your metakernel has not been set, you may get an error like this: | ||
|
||
```sh | ||
File B10_013341_1010_XN_79S172W.cub: No Such Driver for Label | ||
``` | ||
|
||
Look up further in the verbose data, and if an unset metakernel is causing the problem, you will find something like: | ||
|
||
```sh | ||
Trying <class 'ale.drivers.mro_drivers.MroCtxIsisLabelNaifSpiceDriver'> | ||
Failed: | ||
================================================================================ | ||
|
||
Toolkit version: CSPICE_N0067 | ||
|
||
SPICE(NOSUCHFILE) -- | ||
|
||
The first file './data/lsk/naif0012.tls' specified by KERNELS_TO_LOAD in the file /Volumes/data/spice-data/mro-m-spice-6-v1.0/mrosp_1000/extras/mk/mro_2009_v14.tm could not be located. | ||
``` | ||
|
||
Open that .tm file (`mro_2009_v14.tm`), and change the PATH_VALUES line to point to your data; the folder containing folders for lsk, pck, sclk, fk, ik, spk, ck, etc... | ||
|
||
``` | ||
PATH_VALUES = ( './data' ) | ||
``` | ||
|
||
if your `$ALESPICEROOT` is `/Volumes/data/spice-data`, and you are working with an MRO image, you might change it to: | ||
|
||
``` | ||
PATH_VALUES = ( '/Volumes/data/spice-data/mro-m-spice-6-v1.0/mrosp_1000/data' ) | ||
``` | ||
|
||
Now save the metakernel try again, and, if your SPICE Data is correctly configured, you should not see the same error: | ||
|
||
```sh | ||
isd_generate -n -v B10_013341_1010_XN_79S172W.cub | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# ALE in Python - `load` and `loads` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should be able to reference the ALE manual here as that has a good description of the functions. It looks like the ALE manuals aren't properly rendering There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I haven't yet seen the ALE manual properly populated - Every time I've seen it, it's seemed more like a very loose outline. That's why I've included this short example here for now, but it would be good if we could add a link out to the ALE manual in the future. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jrcain-usgs This should be good now, apologies it took a bit to get back to this PR |
||
|
||
<div class="grid cards" markdown> | ||
|
||
- [:octicons-arrow-left-24: ALE SPICE Data Setup](../../getting-started/using-ale/ale-naif-spice-data-setup.md) | ||
|
||
- [:octicons-arrow-right-24: ALE on the Command Line](../../getting-started/using-ale/isd-generate.md) | ||
|
||
</div> | ||
|
||
*See [Getting Started with ALE](../../getting-started/using-ale/index.md) for an overview of ALE Installation, NAIF SPICE Data Setup, and other ALE Topics.* | ||
|
||
## Basic Usage | ||
|
||
The `ale.load` and `ale.loads` functions are | ||
the main interface for generating ISDs. Simply pass them the path to your image | ||
file/label and they will attempt to generate an ISD for it. | ||
|
||
```py | ||
import ale | ||
|
||
image_label_path = "/path/to/my/image.lbl" | ||
isd_string = ale.loads(image_label_path) | ||
``` | ||
|
||
----- | ||
|
||
More advanced usage can be seen in the CSM Stack Notebooks: | ||
|
||
<div class="grid cards" markdown> | ||
|
||
- [:octicons-arrow-right-24: Instantiating a CSM Camera Model](../../getting-started/csm-stack/image-to-ground-tutorial.ipynb) | ||
|
||
- [:octicons-arrow-right-24: Knoten - Basic Camera Operations](../../getting-started/csm-stack/knoten-camera-tutorial.ipynb) | ||
|
||
</div> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
# Getting Started with ALE | ||
|
||
## :material-numeric-1-circle-outline: Install ALE & Get SPICE Data | ||
|
||
<div class="grid cards" markdown> | ||
|
||
- :material-package-variant:{ .lg .middle } __Install ALE in [conda](https://conda-forge.org/download/)__ | ||
|
||
--- | ||
|
||
```sh | ||
conda create -n ale | ||
conda activate ale | ||
conda install -c conda-forge ale | ||
``` | ||
|
||
[:octicons-link-external-16: ALE Readme](https://github.com/DOI-USGS/ale/blob/main/README.md) | ||
|
||
- :octicons-download-16:{ .lg .middle } __Get SPICE Data__ | ||
|
||
--- | ||
|
||
Download SPICE Data. | ||
Tell ALE where to find it. | ||
Learn about image/driver types. | ||
|
||
[:octicons-arrow-right-24: Setup SPICE Data for ALE](../../getting-started/using-ale/ale-naif-spice-data-setup.md) | ||
|
||
</div> | ||
|
||
----- | ||
|
||
## :material-numeric-2-circle-outline: ALE Basic Usage | ||
|
||
<div class="grid cards" markdown> | ||
|
||
- :octicons-terminal-16:{ .lg .middle } __ALE on the Command Line__ | ||
|
||
--- | ||
|
||
Use `isd_generate` to create ISDs | ||
|
||
[:octicons-arrow-right-24: Generate an ISD](../../getting-started/using-ale/isd-generate.md) | ||
|
||
- :simple-python:{ .lg .middle } __ALE in Python__ | ||
|
||
--- | ||
|
||
Create ISDs with `ale.load` & `ale.loads` | ||
|
||
[:octicons-arrow-right-24: Get Started in Python](../../getting-started/using-ale/ale-python-load-loads.md) | ||
|
||
</div> | ||
|
||
----- | ||
|
||
## :material-numeric-3-circle-outline: Using ALE in the CSM Stack | ||
|
||
<div class="grid cards" markdown> | ||
|
||
- [:octicons-arrow-right-24: Instantiating a CSM Camera Model](../../getting-started/csm-stack/image-to-ground-tutorial.ipynb) | ||
|
||
- [:octicons-arrow-right-24: Knoten - Basic Camera Operations](../../getting-started/csm-stack/knoten-camera-tutorial.ipynb) | ||
|
||
</div> | ||
|
||
----- | ||
|
||
## :material-numeric-4-circle-outline: Advanced Topics & ALE Development | ||
|
||
<div class="grid cards" markdown> | ||
|
||
- [:octicons-arrow-right-24: Creating an ALE Driver](../../how-to-guides/ale-developer-guides/creating-ale-drivers.md) | ||
|
||
- [:octicons-arrow-right-24: ALE Drive Architecture](../../concepts/ale/ale-driver-architecture.md) | ||
|
||
</div> |
Uh oh!
There was an error while loading. Please reload this page.