-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathprep_orb.sh
executable file
·48 lines (41 loc) · 1.23 KB
/
prep_orb.sh
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
#!/bin/bash
######################################################################
# 02
# script to prepare the precise orbit ephemeris (POEORB)
# GMT5SAR processing for sentinel1A/B
# 2017.02.28 "Noorlaila Hayati"
# email: [email protected] or [email protected]
######################################################################
sen_orbit=$1
raw_org=$2
orb=$3
dir_path=$(pwd)
#rm -f data_orb_$orb.txt
rm -f data_$orb.in
rm -f -r $raw_org/aux_poeorb
shopt -s extglob
IFS=" "
while read dataname date_aqc
do
type=$(echo $dataname | awk '{print substr ($0, 0, 3)}')
if [ $type = "S1A" ]; then
echo "Date: $date_aqc | go to S1A POE"
cd $sen_orbit/S1A
elif [ $type = "S1B" ]; then
echo "Date: $date_aqc | go to S1B POE"
cd $sen_orbit/S1B
else
echo "$type is unknown"
fi
yesterday=$( date -d "${date_aqc} -1 days" +'%Y%m%d' )
orb_fix=$(grep -r -l V"$yesterday"T | head -1)
ln -s $sen_orbit/"$type"/"$orb_fix" $raw_org/.
#cd $raw_org
#ls *.EOF > data_orb.txt
#mv data_orb.txt $dir_path
#write data.in
cd $raw_org
tiffname=$(find -name "*$date_aqc*.tiff" -print | sed 's/^..//' | sed -e 's/\.tiff$//')
cd $dir_path
echo "$tiffname":"$orb_fix" >> data_$orb.in
done < data_"$orb"_grub.txt