UNAVCO Short Course - June, 2013 HOMEWORK 1 - UNIX and csh/tcsh We will use UNIX commands for all InSAR processing so one should be able to do the basics. The following web site has a tutorial. http://www.ee.surrey.ac.uk/Teaching/Unix/ Go through each tutorial unless your are already a UNIX whiz. You will need to have a basic text editor available for this exercise. Common UNIX text editors are vi or emacs. The following web site has an extensive list. http://en.wikipedia.org/wiki/List_of_text_editors Note that to do this exercise your computer must have the C-shell installed as well as a C-compiler installed. If you have trouble with these installations please send e-mail questions. Tutorial 8 is especially important. Each type of unix will have slight variations in the .tcshrc or .cshrc file. The default shell on many systems today is bash. However, GMTSAR is based entirely on the tcsh/csh shell so make sure this is your default shell. After going throughout the tutorial and setting up your .tcshrc or .cshrc file, please send me a copy of that file with embedded comments on your custom additions. HOMEWORK 2 - Generic Mapping Tools (GMT) Remove old versions of NETCDF and GMT4 from your computer unless you are 100% sure you have the latest complete installation including the source code. Many problems related to the installation of GMTSAR are due to having an old installations of GMT. Installations can be done in a variety of ways. Here is a web page describing the installation options. http://gmtrac.soest.hawaii.edu/projects/gmt/wiki/Download MAC OS X On a Mac you can use macports or fink to install GMT4. sudo port uninstall gmt4 sudo port uninstall netcdf sudo port install gmt4 Make a note of the path to NETCDF and GMT. On my mac computer using macports, the paths to NETCDF/GMT are: /opt/local/include/netcdf.h /opt/local/lib/libnetcdf.a /opt/local/lib/gmt4/include/gmt.h /opt/local/lib/gmt4/lib/libgmt.a Add the following lines to your .cshrc/.tcshrc file and later these lines will also go into the gmtsar_config file. setenv GMTHOME /opt/local/lib/gmt4 setenv NETCDFHOME /opt/local You also need to add to the executable search path in your .tcshrc file as well as logout/login to have this take effect. setenv PATH ./:$GMTHOME/bin:"$PATH" FEDORA UNIX On a computer using Fedora UNIX you must first install tcsh then gmt4. su root # yum install tcsh # yum install netcdf-devel # yum install gmt-devel Then setup the paths in your .tcshrc setenv GMTHOME /usr setenv NETCDFHOME /usr setenv PATH ./:$GMTHOME/bin:"$PATH" UBUNTU UNIX On a computer using Ubuntu UNIX you must first install tcsh then gmt. sudo apt-get install tcsh sudo apt-get install gmt sudo apt-get install libgmt.dev Then setup the paths in your .tcshrc. setenv GMTHOME /usr/lib/gmt setenv NETCDFHOME /usr setenv PATH ./:$GMTHOME/bin:"$PATH" Also, to change the default shell to csh or tcsh: sudo usermod -s /bin/tcsh You'll be prompted with a password. Logout and then log back in and check to see that terminal opens with tcsh. LEARN GMT To make sure everything is working properly, you must close all your terminal windows and make new ones. Make sure you are running csh/tcsh in each window by typing the command csh or tcsh. Then type the command grdinfo to make sure the GMT programs are in your path. GMTSAR If you are not familiar with GMT, then go through the GMT Tutorial at the following web site. http://gmt.soest.hawaii.edu/gmt/html/GMT_Tutorial.html The last part of this exercise is to make a map of the area where you live using topography data from the following web site. http://topex.ucsd.edu/gmtsar/demgen/ Use this on-line tool to extraxt a 1-degree grid of elevations for the area where you live. Use gmt to make a shaded relief map and send the resulting postscript file. This same tool will be used to prepare digital elevation models for InSAR processing. HOMEWORK 3 - GMTSAR The last assignment before the workshop has 3 parts. Part 1 is to install Google Earth. Part 2 is to read the review paper by Burgmann et al., 2000. Here is the link. ftp://topex.ucsd.edu/pub/gmtsar/Burgmann_ANNREV2000.pdf Part 3 is to install GMTSAR. Go to the following web site and download the software GMTSAR.tar file, the documentation, and the orbit files. If your connection is slow you can do the orbits later. Orbits are needed for ERS and ENVISAT processing but not ALOS. http://topex.ucsd.edu/gmtsar Make a note of the UNIX path to these files. I usually have downloads go to the desktop. /Users/sandwell/desktop There is an installation video at the GMTSAR site but things have changed so you can't follow the directions exactly. Make a directory to put this code as well as the orbit files. I recommend /usr/local but you can put them anywhere. % sudo mkdir /usr/local/gmtsar % sudo mkdir /usr/local/orbits Also make sure you own these directories. sudo chown -R your_user_name gmtsar sudo chown -R your_user_name orbits 1) Unpack the GMTSAR tar file. % cd gmtsar % tar xvf /Users/sandwell/desktop/GMTSAR.tar Note there is a file called gmtsar_config_mac or gmtsar_config_fedora. Edit that file and make the required changes. This file is probably OK for FEDORA but may need some modifications for UBUNTU. 2) Make sure the GMTHOME, NETCDFHOME, GMTSARHOME, and ORBITS are set correctly. For example if your followed the HW2 to install GMT and NETCDF, you would set the environment variables as follows: setenv GMTHOME /opt/local/lib/gmt4 setenv NETCDFHOME /opt/local setenv GMTSARHOME /usr/local/gmtsar setenv ORBITS /usr/local/orbits 3) Go to your home directory and edit your .tcshrc file to source this gmtsar_config_* file. Put this line near the end of the .tcshrc file so every time you get a new csh, this happens source /usr/local/gmtsar/gmtsar_config_* 3) Close ALL your open terminal windows and start terminal again. Type csh if needed. Type printenv and make sure the following are defined. % printenv GMTSARHOME=/usr/local/GMTSAR GMTSAR=/usr/local/GMTSAR/gmtsar ALOSPRE=/usr/local/GMTSAR/ALOS_preproc ENVIPRE=/usr/local/GMTSAR/ENVISAT_preproc ERSPRE=/usr/local/GMTSAR/ERS_preproc ORBITS=/usr/local/orbits 4) % cd /usr/local/gmtsar % make 5) type % rehash and then % esarp Usage: esarp filein.PRM fileout.SLC [R4] Also type % gmtsar.csh % ALOS_baseline If any of these programs don't run then either things did not compile correctly or the PATH is not set correctly. 6) Go back to the GMTSAR page and download the ALOS data. You can unpack this data anywhere. Pick a place where you want to keep your InSAR results. 7) Execute the command in the README. p2p_ALOS.csh IMG-HH-ALPSRP207600640-H1.0__A IMG-HH-ALPSRP227730640-H1.0__A config.alos.txt If all goes well after about 40 minutes you will have results in the intf/* directory. Look at the *.ps files. If you have ghostscript (gs) installed then you may also have some *.kml and *.png files to view in Google Earth. At the workshop we'll go through some more examples. The file config.alos.txt contains instructions on how to process the data. There is a lot more information in the GMTSAR documentation on the web site. We will cover a lot of this material during the workshop.