ubuntu22.04安装gmtsar

img

GMTSAR 是一款出色的工具,可让您在使用 GMT 的同时分析 SAR 卫星图像。
不过,我仍在学习如何使用它。今天我只介绍一下安装方法。

安装

官方安装教程:https://github.com/gmtsar/gmtsar/wiki

以下是如何在 Ubuntu22.04安装 GMTSAR 的分步说明

安装依赖包

安装GMT

#!/bin/bash
sudo apt install -y csh subversion autoconf libtiff5-dev libhdf5-dev wget liblapack-dev gfortran g++ libgmt-dev gmt-dcw gmt-gshhg gmt

下载 ENIVSAT 的轨道文件

需要下载 ENVISAT 的轨道数据。

#!/bin/bash
sudo mkdir /usr/local/orbits
wget http://topex.ucsd.edu/gmtsar/tar/ORBITS.tar
sudo mv /usr/local/orbits
cd /usr/local/orbits
sudo tar -xvf ORBITS.tar
sudo rm ORBITS.tar

这个数据总共有5.8G,非常大!

GMTSAR源码下载

这次,我们将其安装到/usr/local/GMTSAR 。

#!/bin/bash
cd /usr/local/
sudo git clone --branch 6.3 https://github.com/gmtsar/gmtsar GMTSAR
cd GMTSAR
autoconf
autoupdate
./configure --with-orbits-dir=/usr/local/orbits

GMTSAR 构建

配置完成后,在构建前进行拼写检查。
在 GMTSAR 中编辑config.mk 。

分别在第 75 行和第 76 行将“ -z muldefs ”添加到CFLAGSLDFLAGS 。

img

完成后,只需运行make即可正常构建。

sudo make -j4
sudo make install

更新环境变量

最后,直接进入.bashrc文件加入环境变量,

先进入~路径

cd ~

直接进入编辑.bashrc文件

vim .bashrc


export GMTSAR=/usr/local/GMTSAR
export GMTSAR_csh=/usr/local/GMTSAR/gmtsar/csh
export PATH=$GMTSAR/bin:"$PATH":$GMTSAR_csh 

image-20240820173429972

然后更新一下环境变量。

source ~/.bashrc

测试GMTSAR安装是否成功

输入以下两个代码测试.

p2p_ERS.csh

make_slc_s1a