Friday, February 28, 2025

APPL RFC: Use IAU Sphere for HiRISE DTM Projects in Socet Set/GXP

This is a repost from the original Astrodiscuss site (by D.M. from June 25, 2020). Since the Mars aeroid continues to be a confusing issue, I find this description valuable and can help with our use of SOCET SET/GXP®.

Summary

The Astrogeology Planetary Photogrammetry Lab’s (APPL) SOP for creating HiRISE DTMs currently involves initializing a project in SOCET SET® using a three-dimensional coordinate system based on a biaxial ellipsoid for Mars, but establishes ground control using MOLA-derived heights relative to the geoid (e.g. MOLA Topography). This RFC proposes initializing SOCET SET® projects for HiRISE DTMs using a sphere, rather than a biaxial ellipsoid, and using a reference datset for ground control with heights relative to the geoid.

Motivation

SOCET SET® requires that users specify a coordinate reference system for stereo projects. APPL’s current SOP for creating HiRISE DTMs at low and mid-latitudes calls for using a geographic coordinate system based on the IAU-recommended biaxial ellipsoid for Mars. This coordinate system includes planetographic latitudes, and elevations defined as heights relative to ellipsoid.

Ground control of the DTM is achieved by estimating a rigid three-dimensional transformation from an initial HiRISE DTM and a reference dataset with elevations defined as heights relative to the geoid (e.g. MOLA Topography). This transform is applied to the latitude, longitude, and ellipsoidal height values of a set of tie points associated with the HiRISE stereopair. These updated ground coordinates are then re-imported to Socet Set and used as the basis of a final bundle adjustment. This results in a final HiRISE DTM with elevation values that are numerically-consistent with heights relative to the geoid, but the mixed use of heights relative to an ellipsoid and relative to the geoid is not theoretically rigorous.

In particular, the camera angles that are calculated in the final bundle adjustment based on the ground control points determined from MOLA Topography are not strictly correct. It is also possible that aligning an initial HiRISE DTM with ellipsoidal heights to MOLA Topography can introduce spurious rotations in the final HiRISE DTM if the stereopair covers an area of the planet where the height of the geoid changes much more rapidly than the ellipsoid. This effect is unlikely to be large because the MOLA-defined geoid for Mars has an effective resolution that is several orders of magnitude coarser than a HiRISE DTM, but could render a HiRISE DTM unsuitable for certain scientific investigations.

This RFC is therefore motivated by a desire to eliminate the possible negative effects caused by mixing ellipsoid and geoid heights in the HiRISE DTM SOP.

Proposed Changes

This RFC proposes 3 changes to the existing HiRISE DTM SOP:

  1. Initialize projects in SOCET SET® using the IAU-recommended sphere for Mars (radius = 3396190 meters)
  2. Use an elevation product for purposes of ground control with heights measured relative to a sphere, rather than the geoid
  3. Use the dem_geoid program to convert pixel values in the final controlled HiRISE DTMs from heights relative to a sphere to heights relative to the geoid

Drawbacks

(none identified)

Alternatives

Continue using the existing SOP despite the shortcomings identified in the Motivation section above.

Future Possibilities

The proposed changes in this RFC have the potential to be extended to SOPs for creating DTMs from other Mars image datasets, such as CTX or HRSC.


Friday, January 3, 2025

ISIS and ASP on Windows 11 (WSL, take 3.1)

Based on this original post for Windows 10 and with help from M. Phillips (LPL, see: alternative instructions and demos), I will update this post to get ISIS and ASP installed on Windows 11 (again using using WSL). Warning: this requires a lot of downloading. This took about two hours on my laptop and decent wifi, but I did have some issues with the data download. Update to v3.1 to use Miniforge instead of Anaconda.

First, ASP = NASA Ames Stereo Pipeline (GitHubDocs)
ISIS = USGS Integrated Software for Imagers and Spectrometers (GitHub, Docs)

(1) get Linux for Windows 11
I recommend Ubuntu 22 LTS installed via the Windows app store (or via wsl powershell command-line, "wsl --install -d Ubuntu-22.04").

And if you don't have access to the MS App store, you can try a more manual install.

(2) For Windows 10, install Xming and launch (it runs in the background minimized).
http://www.straightrunning.com/XmingNotes/. This should be optional for Windows 11 as it seems to come with an X11 server built in.

(3) Once running Ubuntu, update it (this just gets your Ubuntu system up to date)
> sudo apt-get update
> sudo apt-get upgrade

(4) Now and let's get X11 and GUIs working:
> sudo apt install -y xclip gnome-themes-standard gtk2-engines-murrine dbus dbus-x11 x11-apps libgl1-mesa-glx

Looks like we might need even more (I consider this optional):
> sudo apt-get install libgl1-mesa-glx libegl1-mesa libxrandr2 libxrandr2 libxss1 libxcursor1 libxcomposite1 libasound2 libxi6 libxtst6

-- test X11
-- add this line to bottom of .bashrc (or type):
> echo export DISPLAY=:0 >> ~/.bashrc
> source ~/.bashrc
> xeyes

(5) Get Anaconda Miniforge (miniforge is still free for all to use).
> wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh
-- or get latest version from download page: https://github.com/conda-forge/miniforge
> bash Miniforge3-Linux-x86_64.sh
-- follow install instructions and allow installer to update your shell (~/.bashrc) when it asks (will need to type "yes").
-- once installed, restart the Ubuntu terminal from Windows' powershell (typing wsl) or simply from Windows start.

(6) Get ISIS and then ASP applications
-- note for ISIS instructions, follow the installation pages on GitHub or these steps:
> conda create -n isis8
> conda activate isis8

> conda config --env --add channels usgs-astrogeology

> conda install -c usgs-astrogeology isis

-- Finally, execute the ISIS variable initialization script.
-- this script prepares default locations and values for: $ISISROOT, $ISISDATA, $ISISTESTDATA
> python $CONDA_PREFIX/scripts/isisVarInit.py
to test, type:
> qview

-- now get ASP binary download, instructions.
> wget /
https://github.com/NeoGeographyToolkit/StereoPipeline/releases/download/3.4.0/StereoPipeline-3.4.0-2024-06-19-x86_64-Linux.tar.bz2
> tar xvf StereoPipeline-3.4.0-2024-06-19-x86_64-Linux.tar.bz2
> echo export PATH=\${PATH}:~/StereoPipeline-3.4.0-2024-06-19-x86_64-Linux/bin >> ~/.bashrc
> source ~/.bashrc
-- to test ASP, type:
> stereo

(7) Get ISIS3 base data
> conda activate isis8
-- we will need to get the base data, has target SPICE kernels and a handful of global DEMs for orthorectification. Feel free to delete any data you wont need.
> downloadIsisData base $ISISDATA

Data Notes:
--Due to what I can only call an unfortunate quirk for the files on S3 cloud (doesn't support symbolic links), you will get many copies of the same DEMs (Mars, Moon, ...). It is more than 12GB of extra files. Feel free to delete all but the last version under $CONDA_PREFIX/data/base/dems
--I ran out of space on my main drive, so I edited my environment variable "ISISDATA" to point to a USB drive "/mnt/d/data/". This can be updated here "~/miniforge3/envs/isis8/etc/conda/activate.d/isis-activate.sh"
    --To get Ubuntu to see a new drive, you may need to get out and back into Ubuntu. In a powershell you can type "wsl --shutdown" and then restart with "wsl".

Done. at least for the minimal install. You may need lots more SPICE data for a particular mission, read more about that on the ISIS install page.

-- So the next time you launch an Ubuntu terminal, just type "conda activate isis8" to run ISIS and ASP routines.