-
Notifications
You must be signed in to change notification settings - Fork 5
/
mt_prep_gmtsar_SM
executable file
·78 lines (63 loc) · 1.76 KB
/
mt_prep_gmtsar_SM
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
# Creator: Xiaopeng Tong, David Sandwell
# Date: July 4th 2013
# Modified by
# NI, 07.10.2019 ([email protected])
# mt_prep gmtsar for SM configuration
region=$1
R=$2
A=$3
ov_R=$4
ov_A=$5
threshold=$6
master_date=$7
suffix=$8
heading=$9
################# grap directory path from param_dir.txt ############
crop_SM=$(grep crop_SM param_dir.txt | sed 's/^.*= //')
raw=$(grep raw_data param_dir.txt | sed 's/^.*= //')
raw_orig=$(grep raw_orig param_dir.txt | sed 's/^.*= //')
topo=$(grep topo param_dir.txt | sed 's/^.*= //')
SLC=$(grep SLC param_dir.txt | sed 's/^.*= //')
#####################################################################
# file input (automatic):
# date_no_master.txt
# intf_SM_list.in
rm -r -f patch_SM cands_SM_*
mkdir patch_SM
cd patch_SM
devide_region.sh $region $R $A $ov_R $ov_A
cd ..
echo "gmtsar" > processor.txt
matlab -nojvm -nosplash -nodisplay < $STAMPS/matlab/ps_parms_initial.m > ps_parms_initial.log
rm -r -f PATCH_*
ln -f -s $topo/master.PRM .
# read azimuth heading angle from the master image
if [ $heading == auto ]; then
heading=$(grep platformHeading $raw_orig/*$master_date*.xml | awk -F"[>||<]" '{print $3}')
fi
p=1
while read region
do
mt_extract_info_gmtsar_SM $raw $raw_orig $topo $heading $master_date
mt_extract_cands_gmtsar_SM $crop_SM $threshold $region $suffix
mkdir -p cands_SM_$p
mv cands_old.grd cands_SM_"$p"/.
mv cands0.grd cands_SM_"$p"/.
mv cands.grd cands_SM_"$p"/.
patch=$(echo PATCH_$p)
mkdir $patch
mv pscands* $patch/.
ln -s -f $PWD/bperp.1.in $patch/.
cd $patch
correct_forum
rm -f swap_pixels.m
cd ..
(( p++ ))
done < patch_SM/PATCH.loc
rsync -av patch_SM/PATCH_* .
cp patch_SM/width.txt .
cp patch_SM/len.txt .
#ln -f -s ../*.in .
ls -d PATCH_* > patch.list
cd ..