This instruction is for PSI analysis using stamps and SNAP in Windows Subsystem for Linux (WSL).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 theuse 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 beempty of any error. Before starting, I strongly recommend that the user take a look at the followinglinks and provided documentation. I wrote this tutorial based on my own experiences and with thehelp of the documents and information which are provided by the SNAP forum, especially by thesuper users like Thorsten Hoeser, Andreas Braun, Ekaterina Smolianinova, Jose Manuel, MarcoPeters, 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 mainsteps for the user, this tutorial is still not that much in detail as I wanted it a brief instruction. Formore 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 beupdated for the latest version of snap and StaMPS)Forum link aMPS manual earahoo/stamps/StaMPS Manual v4.1b1.pdfC- StaMPS-Visualizer, SNAP-StaMPS izer-snap-stamps-workflow/9613D-Latest code for STaMPS-Visualizer Visualizer*** Very helpful documents and links recommended by Andreas Braun in SNAP d-instructions/8140

1- Installing WSL from Microsoft store2- Installing the desktop (GUI) in WSLIt put us much more on ease for the following steps.After typing the Ubuntu in the windows search bar and finding and running it, we are going to see theubuntu terminalA useful link in this regard: https: 10Then we should use the following commands in opened ubuntu terminalsudo apt updatesudo apt upgradethen by the following command, we can install the light ubuntu desktopsudo apt install lxdeIn the next step, the VcXsrv Windows X Server utility should be installed inwindows.Link st/download

After installation, we should open VCxsrv software and set theInitial setting in the software as the picture21Then we should run the following commands in ubuntu terminalexport DISPLAY :0export LIBGL ALWAYS INDIRECT 1startlxde ( main command to run the desktop)then we see the lxde desktop, each time that we want to use it we shouldrerun the last three commandsThe more detailed instruction can be found in the following ndows-subsystem/

3- Matlab installation in WSLThe MATLAB 2018a version is suggested for the latest WSL(2019-2020), for theolder version you have to update some ubuntu packages** it is important that the user name that you chose when you install theUbuntu and the username that you want to use the MATLAB should be the same.Otherwise, you would face the user name problemThe Matlab 2018a version should be downloaded for Linux and be installed likeother software in the Linux platform.The following link might be on-windowsyou might face other problems depending on which Pc you are working with. Inthat case, just google the errors. You would find plenty of helpful stuff onthe internet. In my case, with the visual desktop, I have not experienced anyerrors other than user name mismatching.In case you couldn’t figure it out how to install it, it is also possible tojust move the prepared package by STaMPS to windows and also copy and pasteall the files in stamps MATLAB folder to the same folder and continue therest of the steps in windows.4-Then the following software should also be installed in MATLABI recommend to install them using ubuntu repository by sudo apt-get install command in the ubuntu terminalFirst, it is recommended to use sudo apt-get updateThen,4-1 gawk sudo apt-get install gawk4-2-tcsh sudo apt-get install tcsh4-3-matlab-support sudo apt-get install4-4-Make sudo apt-get make4-5-build essential sudo apt-get install build-essential4-6-tringle sudo apt-get install triangle-bin4-7-snaphu I personally recommend the latest version 2.0.3You 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 Iuploaded on YouTube before FVv2SF8jK3Q&t 455s5-installation of StaMPSI strongly recommend the latest version 4.1.BHowever, you need to do some of the following steps in different ways. Youhave to change some files with adjusted versions, and you should use anothercommand for preparing the data depending on the version of the edited filesthat you are going to use.More information pFor stamps installation5-1, we should first extract the package in Ubuntu5-2 we go to src folderThensudo makesudo make install5-3 then we should return back to STaMPS main folder and edit theStaMPS CONFIG.bash fileIt is really important that this file should be edited in Ubuntu. If you dothis using windows editor or WordPad, it would not work for you.

So in Ubuntu we can use the Nano editor ( I personally recocomend) or anyother on like vimeditor(lxdesktop original one) and we should adjust thefile then save it after.The only part that should be edited is the first paragraph. I put my file asa sample# makeinactive thecommandexport STAMPS "/softwares/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"#export SAR PRC DIR "/home/ahooper/software/SAR FILES/PRC"#export VOR DIR "/home/ahooper/software/SAR FILES/VOR"#export INS DIR "/home/ahooper/software/SAR FILES/INS"#export DORIS BIN "/home/ahooper/software/doris v4.02/bin"#export TRIANGLE BIN "/home/ahooper/software/triangle/bin"export SNAP2STAMPS "/softwares/snap2stamps"export SNAPHU BIN "/softwares/snaphu/bin"#export ROI PAC " SAR/ROI PAC"###################################### ROI PAC VERSION 3######################################export INT BIN " ROI PAC/INT BIN"#export INT SCR " ROI PAC/INT SCR"#####################################Where we installed STaMPSIf you installed any of these softwaresyou should do the same as above hereAs it installed with repository, there is noneed to export the pathYou don’t need it, you should put #before itIn case you installed the SNAPHUwithout repository, you need to exportthe path of the installation folder like thisAfter finishing the edit. Each time we should source this bash file beforeusing StaMPS. By sourcing this file, the edited paths would be added to mainubuntu bash root.After editing we should source the file:

6-Possible errors and useful commands in Ubuntu6-1-If you face this error that Ubuntu has not the permission to access afolderYou can use the following command to fix it:sudo chmod -R a rwx / path of that folder6-2 if you install the STaMPs and edit and source the bashe file but stillthe mt prep snap doesnot work, you can check the same command when you are inthe stamps bin folder path. In that case, the path to stamps bin foldershould be added to the main .bashrc file in WSL root folder in order to makeit available from every path.Wsl root folder:I put my own WSL path as a sample GroupLimited.UbuntuonWindows 79rhkp1fndgsc\LocalState\rootfs\rootYours should also be in a similar place6-3 so similar to what we have done before for stamps bash file, here, wealso have to edit the .bashrc file with nano or vim editorThen the following command should be added to end of the fileexport PATH PATH: /softwares/stamps/bin

Then we save the file, since then you might not face this error again andSTaMPS command can be run from everywhere in Ubuntu6-4 If you want to work with an older version of STaMPs, you have to add anadjusted file such as mt prep gamma snap to StaMPS bin folder. In that case,you have to give permission to bash to have access to that file. Otherwise,you get a bash error.To overcome this problem, you should use the following command chmod u x /softwares/stamps/bin/mt prep gamma snapComplete path to that fileUseful commands in Ubuntu:Mounting the Windows drive cd /mnt (in WSL with desktop, you already havethe mounted windows drive in you explorer)Cd folder name Cd ./Dirto open a folderto return back to folder path that contains the subfoldershow all files and folder in the current path Command ./ to use the command in current folderecho SHELL to find your active shell (tcsh or bash)chsh -s /usr/bin/tcsh to switch to tcsh shellchsh -s /bin/bashto swith to bash shell

other basic commands nal-shortcuts-linux-beginner/7-STaMPS visualization with R & R-studio (Working with the R-based STaMPsvisualization code can be done entirely in windows)7-1 we should first install the R package for windows7-2 we should install the r studio (free version )7-3 Downloading the visualization package written by Thorsten Höser7-4 Extracting a package somewhere in windows (This package can be furtherused by adding an exported file result from StaMPS-Matlab to the extractedfolder- tutorial 2)