Open Sourcing ASAP-Stereo

Today I have open-sourced ASAP-Stereo, which I developed to automate the Ames Stereo Pipeline and to make Digital Elevation Models (DEMs) of HiRISE and CTX stereo pairs reproducible for my research. Ames Stereo Pipeline (aka ASP) is an open-source stereo photogrammetry toolkit that helps users take stereo image pairs and produce DEMS from them using a command-line interface (CLI). However, the process involves a large number of steps that are tedious to run and can lead to mistakes or lost work. Automating the workflow to produce a DEM reduces the risk of human errors and also makes the results reproducible.

The asp_scripts project, written in pure bash, was the first open-sourced effort to automate the workflow of creating DEMs for CTX and HiRISE images, and ASAP-Stereo is an expansion and reimplementation of that project into python. By using python, ASAP-Stereo provides a more flexible version of the asp_scripts workflow. ASAP-Stereo implements the individual steps in the asp_scripts workflow as discrete functions to allow advanced users to fix issues as they occur without redoing work, while also providing higher-level functions that call the steps serially to reproduce the workflow.

The most exciting contributions of ASAP-Stereo are the Jupyter notebook based workflows to enable reproducibility. The notebook workflows contain all the logs for each step of the process, and the parameters used to create the DEM with embedded images of intermediate products. The notebook logs allow users to, at a glance, judge the outputs of ASP and make changes as needed or to distribute the full log in the supplementary material for a publication.

ASAP-Stereo is powered primarily by the sh package, which turns any program on the user’s path into a python function, python fire, which turns any python function or class into a CLI, and by the papermill project which turns Jupyter notebooks into runnable workflows. This mixing of python and bash allows ASAP-Stereo to mix the two with minimal scaffolding, gaining the benefits of both. For example, ASAP-Stereo uses GDAL programs to pass parameters to another CLI tool of mine called Moody to use a REST API supported by the PDS Geosciences Node to download the subset of MOLA PEDR data needed to align the CTX dem to MOLA topography.

Other neat features include the incorporation of new feature-matching based point cloud alignment that makes the process of aligning HiRISE products to CTX a bit more robust and detecting the CPU cores and threads to speed up particular bottlenecks in the stereo process. ASAP-Stereo also uses other features in Moody to automatically determine the “left image” (most nadir) in a stereo run and the correct Ground Sample Distances (GSDs) to use.

That said, there are some things that ASAP-Stereo does not do. It does not make ASP accessible to beginners. ASAP-Stereo targets users who have advanced knowledge of ASP and ISIS3 due to sheer complexity and caveats involved. Deployment is difficult due to the complexity of ASP and ISIS3, which also prevents integration tests for the project. Planned changes for ISIS3 may enable this in the future.

By open-sourcing the project, I hope to see improvements to existing workflows as well as new workflows contributed by users. ASAP-Stereo provides an excellent framework to implement workflows for other instruments such as LRO NAC and HRSC. I also hope to present ASAP-Stereo at future workshops, and I plan to make the project citeable soon.

Thanks for reading!

Avatar
Andrew M. Annex
Senior Science Systems Engineer

My research interests include the applications of deep learning to planetary geology.