Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GeoSentinel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mario Chirinos Colunga
GeoSentinel
Commits
9fc4e086
Commit
9fc4e086
authored
May 23, 2018
by
Mario Chirinos Colunga
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GDAL_PAM_ENABLED=NO
parent
f2af3208
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
50 deletions
+54
-50
productListToNDVI.sh
tools/productListToNDVI.sh
+54
-50
No files found.
tools/productListToNDVI.sh
View file @
9fc4e086
...
...
@@ -5,55 +5,59 @@ OUTDIR=$2
WINDOW
=
$3
count
=
1
ext
=
.jpg
cd
$BASEDIR
for
f
in
$(
find
.
-type
f
-name
'*.zip'
)
do
BOX
=
$(
python3
"
$HOME
/git/GeoSentinel/geosentinel/polygonToBox.py"
"
$3
"
)
echo
$BOX
filepattern
=
$(
echo
$f
|
cut
-d
"_"
-f6
)
"_"
$(
echo
$f
|
cut
-d
"_"
-f3
)
"_B"
filename
=
$OUTDIR$filepattern
echo
$filename
if
[
!
-e
$filename
"04.jp2"
]
;
then
#cd $BASEDIR
unzip
-n
-j
$f
*
B04.jp2
-d
$OUTDIR
fi
#for f in $(find . -type f -name '*.zip')
#do
if
[
!
-e
$filename
"08.jp2"
]
;
then
# filepattern=$(echo $f | cut -d"_" -f6)"_"$(echo $f | cut -d"_" -f3)"_B"
# filename=$OUTDIR$filepattern
# echo $filename
# if [ ! -e $filename"04.jp2" ]; then
unzip
-n
-j
$f
*
B08
.jp2
-d
$OUTDIR
fi
# unzip -n -j $f *B04
.jp2 -d $OUTDIR
#
fi
# if [ ! -e $filename"08.jp2" ]; then
cd
$OUTDIR
NIR
=
$(
ls
$filepattern
"08.jp2"
-t
|head
-1
)
VIR
=
$(
ls
$filepattern
"04.jp2"
-t
|head
-1
)
# unzip -n -j $f *B08.jp2 -d $OUTDIR
# fi
echo
"NIR-"
$NIR
echo
"VIR-"
$VIR
#
# cd $OUTDIR
# NIR=$(ls $filepattern"08.jp2" -t |head -1)
# VIR=$(ls $filepattern"04.jp2" -t |head -1)
if
[
!
-d
"ndvi"
]
;
then
mkdir
ndvi
fi
# echo "NIR-"$NIR
# echo "VIR-"$VIR
fileout1
=
$(
echo
$filepattern
|
cut
-d
"_"
-f1
)
fileout2
=
$(
echo
$filepattern
|
cut
-d
"_"
-f2
)
# if [ ! -d "ndvi" ]; then
# mkdir ndvi
# fi
if
[
!
-e
ndvi/
$fileout2
"_"
$fileout1
".tiff"
]
;
then
python3
$HOME
/git/GeoSentinel/geosentinel/ndvi.py
$NIR
$VIR
ndvi/
$fileout2
"_"
$fileout1
".tiff"
fi
# fileout1=$(echo $filepattern | cut -d"_" -f1)
# fileout2=$(echo $filepattern | cut -d"_" -f2)
if
[
!
-d
"video_ndvi"
]
;
then
mkdir
video_ndvi
fi
echo
$3
# BOX=$(python3 "$HOME/git/GeoSentinel/geosentinel/polygonToBox.py" "$3")
# echo $BOX
# set GDAL_PAM_ENABLED=NO
# gdal_translate -projwin $BOX -projwin_srs WGS84 -ot Byte -scale 0 255 0 255 -of JPEG ndvi/$fileout2"_"$fileout1".tiff" video_ndvi/$fileout2"_"$fileout1".jpg"
# set GDAL_PAM_ENABLED=YES
cd
..
# if [ ! -e ndvi/$fileout2"_"$fileout1".tiff" ]; then
# python3 $HOME/git/GeoSentinel/geosentinel/ndvi.py $NIR $VIR ndvi/$fileout2"_"$fileout1".tiff"
# fi
done
cd
$OUTDIR
"/video_ndvi"
ffmpeg
-i
%
*
.jpg
-c
:v libx264
-vf
fps
=
10
-pix_fmt
yuvj422p out.mp4
# if [ ! -d "video_ndvi" ]; then
# mkdir video_ndvi
# fi
# echo $3
## BOX=$(python3 "$HOME/git/GeoSentinel/geosentinel/polygonToBox.py" "$3")
## echo $BOX
## set GDAL_PAM_ENABLED=NO
## gdal_translate -projwin $BOX -projwin_srs WGS84 -ot Byte -scale 0 255 0 255 -of JPEG ndvi/$fileout2"_"$fileout1".tiff" video_ndvi/$fileout2"_"$fileout1".jpg"
## set GDAL_PAM_ENABLED=YES
# cd ..
#done
#cd $OUTDIR"/video_ndvi"
#ffmpeg -i %*.jpg -c:v libx264 -vf fps=10 -pix_fmt yuvj422p out.mp4
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment