Skip to content

Commit

Permalink
Added links to readme, removed quickstart
Browse files Browse the repository at this point in the history
  • Loading branch information
jrcain-usgs committed Feb 3, 2025
1 parent 5142325 commit bc19bde
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 118 deletions.
97 changes: 61 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ 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/)

- [Tutorial: Generating an ISD, Creating a CSM Model, and Converting Coordinates (ALE and Knoten)](https://astrogeology.usgs.gov/docs/getting-started/csm-stack/image-to-ground-tutorial/#tutorial-instantiating-a-csm-camera-model-from-image)

- [ALE Driver Architecture](https://astrogeology.usgs.gov/docs/concepts/ale/ale-driver-architecture/)


## 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.
Expand All @@ -24,25 +34,57 @@ 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)
## Prerequisite: Conda

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).
Conda is a prerequisite for ALE. If you need it,
[download and install conda through miniforge](https://conda-forge.org/download/).

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

## Building 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
```


## Developing ALE

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

### 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
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:

Expand All @@ -60,37 +102,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`.

For example:
You can add ALE as a dependency of your CMake based C++ project by linking the exported CMake target, `ale::ale`

```
```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`
1 change: 0 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ Abstraction Layer for Ephemerides (ALE)
.. toctree::
:maxdepth: 3

tutorials/index
library/index
13 changes: 0 additions & 13 deletions docs/tutorials/index.rst

This file was deleted.

68 changes: 0 additions & 68 deletions docs/tutorials/quick_start.rst

This file was deleted.

0 comments on commit bc19bde

Please sign in to comment.