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.