Saturday, February 10, 2024

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

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.

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, install Xming and launch (it runs in the background minimized)

(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 Anaconda wants even more (I consider this optional for now):
> 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 (or miniconda should work too).
> wget https://repo.anaconda.com/archive/Anaconda3-2023.09-0-Linux-x86_64.sh
-- or get latest version from download page: https://repo.anaconda.com/archive/ 
> bash Anaconda3-2019.03-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 ASP applications
-- note for ISIS only, follow the installation pages on GitHub.
or these steps:
> conda create -n asp3
> conda activate asp3

> conda config --env --add channels conda-forge
> conda config --env --add channels usgs-astrogeology
> conda config --env --add channels nasa-ames-stereo-pipeline

> conda install  -c nasa-ames-stereo-pipeline -c usgs-astrogeology -c conda-forge stereo-pipeline==3.3.0
//This can take a while. If you need a more recent version, remove the ASP version above. By locking to ASP v3.3.0, it looks like ISIS v8.0.0 will be install alongside. Also mamba is a much faster environment solve, if you install it.

-- Finally, execute the ISIS variable initialization script with default arguments. execute the ISIS variable initialization script with default arguments.
-- this script prepares default values for: $ISISROOT, $ISISDATA, $ISISTESTDATA
> python $CONDA_PREFIX/scripts/isisVarInit.py

(7) Get ISIS3 base data
> conda activate asp3
-- 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 "~/anaconda3/envs/asp3/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 asp3" to run ISIS and ASP routines.