Commit 62f3378c authored by Mario Chirinos's avatar Mario Chirinos

update

parent b97cb4d7
......@@ -80,89 +80,89 @@ else
fi
##4.- Mask raster with shape file
#echo ${RED}"\nApplying Mask..."${NC}
echo ${RED}"\nApplying Mask..."${NC}
#if [ $BYTILE -ne "0" ]; then
# echo "BY TILE"
# cd $USERDIR"out/"
# for d in $(ls -d */) ; do
# cd $d
# if [ ! -d "mask" ]; then
# mkdir mask
# fi
# for i in $(ls *.tif) ; do
# if [ ! -e mask/$i ]; then
# gdalwarp -cutline $USERDIR"myshape/wkt.shp" -crop_to_cutline -dstalpha $i mask/$i
# else
# echo "Passing " $i
# fi
# done
# cd ..
# done
if [ $BYTILE -ne "0" ]; then
echo "BY TILE"
cd $USERDIR"out/"
for d in $(ls -d */) ; do
cd $d
if [ ! -d "mask" ]; then
mkdir mask
fi
for i in $(ls *.tif) ; do
if [ ! -e mask/$i ]; then
gdalwarp -cutline $USERDIR"myshape/wkt.shp" -crop_to_cutline -dstalpha $i mask/$i
else
echo "Passing " $i
fi
done
cd ..
done
#else
# echo "BY DATE"
# cd $USERDIR"out/"
# if [ ! -d "mask" ]; then
# mkdir mask
# fi
else
echo "BY DATE"
cd $USERDIR"out/"
if [ ! -d "mask" ]; then
mkdir mask
fi
# for i in $(ls *.tif) ; do
# if [ ! -e mask/$i ]; then
# gdalwarp -cutline ../myshape/wkt.shp -crop_to_cutline -dstalpha $i mask/$i
# else
# echo "Passing " $i
# fi
# done
#fi
for i in $(ls *.tif) ; do
if [ ! -e mask/$i ]; then
gdalwarp -cutline ../myshape/wkt.shp -crop_to_cutline -dstalpha $i mask/$i
else
echo "Passing " $i
fi
done
fi
##5.- Delete images with few data
#echo ${RED}"\nDeleting Images..."${NC}
#5.- Delete images with few data
echo ${RED}"\nDeleting Images..."${NC}
#if [ $BYTILE -ne "0" ]; then
# echo "BY TILE"
# cd $USERDIR"out/"
# for i in $(ls -d */) ; do
# cd $i"mask"
# echo $i
# if [ ! -d "SCL" ]; then
# mkdir SCL
# fi
# cp *SCL_60m.tif SCL
# cd SCL
# ls *.tif | parallel --jobs 4 imageMissingData.py {} $USERDIR"findproducts.json" 70
# if [ ! -d "../TCI" ]; then
# mkdir ../TCI
# fi
# for scl in $(ls *.tif)
# do
# fileprefix=$(echo $scl | (cut -d"_" -f1))
# cp ../$fileprefix"_TCI_10m.tif" ../TCI/$fileprefix"_TCI_10m.tif"
# done
# cd $USERDIR"out/"
if [ $BYTILE -ne "0" ]; then
echo "BY TILE"
cd $USERDIR"out/"
for i in $(ls -d */) ; do
cd $i"mask"
echo $i
if [ ! -d "SCL" ]; then
mkdir SCL
fi
cp *SCL_60m.tif SCL
cd SCL
ls *.tif | parallel --jobs 4 imageMissingData.py {} $USERDIR"findproducts.json" 70
if [ ! -d "../TCI" ]; then
mkdir ../TCI
fi
for scl in $(ls *.tif)
do
fileprefix=$(echo $scl | (cut -d"_" -f1))
cp ../$fileprefix"_TCI_10m.tif" ../TCI/$fileprefix"_TCI_10m.tif"
done
cd $USERDIR"out/"
# done
#else
# echo "BY DATE"
# cd $USERDIR"out/mask/"
# if [ ! -d "SCL" ]; then
# mkdir SCL
# fi
# cp *SCL_60m.tif SCL
# cd SCL
# ls *.tif | parallel --jobs 4 imageMissingData.py {} $USERDIR"findProducts.json" 70
done
else
echo "BY DATE"
cd $USERDIR"out/mask/"
if [ ! -d "SCL" ]; then
mkdir SCL
fi
cp *SCL_60m.tif SCL
cd SCL
ls *.tif | parallel --jobs 4 imageMissingData.py {} $USERDIR"findProducts.json" 70
# if [ ! -d "../TCI" ]; then
# mkdir ../TCI
# fi
# for scl in $(ls *.tif)
# do
# fileprefix=$(echo $scl | (cut -d"_" -f1))
# cp ../$fileprefix"_TCI_10m.tif" ../TCI/$fileprefix"_TCI_10m.tif"
# cd ../TCI
# done
#fi
if [ ! -d "../TCI" ]; then
mkdir ../TCI
fi
for scl in $(ls *.tif)
do
fileprefix=$(echo $scl | (cut -d"_" -f1))
cp ../$fileprefix"_TCI_10m.tif" ../TCI/$fileprefix"_TCI_10m.tif"
cd ../TCI
done
fi
##6.-Creating Thumbnails
##echo ${RED}"Creating Thumbnails"${NC}
##if [ $BYTILE -ne "0" ]; then
......@@ -201,28 +201,28 @@ fi
##fi
##7.-Extract SCL information
#echo ${RED}"Extracting SCL information..."${NC}
#7.-Extract SCL information
echo ${RED}"Extracting SCL information..."${NC}
#if [ $BYTILE -ne "0" ]; then
# echo "BY TILE"
# cd $USERDI##8.-Extract SCL morphology
#echo ${RED}"Extracting SCL morphology..."${NC}
if [ $BYTILE -ne "0" ]; then
echo "BY TILE"
cd $USERDI##8.-Extract SCL morphology
echo ${RED}"Extracting SCL morphology..."${NC}
#if [ $BYTILE -ne "0" ]; then
# echo "BY TILE"
if [ $BYTILE -ne "0" ]; then
echo "BY TILE"
#else
# echo "BY DATE"
# cd $USERDIR"out/mask/SCL/"
# if [ ! -d "morph" ]; then
# mkdir morph
# fi
# GI_SCLmorphImageListToJSON.sh $USERDIR"out/mask/SCL/" $USERDIR"findProducts.json" 6
# mv *.json morph
# cd morph
# mergeL2ASCL_JSON.py $USERDIR"out/mask/SCL/morph/" > $USERDIR"scl_morph.json"
#fi
else
echo "BY DATE"
cd $USERDIR"out/mask/SCL/"
if [ ! -d "morph" ]; then
mkdir morph
fi
GI_SCLmorphImageListToJSON.sh $USERDIR"out/mask/SCL/" $USERDIR"findProducts.json" 6
mv *.json morph
cd morph
mergeL2ASCL_JSON.py $USERDIR"out/mask/SCL/morph/" > $USERDIR"scl_morph.json"
fi
#exitR"out/"
# for i in $(ls -d */) ; do
......
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