PSI Using SNAP - STAMPS Tutorial 1 - Installation and Preperation
PSI Using SNAP - STAMPS Tutorial 1 - Installation and Preperation
The Windows Subsystem for Linux (WSL) is a great feature introduced in Windows 10.
Is a compatibility layer for running Linux binary executables natively on Windows 10, and allows the
use of a rather real Linux installation, without using a virtual machine (Andrea Fortuna web site)
I tried my best to keep everything short and easy to grasp. However, it is not guaranteed to be
empty of any error. Before starting, I strongly recommend that the user take a look at the following
links and provided documentation. I wrote this tutorial based on my own experiences and with the
help of the documents and information which are provided by the SNAP forum, especially by the
super users like Thorsten Hoeser, Andreas Braun, Ekaterina Smolianinova, Jose Manuel, Marco
Peters, Falah Fakhri, and others.
Tuturial videos for this document (VIDEO 1, VIDEO 2)
To begin, I added some links that I have found more helpful so far. Although I tried to cover the main
steps for the user, this tutorial is still not that much in detail as I wanted it a brief instruction. For
more details, the following links along with SNAP Forum, should be studied by the user.
A-Step by step instruction of snap-stamps workflow by Thorsten Hoeser ( some details has to be
updated for the latest version of snap and StaMPS)
*** Very helpful documents and links recommended by Andreas Braun in SNAP forum:
https://forum.step.esa.int/t/stamps-detailled-instructions/8140
1- Installing WSL from Microsoft store
After typing the Ubuntu in the windows search bar and finding and running it, we are going to see the
ubuntu terminal
Link https://sourceforge.net/projects/vcxsrv/files/latest/download
After installation, we should open VCxsrv software and set the
Initial setting in the software as the picture
export DISPLAY=:0
export LIBGL_ALWAYS_INDIRECT=1
startlxde ( main command to run the desktop)
then we see the lxde desktop, each time that we want to use it we should
rerun the last three commands
https://www.makeuseof.com/tag/linux-desktop-windows-subsystem/
3- Matlab installation in WSL
The MATLAB 2018a version is suggested for the latest WSL(2019-2020), for the
older version you have to update some ubuntu packages
** it is important that the user name that you chose when you install the
Ubuntu and the username that you want to use the MATLAB should be the same.
Otherwise, you would face the user name problem
The Matlab 2018a version should be downloaded for Linux and be installed like
other software in the Linux platform.
https://www.mathworks.com/matlabcentral/answers/308911-can-i-install-matlab-in-bash-on-ubuntu-
on-windows
you might face other problems depending on which Pc you are working with. In
that case, just google the errors. You would find plenty of helpful stuff on
the internet. In my case, with the visual desktop, I have not experienced any
errors other than user name mismatching.
In case you couldn’t figure it out how to install it, it is also possible to
just move the prepared package by STaMPS to windows and also copy and paste
all the files in stamps>MATLAB folder to the same folder and continue the
rest of the steps in windows.
4-Then the following software should also be installed in MATLAB
I recommend to install them using ubuntu repository by sudo apt-get install…
command in the ubuntu terminal
First, it is recommended to use >>> sudo apt-get update
Then,
4-1 gawk >>>>>>>>>>>>> sudo apt-get install gawk
4-2-tcsh >>>>>>>>>>>>>sudo apt-get install tcsh
4-3-matlab-support>>> sudo apt-get install
4-4-Make>>> sudo apt-get make
4-5-build essential >> sudo apt-get install build-essential
4-6-tringle>> sudo apt-get install triangle-bin
4-7-snaphu>> I personally recommend the latest version 2.0.3
You can also install snaphu trough the ubuntu repository. But in that case,
you install the older version.
For the 2.03 or newer version you can check the following video that I
uploaded on YouTube before
https://www.youtube.com/watch?v=FVv2SF8jK3Q&t=455s
5-installation of StaMPS
I strongly recommend the latest version 4.1.B
However, you need to do some of the following steps in different ways. You
have to change some files with adjusted versions, and you should use another
command for preparing the data depending on the version of the edited files
that you are going to use.
More information >>
https://forum.step.esa.int/uploads/default/original/2X/9/94a7012eb9807cb8ec03
fd68a31807de007acf6f.zip
5-3 then we should return back to STaMPS main folder and edit the
StaMPS_CONFIG.bash file
The only part that should be edited is the first paragraph. I put my file as
a sample
export STAMPS="/softwares/stamps" Where we installed STaMPS
#export SAR="/home/ahooper/software/ROI_PAC_3_0"
#export GETORB_BIN="/home/ahooper/software/getorb/bin"
#export SAR_ODR_DIR="/home/ahooper/software/SAR_FILES/ODR"
If you installed any of these softwares
#export SAR_PRC_DIR "/home/ahooper/software/SAR_FILES/PRC"
#export VOR_DIR="/home/ahooper/software/SAR_FILES/VOR" you should do the same as above here
#export INS_DIR="/home/ahooper/software/SAR_FILES/INS"
# make As it installed with repository, there is no
#export DORIS_BIN="/home/ahooper/software/doris_v4.02/bin"
inactive the #export TRIANGLE_BIN="/home/ahooper/software/triangle/bin" need to export the path
command export SNAP2STAMPS="/softwares/snap2stamps"
export SNAPHU_BIN="/softwares/snaphu/bin" You don’t need it, you should put #
before it
#export ROI_PAC="$SAR/ROI_PAC"
#####################################
# ROI_PAC VERSION 3 In case you installed the SNAPHU
#####################################
#export INT_BIN="$ROI_PAC/INT_BIN"
without repository, you need to export
#export INT_SCR="$ROI_PAC/INT_SCR" the path of the installation folder like this
#####################################
After finishing the edit. Each time we should source this bash file before
using StaMPS. By sourcing this file, the edited paths would be added to main
ubuntu bash root.
After editing we should source the file:
6-Possible errors and useful commands in Ubuntu
6-1-If you face this error that Ubuntu has not the permission to access a
folder
You can use the following command to fix it:
sudo chmod -R a+rwx /………… path of that folder
6-2 if you install the STaMPs and edit and source the bashe file but still
the mt_prep_snap doesnot work, you can check the same command when you are in
the stamps bin folder path. In that case, the path to stamps bin folder
should be added to the main .bashrc file in WSL root folder in order to make
it available from every path.
https://techlog360.com/basic-ubuntu-commands-terminal-shortcuts-linux-beginner/
7-STaMPS visualization with R & R-studio (Working with the R-based STaMPs
visualization code can be done entirely in windows)
7-1 we should first install the R package for windows
7-2 we should install the r studio (free version )
7-3 Downloading the visualization package written by Thorsten Höser
7-4 Extracting a package somewhere in windows (This package can be further
used by adding an exported file result from StaMPS-Matlab to the extracted
folder- tutorial 2)