Skip to content

Commit

Permalink
added quality reports to notebooks, updated instal docs
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewAnnex committed May 30, 2021
1 parent 46071df commit 3095c28
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 28 deletions.
27 changes: 27 additions & 0 deletions asap_stereo/asap_ctx_workflow.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,33 @@
}
}
},
{
"cell_type": "markdown",
"source": [
"# Stereo Quality Report"
],
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%% md\n"
}
}
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [
"qual_report = asap.CommonSteps().get_stereo_quality_report(f'{left}_{right}/{left}.lev1eo.cub', f'{left}_{right}/{right}.lev1eo.cub')\n",
"print(qual_report)"
],
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
}
},
{
"cell_type": "markdown",
"source": [
Expand Down
29 changes: 27 additions & 2 deletions asap_stereo/asap_hirise_workflow.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@
"outputs": [],
"source": [
"from IPython.display import Image\n",
"from asap_stereo import asap"
"from asap_stereo import asap\n",
"import math"
]
},
{
Expand Down Expand Up @@ -179,6 +180,30 @@
"!asap hirise step-four "
]
},
{
"cell_type": "markdown",
"source": [
"# Stereo Quality Report"
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": null,
"outputs": [],
"source": [
"qual_report = asap.CommonSteps().get_stereo_quality_report(f'{left}_{right}/{left}.mos_hijitreged.norm.cub', f'{left}_{right}/{right}.mos_hijitreged.norm.cub')\n",
"print(qual_report)"
],
"metadata": {
"collapsed": false,
"pycharm": {
"name": "#%%\n"
}
}
},
{
"cell_type": "markdown",
"source": [
Expand All @@ -201,7 +226,7 @@
" # this is because rescale in ISIS does not update GSD in metadata\n",
" asap.CommonSteps().rescale_and_overwrite(factor=downsample, postfix='.mos_hijitreged.norm.cub')\n",
" img_gsd = math.ceil(res_gsd)*downsample\n",
" dem_gsd = 4*imggsd\n",
" dem_gsd = 4*img_gsd\n",
" print('new img gsd', img_gsd)\n",
" print('new dem gsd', dem_gsd)\n"
],
Expand Down
59 changes: 33 additions & 26 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,58 +2,65 @@
Installation
============

This guide assumes that the user has already installed anaconda.
This guide assumes that the user has already installed anaconda with conda version newer than 4.9.

ASAP requires that Install both Ames Stereo Pipeline and ISIS are available to the user in the PATH, and the user will need to have downloaded the relevant ISIS data folders.
Below we provide a guide assuming the user has a working ISIS installation in some other conda environment, and a a local copy of the pre-compiled Ames Stereo Pipeline.
Please refer to the `Ames Stereo Pipeline Installation <https://stereopipeline.readthedocs.io/en/latest/installation.html#precompiled-binaries-linux-and-macos>`_ documentation for details on how to download the precompiled ASP.

We will create a new conda environment for ASAP that includes the bin directories in the PATH for ASAP and the ISIS data folder environment variables.
In the variables section, you will need to update the parameters for your environment.
The ISISROOT directory is the conda environment folder for your working ISIS installation, for example "~/anaconda/envs/isis/", it can also be found by activating the environment and printing the $CONDA_PREFIX variable.
The two ISIS data directories are explained in the `ISIS installation documentation <https://github.com/USGS-Astrogeology/ISIS3>`_.
The ASPROOT directory similarly points to the unzipped archive of the Ames Stereo Pipeline.

ASAP requires that Install both Ames Stereo Pipeline and ISIS are available to the user in the PATH.
There are several ways to do this outside of this guide's scope, but a simple solution is to use the
following conda environment YAML configuration file:

.. code-block:: yaml
name: asap_0_0_4
name: asap_0_2_0
channels:
- nasa-ames-stereo-pipeline
- usgs-astrogeology
- conda-forge
- defaults
dependencies:
- python=3.6
- stereo-pipeline==2.7.0
- python=3.8
- nb_conda_kernels
- jupyterlab
- requests
- fire
- tqdm
- sh
- papermill
- rasterio
- pyproj
- shapely
- pvl
- pip
- pip:
- rasterio
- pyproj
- moody>=0.0.4
- asap_stereo>=0.0.4
- asap_stereo=0.2.0
variables:
ISISROOT: /path/to/your/isis/conda/env/
ISISDATA: /path/to/your/isis/data/dir/
ISISTESTDATA: /path/to/optional/isis/test/data/dir/
ASPROOT: /path/to/your/precompiled/StereoToolkitDirectory/
Using the command::

conda env create --file asaptest.yml

Will create a new conda environment called "asap_0_0_4".
At this point, ASAP will be available to the user.
However, the user must download the `ISIS Data Area <https://github.com/USGS-Astrogeology/ISIS3#the-isis-data-area>`_
and run the `ISIS variable initialization script <https://github.com/USGS-Astrogeology/ISIS3#isis-installation-with-conda>`_
to finish the installation. Steps for these last two steps are available in the ISIS README and documentation linked to before.
Be sure to run the variable initialization script in your new conda environment by first running::

conda activate asap_0_0_4
conda env create --file asap.yml

and then::
This will create a new conda environment called "asap_0_2_0". The environment however is not ready to use yet.
We need to update the path to ensure ASP and ISIS programs are available for ASAP to use.
To do this run the following commands::

python $CONDA_PREFIX/scripts/isis3VarInit.py <any args...>
conda activate asap_0_2_0
conda env config vars set PATH=$PATH:$ASPROOT/bin:$ISISROOT/bin
conda deactivate

Deactivate, then reactivate the environment, and you are ready to start using asap!
This will update the PATH variable in the conda environment to include both ISIS and ASP bin folders.
At this point you are ready to start using asap!

To test if asap is installed correctly, run each of the following::
To test if asap is installed correctly, run each of the following after activating the new environment::

asap
asap ctx
Expand Down

0 comments on commit 3095c28

Please sign in to comment.