Geophysics Deskwork

Scott's Non-Field Notebook

ROI_PAC ON_MAC

What is it?

ROI_PAC is software for processing Interferometeric Synthetic Aperture Radar (InSAR) data. For general info about InSAR see this. The last major ROI_PAC update was in August 2009, since development focus seems to have moved to ISCE software. Nevertheless, it is still widely used and will likely continue to be for some time!

This post walks you through installing an up-to-date version on ROI_PAC on a modern Mac (e.g my Macbook Pro from 2010 w/ OSX 10.9.1). The target audience is people who are familiar with ROI_PAC, but since the software can be acquired for free ( for research & academic uses), I hope this will be useful for anyone wanting to try out InSAR processing. Note that this will get you up and running, but if you're looking for more information on how to use the software I recommend short-courses hosted by UNAVCO.

The ROI_PAC wiki does have some older notes on installation, but the recipe below is recent (Feb. 2014). In the end, you'll be set-up to process ERS, Envisat, ALOS, and TSX data.

Download the software

From here. You should have:

  1. ROI_PAC_3_0_1.tar
  2. roi_pac_testdir.tar

Before you begin

Note that ROI_PAC itself takes up < 100Mb of space, but orbit files for ERS and Envisat are ~3Gb, and individual interferograms take up 1-10Gb depending on the size of data and processing resolution. Point being, make sure you have a spacious drive to work with ROI_PAC.

Prepare your computer

You're going to need C and Fortran compilers, and some other non-standard libraries. Apple versions of these can be installed from the terminal with:

xcode-select --install

For non-apple stuff the slickest package manager seems to currently be Homebrew. If you're familiar with Fink and Macports, it is very similar. Install it with:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

Before continuing, I recommend familiarizing yourself with how Homebrew works. Now you can easily install an up-to-date fortran compiler:

brew install gfortran

We'll be using Homebrew again to install stuff if you want to use MDX or Roiview visualization software on the Mac. You can now extract the ROI_PAC source and start installing!

tar -xvf ROI_PAC_3_0_1.tar
cd /Users/scott/Software/ROI_PAC_3_0_1/ROI_PAC
./contrib/install-fftw.sh

Hopefully that succeeds and you can now assign the following environment variables:

export FFTW_LIB_DIR=/Users/scott/Software/ROI_PAC_3_0_1/ROI_PAC/NetInst/fftw-140203-1620/lib
export FFTW_INC_DIR=/Users/scott/Software/ROI_PAC_3_0_1/ROI_PAC/NetInst/fftw-140203-1620/include

NOTE that fftw-140203-1620 will change according to today's date and time. Next you compile ROI_PAC. ./contrib/multibuild.sh is designed to try a whole bunch of compiler options. For mac, we only want to try gfortran, so you can delete the relevant lines at the bottom of multibuild.sh or I've posted a copy of the modified file here. Now run:

./contrib/multibuild_mod.sh

You should see this output: Build >gfortran64< succeeded. Great! Now make sure you can process data:

mkdir test-runs
cd test-runs
../contrib/multitest.sh ../roi_pac_testdir.tar ./multibuild-140203-1629/installs/share/roi_pac/ ./multibuild-140203-1629/installs/gfortran/bin ./multibuild-140203-1629/installs/gfortran64/bin

You'll have to change the paths for the multitest.sh command. It tries to process test data with each compiled version of ROI_PAC, and it keeps track of how long it takes to run things. tail -7 */TEST_DIR/batchlog* > summary_log.out will give you something like the following output:

==> gfortran/TEST_DIR/batchlog-140203-1743 <==
+process_2pass.pl That's all folks

real    10m18.709s
user    9m37.598s
sys     0m18.208s
+ date
Mon Feb  3 17:54:42 EST 2014

==> gfortran64/TEST_DIR/batchlog-140203-1946 <==
+process_2pass.pl That's all folks

real    10m34.378s
user    9m57.075s
sys     0m21.314s
+ date
Mon Feb  3 19:57:15 EST 2014

You can see that the 32-bit version ran just a bit faster than the 64-bit version. Since software/hardware seems to be moving in the 64 bit direction, we’ll use gfortan64 compiled executables:

cd ../
mkdir INT_BIN
cp multibuild-140203-1629/installs/gfortran64/bin/* INT_BIN

Finally, edit the configuration file SAR_CONFIG as described here. Or use my copy here as a template. Success! ROI_PAC is now working. But if you want it to be really useful, you have to download precise orbit files and special add-ons for each satellite. The sections below make sure you've got what you need for processing ERS, Envisat, ALOS, and TSX data.

Satellite-Specific Set-up

ERS1 & 2

" E uropian R emote-Sensing S atellite". Details here. This data is commonly obtained through EOLi. Lots of processing tips are on the ROI_PAC wiki ERS page. Usually, you'll want to process data with precise orbit files:

PRC Orbits

These are precise orbits Contact the ESA Earth Observation Help Desk to get the download information. Select OrbitType=PRC to process with these orbits.

ODR Orbits

"Orbital Data Records". Second source of precise orbits from Delft University. Need getorb program installed to use.

tar -xzvf getorb_2.3.2.tar
cd getorb

edit the Makefile to set FC=gfortran and BIN_DIR=$INT_BIN, then run:

make install

Be sure to download the actual orbit files through the Delft Institute for Earth-oriented Space Research (DEOS) website. In SAR_CONFIG, set SAR_ODR_DIR=path-to-downloaded-files. Select OrbitType=ODR to process with these orbits.

HDR Orbits

If you don't have PRC or ODR, use the defaults that come with metadata in file headers. Select OrbitType=HDR to process with these orbits.

Envisat

" Envi ronmental Sat ellite ". Details here. This data is commonly obtained through EOLi. Lots of processing notes are on the ROI_PAC wiki Envisat Page. Similar to ERS, precise orbits can be downloaded via FTP by contacting the ESA Earth Observation Help Desk to get the download information. Unlike ERS, you need to obtain separate orbit files to processes the data:

VOR Orbits

In your .proc file, set OrbitType=VOR to process with these orbits.

POR Orbits

In your .proc file, set OrbitType=POR to process with these orbits.

ALOS-1

" A danced L and O observation S satellite ". Details here. Data searched for here and obtained here. Lots of processing notes are on the ROI_PAC wiki Envisat Page. You need scripts to pre-process ALOS data before it is ingested into the ROI_PAC processing chain. Instructions follow:

  1. Download an updated make_raw_alos.pl script. And add it to $INT_SCR

  2. Download and compile ALOS pre-processing codes (~28Mb)

    cd alos_preproc tar -xvf ALOS_preproc_040910.tar make mkdir $INT_BIN/MY_BIN export $MY_BIN=$INT_BIN/MY_BIN mv ./bin/i386/* $MY_BIN

  3. Add $MY_BIN variable to SAR_CONFIG

I've recently created some useful scripts for working with ALOS data which you can find here.

TerraSAR-X & Tandem-X

Details on the German Space Agency Website. Data can be searched and ordered here. Lots of processing notes are on the ROI_PAC wiki TSX Page.You need scripts to pre-process TSX data before it is ingested into the ROI_PAC processing chain. Instructions follow:

On the ROI_PAC wiki you can get a file called sar-0.4.tar.gz here, which includes C++ parses for several satellites. Alternatively, tsx_parser contains Python code that is a bit easier to use, which you install in the following way:

tar -xzvf tsx_parser.tar.gz
cd tsx_parser/src
make
cd ../
mv src/doppler src/cosar get_height.pl make_slc_tsx.csh $MY_BIN

I have some of my own small utilities for working with TSX data posted here

Comments