Getting ROI_PAC

ROI_pac is copyrighted software that requires a license. Licenses are available at no charge for non-commercial use from Open Channel Foundation

Installation

The new release (v. 3.0.1) has a very different installation system compared to releases before v. 3.0. The easiest way to build it is explained in the ROI_PAC_3_0_1/ROI_PAC/AAREADME_BUILD_ROIPAC file.

1. Expand Archive

Uncompress and untar the archived file.

% tar -xzf ROI_PAC_3_0_1.tgz

2. Read the documentation

Read through the text file ROI_PAC_3_0_1/AAREADME and the additional documentation found in ROI_PAC_3_0_1/ROI_PAC/DOC. The instructions for installing the software and running the scripts are described in ROI_PAC_3_0_1/ROI_PAC/DOC/Setup and ROI_PAC_3_0_1/ROI_PAC/AAREADME_BUILD_ROIPAC. The most important steps are summarized below.

% cd ROI_PAC_3_0_1
% less AAREADME

3. Compile Executables

Follow the instructions in the file ROI_PAC_3_0_1/ROI_PAC/AAREADME_BUILD_ROIPAC. Copy and paste each command individually into a shell. These commands will build and test the software package for multiple compilers. If problems are encountered, refer to the bottom of AAREADME_BUILD_ROIPAC for platform specific issues or look through prior posts on the forum at Open Channel Foundation. To see what shell you are using, type echo $SHELL on the command line.

% cd ROI_PAC_3_0_1/ROI_PAC
% less AAREADME_BUILD_ROIPAC
% which ifort g95 f90 pgf95 f95 xlf gfortran cc gcc icc
% touch aclocal.m4 Makefile.in configure
% ./contrib/install-fftw.sh CC=cc
% export FFTW_LIB_DIR=/software/ROI_PAC_3_0_1/ROI_PAC/NetInst/fftw-071005-1457/lib
% export FFTW_INC_DIR=/software/ROI_PAC_3_0_1/ROI_PAC/NetInst/fftw-071005-1457/include
% ./contrib/multibuild.sh
etc.

When testing the build, you will need to gunzip the provided test data set prior to running the script multitest.sh.

% ls
ROI_PAC_3_0_1             ROI_PAC_3_0_1.tgz         roi_pac_testdir.tar.gz
% gunzip roi_pac_testdir.tar.gz
% cd ROI_PAC_3_0_1/ROI_PAC/test-runs
% ../contrib/multitest.sh /full_path/roi_pac_testdir.tar  /full_path/ROI_PAC_3_0_1/ROI_PAC/multibuild-071005-1506/installs/share/roi_pac  /full_path/ROI_PAC_3_0_1/ROI_PAC/multibuild-071005-1506/installs/defaults/bin  /full_path/ROI_PAC_3_0_1/ROI_PAC/multibuild-071005-1506/installs/gfortran/bin

Each test run should take ~40 minutes depending on your computer. If the test fails while processing the DEM contained in roi_pac_testdir.tar, you may have to manually swap this DEM file with one that has the proper byte order for your machine (i.e., little-endian versus big-endian, see TEST_DIR/AAREADME). If the test is successful, the finished product is the file geo_930110-950523.unw which should be buried within the directory structure (check in test-runs/defaults/TEST_DIR/int_930110_950523). You can view the image file using the program mdx, if you already have it installed. Otherwise, you can try to view the file with a different program that can display binary image files (i.e., Matlab, ENVI, ERmapper). The file is composed of floating point values in a band-interleave format, i.e. alternating lines of magnitude and phase. The size of the file should be just under 10 MB. The meta-data for the file can be found in geo_930110-950523.unw.rsc. If you have progressed this far, congratulations! You have a working version of ROI_PAC.

4. Install Executables

Make a new directory called INT_BIN where you will deposit the final executables.

% mkdir ROI_PAC_3_0_1/ROI_PAC/INT_BIN

You can copy the set of executables from the multi-build operation. Choose one of the successful builds found in ROI_PAC_3_0_1/ROI_PAC/multibuild*/installs.

% cd ROI_PAC_3_0_1/ROI_PAC/multibuild*/installs/defaults/bin
% cp * ROI_PAC_3_0_1/ROI_PAC/INT_BIN/.

<!> If you plan to use ODR orbit files, then the getorb executable (installed separately) must be located in INT_BIN. You can copy the executable into this directory or make a symbolic link.

<!> After finishing this step, please check the Patches page to review/install any version specific corrections.

5. Configure SAR_CONFIG

Read the instructions in ROI_PAC_3_0_1/ROI_PAC/DOC/SAR_CONFIG. Copy this file into the directory ROI_PAC_3_0_1/ROI_PAC and edit the appropriate lines. You will have to source this file every time that you want to use ROI_PAC. It will set your path environment so that the necessary scripts will be available on the command line.

% cp ROI_PAC_3_0_1/ROI_PAC/DOC/SAR_CONFIG ROI_PAC_3_0_1/ROI_PAC/.
% vi ROI_PAC_3_0_1/ROI_PAC/SAR_CONFIG
(edit paths)
% source SAR_CONFIG

In addition to the paths to ERS orbit files (SAR_PRC_DIR and SAR_ODR_DIR) or Envisat orbit files (POR_DIR and VOR_DIR), you will also need to define the INT_BIN and INT_SCR directories. To do this, add the following lines to SAR_CONFIG.

export INT_BIN="/full_path/ROI_PAC_3_0_1/ROI_PAC/INT_BIN"
export INT_SCR="/full_path/ROI_PAC_3_0_1/ROI_PAC/INT_SCR"

Instead of using export for the bash shell, use the setenv syntax if you are using the csh or sh shell. You can also add the path to mdx, getorb, or other related software that you might install.

export MDX="/software/mdx/bin"
export FFTW_LIB="/software/ROI_PAC_3_0_1/NetInst/fftw-071005-1457/lib"
export PATH="$PATH:$INT_BIN:$INT_SCR:$MDX"

6. Update Path To Perl

The path to the perl executable may be different on your machine than is used in the ROI_PAC scripts. You can check if this step is necessary by comparing the paths in the following outputs:

% cd ROI_PAC_3_0_1/ROI_PAC/INT_SCR
% grep perl make_raw.pl
#!/usr/bin/perl
% which perl
/usr/bin/perl

The example shown above shows that no changes are necessary. If the paths are different, there is a simple script in ROI_PAC_3_0_1/ROI_PAC/INT_SCR that will edit this path for you in all of the perl scripts.

% cd ROI_PAC_3_0_1/ROI_PAC/INT_SCR
% chgperlpath.pl

7. Celebrate

You are now ready to process your own SAR data. Create a workspace where you will process future data. You may also want to create a new directory elsewhere on your system where you can archive your DEM and orbit files. Update SAR_CONFIG with the new location of the orbit files. Remember to source your SAR_CONFIG in each new shell before you start to process data. Alternatively, you can add a line to the file that initializes your shell environment upon startup (such as .cshrc or .bash_profile).

ROI_pac test data

Some people have recently had trouble downloading the test data (partial ERS scene from the Mojave Desert of California) from Open Channel, so a copy is available here (186 MB download).

Some notes on compiling ROI_PAC for Mac

I recently compiled ROI_PAC on a 64-bit Mac (OS 10.6.8, little endian). Here are notes on the procedure, updated with information about 10.7 and higher.

1. Obtain Compilers

The MacOS X operating system does not include any compilers by default. In order to obtain compilers, you must install XCode, which is the Mac “developer” software. The version of XCode (4.2.x) for Snow Leopard (10.6.x) was not available for free – it was $99 if you don’t already have a license. The older XCode (3.2.x) was free, but is no longer downloadable. If you can obtain a .dmg for XCode 3.2.x, this can be installed for free.

Starting with the Lion (OSX 10.7) operating system in 2012 and continuing in Mountain Lion (10.8), there is a new Xcode installation system through the Mac App Store for free (see https://developer.apple.com/xcode/). With the Mac App Store version of Xcode (now Xcode 4.6), you have to additionally install the "command line developer tools" to be able to compile ROI_pac. More details can be found on the MacPorts page http://www.macports.org/install.php.

All versions of XCode include a gcc compiler. Therefore, simply installing any version of XCode will allow you to install and compile the FFTW library. However, you will get stuck after this point if you have not also installed a separate fortran compiler (in other words, no Fortran compiler is included with Apple XCode). The following website has resources for installing gfortran:

http://r.research.att.com/tools/

The first .dmg (4.2.3) on the website will not work with XCode – you will not be able to get ROI_PAC to link to FFTW during compilation if you install gfortran4.2.3. You must instead install the gfortran-42-5xxx version of gfortran (whichever matches your XCode version).

Another option is to install the MacPorts system from http://www.macports.org/ and then use it to install a complete version of the GNU Compiler Collection that includes the gfortran compiler. (You still need to install Xcode first.) You also need to select the MacPorts version of the GNU Compiler Collection after installing it. For example, to install and select GCC4.4 when you have MacPorts installed:

sudo port install gcc44 
sudo port select gcc gcc44

The MacPorts system will automatically determine your operating system and Xcode version to install a compatible compiler collection, although it may need to build it on your computer which can take an hour or more.

2. Build Without Multibuild

I found that building ROI_PAC with these compilers was easier without using multibuild.sh. Following the instructions in /ROI_PAC_3_0_1/ROI_PAC/INSTALL, I did the following:

% cd /ROI_PAC_3_0_1/ROI_PAC/
% LDFLAGS=-L/$FFTW_LIB_DIR F77=gfortran ./configure --prefix=/ROI_PAC_3_0_1/ROI_PAC/INT_BIN
% mkdir /ROI_PAC_3_0_1/ROI_PAC/INT_BIN
% sudo make 
% sudo make install 

I found that specifying the fortran compiler was necessary, as was setting the “LDFLAGS” option (even though $FFTW_LIB_DIR was already exported). Finally, I put the “prefix” option in order to direct the executables to INT_BIN (otherwise I’m not sure where they would end up). After this, I proceeded with the instructions above to set up SAR_CONFIG and so forth.

Installation (last edited 2014-05-20 18:40:15 by Susanna Gross)