diff --git a/README.md b/README.md index 8b50532da99ceecc74b500769abb14cc168c6adb..f6c29677621895c58d335e459d880b233371a385 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,52 @@ This library allows for the position, rotation, velocity and rotational velocity multiple bodies in space, especially in relation to one another. It makes extensive use of NAIF's SPICE data for such calculations. + +## Quick Links + + - [Generating an ISD with `isd_generate`](https://astrogeology.usgs.gov/docs/getting-started/using-ale/isd-generate/) + - How to use the `isd_generate` script, and set up NAIF SPICE Data + + - [ALE Quickstart](https://astrogeology.usgs.gov/docs/getting-started/using-ale/isd-generate/) + - Brief overview of how to install ALE and use `load`/`loads` in python + + - [Tutorial: Generating an ISD, Creating a CSM Model, and Converting Coordinates](https://astrogeology.usgs.gov/docs/getting-started/csm-stack/image-to-ground-tutorial/#tutorial-instantiating-a-csm-camera-model-from-image) + - A tutorial on using ALE and Knoten in python + + - [ALE Driver Architecture](https://astrogeology.usgs.gov/docs/concepts/ale/ale-driver-architecture/) + - How ALE and its drivers work + + +## Prerequisite: Conda + +Conda is a prerequisite for ALE. If you need it, +[download and install conda through miniforge](https://conda-forge.org/download/). + +## Installing ALE +```sh +# Create an environment ("y" to confirm) +conda create -n ale + +# Run this to activate your environment whenever you need to use ALE +conda activate ale + +# Install ALE from conda (in your current environment) +conda install -c conda-forge ale +``` + + +## Adding the ALESPICEROOT environment variable +If your ale driver uses NAIF SPICE data, you need to [download NAIF SPICE DATA (see ASC software docs)](https://astrogeology.usgs.gov/docs/getting-started/using-ale/isd-generate/#setting-up-naif-data) and set the ALESPICEROOT variable in one of these two ways: + +```sh +# from your shell: +export ALESPICEROOT=/path/to/ale/spice + +# from inside a conda env: +conda env config vars set ALESPICEROOT=/path/to/ale/spice +``` + + ## Using ALE to generate ISDs To generate an ISD for an image, use the load(s) function. Pass the path to your image/label file and ALE will attempt to find a suitable driver and return an ISD. You can use load to generate the ISD as a dictionary or loads to generate the ISD as a JSON encoded string. @@ -24,25 +70,28 @@ isd_string = loads(path_to_label) You can get more verbose output from load(s) by passing verbose=True. If you are having difficulty generating an ISD enable the verbose flag to view the actual errors encountered in drivers. -## Setting up dependencies with conda (RECOMMENDED) -Install conda (either [Anaconda](https://www.anaconda.com/download/#linux) or -[Miniconda](https://conda.io/miniconda.html)) if you do not already have it. Installation -instructions may be found [here](https://conda.io/docs/user-guide/install/index.html). +## Developing ALE -### Creating an isolated conda environment -Run the following commands to create a self-contained dev environment for ALE (type `y` to confirm creation): -```bash -conda env create -n ale -f environment.yml +### Installing ALE with git and conda + +Clone ALE from git and create a conda environment with the necessary dependencies. +```sh +git clone --recurse-submodules [paste link from "<> Code" button above] +cd ale +conda env create -n ale -f environment.yml # "y" to confirm ``` -> *For more information: [conda environments](https://conda.io/docs/user-guide/tasks/manage-environments.html)* -### Activating the environment -After creating the `ale` environment, we need to activate it. The activation command depends on your shell. -* **tcsh**: `conda activate ale` -> *You can add these to the end of your $HOME/.bashrc or $HOME/.cshrc if you want the `ale` environment to be active in every new terminal.* +### Conda Environment + +Activate the environment whenever you need to use ALE. +```sh +conda activate ale +``` +> *You can add `conda activate ale` to the end of your .bashrc or .zshrc if you want the `ale` environment to be active in every new terminal.* -## Building ALE + +### Building ALE After you've set up and activated your conda environment, you may then build ALE. Inside of a cloned fork of the repository, follow these steps: @@ -60,37 +109,20 @@ running the following command will retrieve the gtest submodule manually: git submodule update --init --recursive ``` -## Adding the ALESPICEROOT environment variable -If an ale driver is going to be used that leverages SPICE data, it is necessary to set the ALESPICEROOT. One can do this using normal shell syntax, e.g.: - -`export ALESPICEROOT=/path/to/ale/spice` - -or inside of a conda environment: -`conda env config vars set ALESPICEROOT=/path/to/ale/spice`. ## Adding ALE as a dependency -You can add ALE as a dependency of your CMake based C++ project by linking the exported CMake target, `ale::ale`. +You can add ALE as a dependency of your CMake based C++ project by linking the exported CMake target, `ale::ale` -For example: - -``` +```c add_library(my_library some_source.cpp) find_package(ale REQUIRED) target_link_libraries(my_library ale::ale) ``` -## Running Tests -To test the c++ part of ALE, run: - -``` -ctest -``` -from the build directory. +## Running Tests -To test the python part of ALE, run: +To test the c++ part of ALE, run `ctest` from the build directory. -``` -pytest tests/pytests -``` +To test the python part of ALE, run `pytest tests/pytests` diff --git a/docs/index.rst b/docs/index.rst index 741b84a6443900032bb513350efcce5151b95dfa..b75e36783b3a8bc057466ef54d6357ed67b9f1ba 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -8,5 +8,4 @@ Abstraction Layer for Ephemerides (ALE) .. toctree:: :maxdepth: 3 - tutorials/index library/index diff --git a/docs/tutorials/index.rst b/docs/tutorials/index.rst deleted file mode 100644 index bdcfc1a6738b08bca961dcfe5e7b990793afc216..0000000000000000000000000000000000000000 --- a/docs/tutorials/index.rst +++ /dev/null @@ -1,13 +0,0 @@ -######### -Tutorials -######### - -:Release: |version| -:Date: |today| - ------------------------------------------ - -.. toctree:: - :maxdepth: 2 - - quick_start diff --git a/docs/tutorials/quick_start.rst b/docs/tutorials/quick_start.rst deleted file mode 100644 index 3072eaa956e29d896d6697a66313c5b86cd2e3b4..0000000000000000000000000000000000000000 --- a/docs/tutorials/quick_start.rst +++ /dev/null @@ -1,68 +0,0 @@ -=============== -ALE Quick Start -=============== - -This document provides a set of steps to get setup for generating Image Support -Data (ISD) for an image. - -Installation -============ - -The easiest way to setup ALE is using Anaconda. Once you have -`Anaconda <https://www.anaconda.com/products/individual>`_ or -`Miniconda <https://docs.conda.io/en/latest/miniconda.html>`_ installed install -ALE from conda-forge by running - -.. code-block:: - - conda install -c conda-forge ale - -.. note:: - It is highly recommended that you use - `environments <https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html>`_ - to manage the packages you install with Anaconda. - -Data -==== - -Planetary imagery is not archived with sufficient data to generate an ISD -from only the image and its label. ALE currently supports two supplementary data -sources: ISIS cubes with attached SPICE, and NAIF SPICE Kernels. - - -If you are working with ISIS cubes that have attached SPICE (the -`spiceinit <https://isis.astrogeology.usgs.gov/Application/presentation/Tabbed/spiceinit/spiceinit.html>`_ -application has been run on them) then ALE will use the data embedded in the -cube file. - - -If you are working with PDS3 images or ISIS cubes that do not have attached -SPICE, then you will need to download the required NAIF SPICE Kernels for your -image. It is recommended that you use the metakernels provided in the -`PDS kernel archives <https://naif.jpl.nasa.gov/naif/data_archived.html>`_. -You can specify the path for ALE to search for metakernels via the -``ALESPICEROOT`` environment variable. This should be set to the directory where -you have the PDS kernel archives downloaded. An example structure would be - -* $ALESPICEROOT - - * mro-m-spice-6-v1.0 - * dawn-m_a-spice-6-v1.0 - * mess-e_v_h-spice-6-v1.0 - -See :py:attr:`ale.base.data_naif.NaifSpice.kernels` for more information about how to -specify NAIF SPICE kernels. - -Load/Loads -========== - -The :py:meth:`ale.drivers.load` and :py:meth:`ale.drivers.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. - -.. code-block:: python - - import ale - - image_label_path = "/path/to/my/image.lbl" - isd_string = ale.loads(image_label_path)