Commit 9fc4e086 authored by Mario Chirinos Colunga's avatar Mario Chirinos Colunga 💬

GDAL_PAM_ENABLED=NO

parent f2af3208
...@@ -5,55 +5,59 @@ OUTDIR=$2 ...@@ -5,55 +5,59 @@ OUTDIR=$2
WINDOW=$3 WINDOW=$3
count=1 count=1
ext=.jpg ext=.jpg
cd $BASEDIR BOX=$(python3 "$HOME/git/GeoSentinel/geosentinel/polygonToBox.py" "$3")
for f in $(find . -type f -name '*.zip') echo $BOX
do
#cd $BASEDIR
filepattern=$(echo $f | cut -d"_" -f6)"_"$(echo $f | cut -d"_" -f3)"_B"
filename=$OUTDIR$filepattern #for f in $(find . -type f -name '*.zip')
echo $filename #do
if [ ! -e $filename"04.jp2" ]; then
# filepattern=$(echo $f | cut -d"_" -f6)"_"$(echo $f | cut -d"_" -f3)"_B"
unzip -n -j $f *B04.jp2 -d $OUTDIR # filename=$OUTDIR$filepattern
fi # echo $filename
# if [ ! -e $filename"04.jp2" ]; then
if [ ! -e $filename"08.jp2" ]; then
# unzip -n -j $f *B04.jp2 -d $OUTDIR
unzip -n -j $f *B08.jp2 -d $OUTDIR # fi
fi
# if [ ! -e $filename"08.jp2" ]; then
cd $OUTDIR # unzip -n -j $f *B08.jp2 -d $OUTDIR
NIR=$(ls $filepattern"08.jp2" -t |head -1) # fi
VIR=$(ls $filepattern"04.jp2" -t |head -1)
#
echo "NIR-"$NIR # cd $OUTDIR
echo "VIR-"$VIR # NIR=$(ls $filepattern"08.jp2" -t |head -1)
# VIR=$(ls $filepattern"04.jp2" -t |head -1)
if [ ! -d "ndvi" ]; then
mkdir ndvi # echo "NIR-"$NIR
fi # echo "VIR-"$VIR
fileout1=$(echo $filepattern | cut -d"_" -f1) # if [ ! -d "ndvi" ]; then
fileout2=$(echo $filepattern | cut -d"_" -f2) # mkdir ndvi
# fi
if [ ! -e ndvi/$fileout2"_"$fileout1".tiff" ]; then
python3 $HOME/git/GeoSentinel/geosentinel/ndvi.py $NIR $VIR ndvi/$fileout2"_"$fileout1".tiff" # fileout1=$(echo $filepattern | cut -d"_" -f1)
fi # fileout2=$(echo $filepattern | cut -d"_" -f2)
if [ ! -d "video_ndvi" ]; then # if [ ! -e ndvi/$fileout2"_"$fileout1".tiff" ]; then
mkdir video_ndvi # python3 $HOME/git/GeoSentinel/geosentinel/ndvi.py $NIR $VIR ndvi/$fileout2"_"$fileout1".tiff"
fi # fi
echo $3
# BOX=$(python3 "$HOME/git/GeoSentinel/geosentinel/polygonToBox.py" "$3") # if [ ! -d "video_ndvi" ]; then
# echo $BOX # mkdir video_ndvi
# set GDAL_PAM_ENABLED=NO # fi
# 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" # echo $3
# set GDAL_PAM_ENABLED=YES ## BOX=$(python3 "$HOME/git/GeoSentinel/geosentinel/polygonToBox.py" "$3")
cd .. ## echo $BOX
## set GDAL_PAM_ENABLED=NO
done ## 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"
cd $OUTDIR"/video_ndvi" ## set GDAL_PAM_ENABLED=YES
ffmpeg -i %*.jpg -c:v libx264 -vf fps=10 -pix_fmt yuvj422p out.mp4 # cd ..
#done
#cd $OUTDIR"/video_ndvi"
#ffmpeg -i %*.jpg -c:v libx264 -vf fps=10 -pix_fmt yuvj422p out.mp4
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment