@@ -12,7 +12,6 @@ function unshift {
12
12
FIRST=` head -1 $FILE `
13
13
tail -n +2 " $FILE " > $HOME /.landsat-queue.swp
14
14
cp $HOME /.landsat-queue.swp $FILE
15
- rm $HOME /.landsat-queue.swp
16
15
echo $FIRST
17
16
}
18
17
28
27
echo " " > $RUNNING
29
28
30
29
if [ ! $1 ]; then
31
- echo -e " \e[33m$dt \e[0m Not specify landsat id, use ~/.landsat-queue instead"
32
- if [ ! -f $QUEUE ]; then
30
+ echo -e " \e[33m$dt \e[0m Not specify landsat id, use ~/.landsat-queue instead. "
31
+ if [ ! -f $QUEUE ]; then
33
32
echo -e " \e[33m$dt \e[0m File not found at $HOME /.landsat-queue, stop."
34
33
exit 0
35
34
else
36
35
LAST=` unshift $QUEUE `
37
- if [ -n " $last " ] && [ ! -d " $OUTPUTDIR /procssed/$LANDSAT " ]; then
36
+ echo $LAST ;
37
+ if [ -n " $LAST " ] && [ ! -f " $OUTPUTDIR /procssed/$LAST /rgb.jpg" ]; then
38
38
LANDSAT=$LAST
39
39
fi
40
40
fi
43
43
fi
44
44
45
45
if [ -z " $LANDSAT " ]; then
46
- echo " \e[31m$dt \e[0m Cannot find any landsat id in queue or argument"
46
+ echo -e " \e[31m$dt \e[0m Cannot find any landsat id in queue or argument"
47
47
exit 1
48
48
else
49
49
echo " $LANDSAT " > $RUNNING
50
50
fi
51
51
52
52
dt=` date ' +%Y-%m-%d %H:%M:%S' `
53
- echo -e " \e[42m$dt Start process $LANDSAT e[0m"
54
- echo -e " \e[32m $dt \e[0m Download"
53
+ echo -e " \e[42m$dt Start process $LANDSAT \ e[0m"
54
+ echo -e " \e[34m $dt \e[0m Download"
55
55
docker run --rm -it -v $OUTPUTDIR :/root/landsat developmentseed/landsat-util:latest landsat download $LANDSAT -b 2345
56
56
57
57
dt=` date ' +%Y-%m-%d %H:%M:%S' `
58
- echo -e " \e[32m $dt \e[0m Process rgb"
58
+ echo -e " \e[34m $dt \e[0m Process rgb"
59
59
docker run --rm -it -v $OUTPUTDIR :/root/landsat developmentseed/landsat-util:latest landsat process /root/landsat/downloads/$LANDSAT
60
60
61
61
dt=` date ' +%Y-%m-%d %H:%M:%S' `
62
- echo -e " \e[32m $dt \e[0m Process NDVI"
62
+ echo -e " \e[34m $dt \e[0m Process NDVI"
63
63
docker run --rm -it -v $OUTPUTDIR :/root/landsat developmentseed/landsat-util:latest landsat process /root/landsat/downloads/$LANDSAT --ndvi
64
64
65
65
dt=` date ' +%Y-%m-%d %H:%M:%S' `
66
- echo -e " \e[32m $dt \e[0m Generate tiles"
66
+ echo -e " \e[34m $dt \e[0m Generate tiles"
67
67
docker run --rm --entrypoint /home/twlandsat/scripts/gdal2tiles.sh -v $OUTPUTDIR :/root/landsat jimyhuang/twlandsat $LANDSAT ${LANDSAT} _bands_432.TIF tiles-rgb
68
68
docker run --rm --entrypoint /home/twlandsat/scripts/gdal2tiles.sh -v $OUTPUTDIR :/root/landsat jimyhuang/twlandsat $LANDSAT ${LANDSAT} _NDVI.TIF tiles-ndvi
69
69
70
70
dt=` date ' +%Y-%m-%d %H:%M:%S' `
71
- echo -e " \e[32m$dt \e[0m Generate preview"
72
- docker run --rm --entrypoint /home/twlandsat/scripts/imagemagick.sh -v $OUTPUTDIR :/root/landsat jimyhuang/twlandsat $LANDSAT ${LANDSAT} _bands_432.TIF -scale 25% rgb.jpg
71
+ echo -e " \e[34m$dt \e[0m Generate preview"
73
72
docker run --rm --entrypoint /home/twlandsat/scripts/imagemagick.sh -v $OUTPUTDIR :/root/landsat jimyhuang/twlandsat $LANDSAT ${LANDSAT} _NDVI.TIF -scale 25% ndvi.jpg
73
+ docker run --rm --entrypoint /home/twlandsat/scripts/imagemagick.sh -v $OUTPUTDIR :/root/landsat jimyhuang/twlandsat $LANDSAT ${LANDSAT} _bands_432.TIF -scale 25% rgb.jpg
74
74
75
75
dt=` date ' +%Y-%m-%d %H:%M:%S' `
76
- echo -e " \e[32m $dt \e[0m Final clear"
76
+ echo -e " \e[34m $dt \e[0m Final clear"
77
77
echo " " > $RUNNING
78
78
if [ -d " $OUTPUTDIR /downloads/$LANDSAT " ]; then
79
79
rm -Rf " $OUTPUTDIR /downloads/$LANDSAT "
0 commit comments