8000 Home · gmtsar/gmtsar Wiki · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Xiaohua(Eric) Xu edited this page Feb 20, 2025 · 39 revisions

Installation of GMT and GMTSAR with Homebrew

  1. Download and install orbit files in /usr/local/orbits:
http://topex.ucsd.edu/gmtsar/tar/ORBITS.tar
sudo -i
cd /usr/local
mkdir orbits
cd orbits
tar -xvf ~/Downloads/ORBITS.tar # (need full path to ORBITS.tar)
  1. Install stable version 6.5 with Homebrew (now working with M1 Mac)
xcode-select --install
brew tap dsandwell/homebrew-insar
brew install wget
brew install gmtsar  
  1. If you wish to build from source, install dependencies with Homebrew first. Follow the steps here to install GMT (https://docs.generic-mapping-tools.org/dev/install.html#install-via-homebrew) Then download configure and build GMTSAR from the source, some of the dependencies are
brew install cmake ninja curl netcdf
brew install ghostscript gdal geos pcre2 glib fftw
brew install graphicsmagick ffmpeg (optional)

Installation of GMT and GMTSAR with package managers and GITHUB

  1. Install extra libraries. Note that depending on your OS version the actual version numbers in some of the packages below may differ). The libraries below may require other libraries; use sudo apt[-get] install -y to automatically select yes.
  • Ubuntu 16.06 LTS:
sudo apt-get install csh subversion autoconf libtiff5-dev libhdf5-dev wget
sudo apt-get install liblapack-dev
sudo apt-get install gfortran
sudo apt-get install g++
sudo apt-get install libgmt-dev
sudo apt-get install gmt-dcw gmt-gshhg (16.0 LTS)
sudo apt-get install gmt
  • Ubuntu 20.04 LTS or later:
sudo apt-get install csh subversion autoconf libtiff5-dev libhdf5-dev wget
sudo apt-get install liblapack-dev
sudo apt-get install gfortran
sudo apt-get install g++
sudo apt-get install libgmt-dev
sudo apt-get install gmt-dcw gmt-gshhg
sudo apt-get install gmt
  • CentOS 7:
sudo yum install svn autoconf gcc-c++ libtiff-devel hdf5-devel wget
sudo yum install gmt
  • RHEL 9:
sudo dnf install svn autoconf gcc-c++ libtiff-devel hdf5-devel wget git 
sudo dnf install GMT-devel.x86_64
  • Fedora 23:
sudo yum install csh subversion autoconf  gcc-c++ libtiff-devel hdf5-devel wget
(need fftw-developer for faster execution.)
sudo yum install gmt
  1. If you need 64EE to process ERS or ENVISAT data (1992-2011), download and install orbit files and place in suitable directory (e.g., /usr/local/orbits, and specify this path in step 4 with configure):
http://topex.ucsd.edu/gmtsar/tar/ORBITS.tar
sudo -i
cd /usr/local
mkdir orbits
cd orbits
tar -xvf ~/Downloads/ORBITS.tar # (need full path to ORBITS.tar)
  1. Download GMTSAR GITHUB suitable directory:
sudo -i
cd /usr/local
git clone --branch 6.5 https://github.com/gmtsar/gmtsar GMTSAR
#   or
#   checkout the master version for more new but not stable features. 
git clone https://github.com/gmtsar/gmtsar GMTSAR
#   or for UBUNTU 14, 16 where only gmt5 is available, use V5.8
git clone --branch 5.8 https://github.com/gmtsar/gmtsar GMTSAR
exit

#  make youself the owner of this directory
cd /usr/local
sudo chown -R $USER GMTSAR
  1. Make and install GMTSAR (change the orbits directory if different):
cd GMTSAR
autoconf
autoupdate
./configure --with-orbits-dir=/usr/local/orbits

For Ubuntu 21.04 or later and RHEL 9, use ./configure --with-orbits-dir=/tmp CFLAGS='-z muldefs' LDFLAGS='-z muldefs' instead. Then continue to run

make
make install
  1. Add the executables to your path (for csh or tcsh):
cd ~
#
#   edit your .tcshrc file and add the following lines
#
        setenv GMTSAR /usr/local/GMTSAR
        setenv PATH $GMTSAR/bin:"$PATH"

or

cd ~
#  edit your .bashrc file and add the following lines
        export GMTSAR=/usr/local/GMTSAR
        export PATH=$GMTSAR/bin:"$PATH"
  1. Test your installation. Open a new terminal window and run the following commands. Expected outputs are
% esarp
esarp [GMTSAR] - Produce SAR processed image

Usage: esarp filein.PRM fileout.SLC [R4]

% phasediff
phasediff [GMTSAR] - Compute phase difference of two images

Usage: phasediff ref.PRM rep.PRM [-topo topo_ra.grd] [-model modelphase.grd]
 (topo_ra and model in GMT grd format

% p2p_processing.csh

Usage: p2p_processing.csh SAT master_image aligned_image [configuration_file] 

Example: p2p_processing.csh ALOS IMG-HH-ALPSRP055750660-H1.0__A IMG-HH-ALPSRP049040660-H1.0__A [config.alos.txt]

    Put the data and orbit files in the raw folder, put DEM in the topo folder
    The SAT needs to be specified, choices with in ERS, ENVI, ALOS, ALOS_SLC, ALOS2, ALOS2_SCAN
    S1_STRIP, S1_TOPS, ENVI_SLC, CSK_RAW, CSK_SLC, TSX, RS2, GF3

    Make sure the files from the same date have the same stem, e.g. aaaa.tif aaaa.xml aaaa.cos aaaa.EOF, etc

    If the configuration file is left blank, the program will generate one 
    with default parameters 

Installing Ubuntu virtual machine with GMTSAR pre-installed

  1. Download VirtualBox or VMware, or any virtual machine that could load the .ova format (1.0).
  2. Download the Ubuntu VM that has GMTSAR and all dependencies (including GMT) installed. http://topex.ucsd.edu/gmtsar/tar/Ubuntu20.0_GMTSAR6.1.ova
  3. Load the VM into your VirtualBox or VMware, and start the system. The password is gmtsar
  4. Open a terminal and type esarp, you should see the following message popping out.
esarp [GMTSAR] - Produce SAR processed image
Usage: esarp filein.PRM fileout.SLC [R4]
  1. The current system has 8GB RAM and 50GB disk space allocated. To acquire more, use your VirtualBox/VMware settings to allocate more or extend disks with shared folders or external disks.
  2. To update the version of GMTSAR in the virtual machine, you may run git pull, git switch 6.5, make spotless, then start from step 4) above to re-compile the code.
Clone this wiki locally
0