-
Notifications
You must be signed in to change notification settings - Fork 0
/
Intarsis_01_file_preparation
executable file
·60 lines (43 loc) · 1.5 KB
/
Intarsis_01_file_preparation
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
#!/bin/bash
# FILES IN TOP FOLDER: SAFE_filelist pins.ll
# MAKE SURE THAT YOUR $HOME/.cshrc contains the following aliases:
# alias wgetasf 'wget --http-user=username --http-password=pass'
DEM=$(grep dem_filename intarsis.config | awk '{print $2}')
if grep -q wgetasf $HOME/.cshrc ; then
echo "Found wgetasf alias in your $HOME/.cshrc file, should be able to download ASF data"
else
echo "Not found wgetasf alias in your $HOME/.cshrc file, please read Intarsis documentation"
exit
fi
#check for DEM in folder
if [ ! -f $DEM ]; then
echo "DEM is missing, please set up intarsis.config and try again"
exit
fi
#Check for pins.ll file
if [ ! -f pins.ll ]; then
echo "pins.ll file is missing. Create in the program's folder and try again"
exit
fi
# Check for SAFE_filelist
if [ ! -f SAFE_filelist ]; then
echo "SAFE_filelist file is missing. Create a SAFE_filelist containing full path to all SLC folers and try again"
exit
else
sed -i 's/SAFE\//SAFE/g' SAFE_filelist # To remove trail / from each line.
fi
echo "$(date "+%d/%m/%y %H:%M") - Run directory preparation" > intarsis.log
mkdir data topo
cp $DEM topo/dem.grd
cp pins.ll data/
cp SAFE_filelist data/
if [ -f orbits.list ]; then
ln -s orbits.list data/orbits.list
fi
cd data
organize_files_tops_linux.csh SAFE_filelist pins.ll 1
organize_files_tops_linux.csh SAFE_filelist pins.ll 2
# Update log & create control files
touch .intarsis_folder
touch .intarsis_step01
echo "$(date "+%d/%m/%y %H:%M") - Finished directory preparation" > intarsis.log