-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.csh
34 lines (29 loc) · 802 Bytes
/
main.csh
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
#!/bin/csh
# Process sentinel-2 mutispectral image.
# Preparaion:
# create folder: raw/ and put all image in it
# setup
set a="raw/*.zip"
set bat="graph/batch.xml"
set out_folder="$PWD/process"
set gpt="/home/junyanchen/opt/snap/bin/gpt"
# subset
set N="23.249"
set W="120.452"
set S="23.039"
set E="120.746"
set region="POLYGON(($W $S, $W $N, $E $N, $E $S, $W $S ))"
foreach file ($a)
set target = `echo $file | sed "s\zip\_subset_mndwi.dim\g"`
set outname="$out_folder/$target"
echo outname
cat $bat | sed "s\IN_FILE.zip\$PWD/$file\g" | sed "s\OUT_FILE.dim\$outname\g" | sed "s\POLYGON\$region\g" > tmp_graph.xml
echo ""
echo ""
echo ""
echo "================================"
echo $file
echo "================================"
gpt tmp_graph.xml
end
rm tmp_graph.xml