Commit 13f2a486 authored by Mario Chirinos Colunga's avatar Mario Chirinos Colunga 💬

10m

parent 4d38c8ac
...@@ -59,9 +59,9 @@ def main(argv): ...@@ -59,9 +59,9 @@ def main(argv):
while text != "yes" and text != "no": while text != "yes" and text != "no":
text = raw_input("Do you want to download this products to "+rawDir+ " ? (yes, no)") text = raw_input("Do you want to download this products to "+rawDir+ " ? (yes, no)")
if text=="yes": if text=="yes":
# sentinel.downloadProducts(productList,rawDir) #sentinel.downloadProducts(productList,rawDir)
print("L1CProductListToL2A.sh "+rawDir+" "+inDir+" 1") print("L1CProductListToL2A.sh "+rawDir+" "+inDir+" 1")
# os.system("L1CProductListToL2A.sh "+rawDir+" "+inDir+" 1") #os.system("L1CProductListToL2A.sh "+rawDir+" "+inDir+" 1")
text ="" text =""
while text != "yes" and text != "no": while text != "yes" and text != "no":
text = raw_input("Do you want to link this products to "+outdir+ " ? (yes, no)") text = raw_input("Do you want to link this products to "+outdir+ " ? (yes, no)")
......
...@@ -49,7 +49,7 @@ def main(argv): ...@@ -49,7 +49,7 @@ def main(argv):
th = float(argv[3])/100.0 th = float(argv[3])/100.0
if dataArea<th : if dataArea<th :
print ("Deleting " + argv[1] + " " + str(dataArea)+" < " + str(th)) print ("Deleting " + argv[1] + " " + str(dataArea)+" < " + str(th))
#os.system("rm " + argv[1]) os.system("rm " + argv[1])
else: else:
print ("Keeping " + argv[1] + " " + str(dataArea)) print ("Keeping " + argv[1] + " " + str(dataArea))
......
...@@ -29,6 +29,8 @@ fi ...@@ -29,6 +29,8 @@ fi
if [ ! -e $filePrefix"TCI_10m.jp2" -o ! -e $filePrefix"TCI_60m.jp2" -o ! -e $filePrefix"SCL_60m.jp2" ]; then if [ ! -e $filePrefix"TCI_10m.jp2" -o ! -e $filePrefix"TCI_60m.jp2" -o ! -e $filePrefix"SCL_60m.jp2" ]; then
unzip -n -j $FILE *TCI_10m.jp2 *TCI_60m.jp2 *SCL_60m.jp2 -d $outDir unzip -n -j $FILE *TCI_10m.jp2 *TCI_60m.jp2 *SCL_60m.jp2 -d $outDir
# unzip -n -j $FILE *TCI_10m.jp2 *SCL_60m.jp2 -d $outDir
TCI10m=$outDir"/L2A_"$filepattern"TCI_10m.jp2" TCI10m=$outDir"/L2A_"$filepattern"TCI_10m.jp2"
TCI60m=$outDir"/L2A_"$filepattern"TCI_60m.jp2" TCI60m=$outDir"/L2A_"$filepattern"TCI_60m.jp2"
SCL60m=$outDir"/L2A_"$filepattern"SCL_60m.jp2" SCL60m=$outDir"/L2A_"$filepattern"SCL_60m.jp2"
......
#!/bin/sh
#Convert L2A Products to L3A using L2AtoL3C Process
DATE=$1
TILE=$2
INDIR=$3
OUTDIR=$4
cd $INDIR
for f in $(ls | egrep $DATE.{21}$TILE)
echo $f
done
...@@ -26,7 +26,7 @@ wktToShape.py "$wkt" "myshape" ...@@ -26,7 +26,7 @@ wktToShape.py "$wkt" "myshape"
#1.- Link L2A products #1.- Link L2A products
echo "Linking Products..." echo ${RED}"Linking Products..."${NC}
if [ ! -d "L2A" ]; then if [ ! -d "L2A" ]; then
mkdir L2A mkdir L2A
fi fi
...@@ -37,7 +37,7 @@ yes yes | findProducts.py $USERDIR"findProducts.json" ...@@ -37,7 +37,7 @@ yes yes | findProducts.py $USERDIR"findProducts.json"
#2.- Extract Images #2.- Extract Images
echo "Extracting JP2 Images..." echo ${RED}"Extracting JP2 Images..."${NC}
if [ ! -d "jp2" ]; then if [ ! -d "jp2" ]; then
mkdir jp2 mkdir jp2
fi fi
...@@ -50,9 +50,8 @@ else ...@@ -50,9 +50,8 @@ else
L2AProductListExtractData.sh $USERDIR"L2A/" $USERDIR"jp2/" 4 0 L2AProductListExtractData.sh $USERDIR"L2A/" $USERDIR"jp2/" 4 0
fi fi
#3.- Merge Images #3.- Merge Images
echo "\nMerging Images..." echo ${RED}"\nMerging Images..."${NC}
if [ $BYTILE -ne "0" ]; then if [ $BYTILE -ne "0" ]; then
echo "BY TILE" echo "BY TILE"
cd $USERDIR"jp2/" cd $USERDIR"jp2/"
...@@ -73,12 +72,12 @@ else ...@@ -73,12 +72,12 @@ else
if [ ! -d "../out" ]; then if [ ! -d "../out" ]; then
mkdir "../out" mkdir "../out"
fi fi
mergeImagesByDirectory.sh $USERDIR"jp2/" $USERDIR/out/ "$wkt" 4 mergeImagesByDirectory.sh $USERDIR"jp2/" $USERDIR"out/" "$wkt" 4
fi fi
#4.- Mask raster with shape file #4.- Mask raster with shape file
echo "\nApplying Mask..." echo ${RED}"\nApplying Mask..."${NC}
if [ $BYTILE -ne "0" ]; then if [ $BYTILE -ne "0" ]; then
echo "BY TILE" echo "BY TILE"
...@@ -116,7 +115,7 @@ else ...@@ -116,7 +115,7 @@ else
fi fi
#5.- Delete images with few data #5.- Delete images with few data
echo "\nDeleting Images..." echo ${RED}"\nDeleting Images..."${NC}
if [ $BYTILE -ne "0" ]; then if [ $BYTILE -ne "0" ]; then
echo "BY TILE" echo "BY TILE"
...@@ -136,7 +135,7 @@ if [ $BYTILE -ne "0" ]; then ...@@ -136,7 +135,7 @@ if [ $BYTILE -ne "0" ]; then
for scl in $(ls *.tif) for scl in $(ls *.tif)
do do
fileprefix=$(echo $scl | (cut -d"_" -f1)) fileprefix=$(echo $scl | (cut -d"_" -f1))
cp ../$fileprefix"_TCI_60m.tif" ../TCI/$fileprefix"_TCI_60m.tif" cp ../$fileprefix"_TCI_10m.tif" ../TCI/$fileprefix"_TCI_10m.tif"
done done
cd $USERDIR"out/" cd $USERDIR"out/"
...@@ -157,13 +156,13 @@ else ...@@ -157,13 +156,13 @@ else
for scl in $(ls *.tif) for scl in $(ls *.tif)
do do
fileprefix=$(echo $scl | (cut -d"_" -f1)) fileprefix=$(echo $scl | (cut -d"_" -f1))
cp ../$fileprefix"_TCI_60m.tif" ../TCI/$fileprefix"_TCI_60m.tif" cp ../$fileprefix"_TCI_10m.tif" ../TCI/$fileprefix"_TCI_10m.tif"
cd ../TCI cd ../TCI
done done
fi fi
#6.-Creating Thumbnails #6.-Creating Thumbnails
echo "Creating Thumbnails" echo ${RED}"Creating Thumbnails"${NC}
if [ $BYTILE -ne "0" ]; then if [ $BYTILE -ne "0" ]; then
echo "BY TILE" echo "BY TILE"
cd $USERDIR"out/" cd $USERDIR"out/"
......
#!/bin/sh
#Convert L2A Products to L3A using L2AProductListToL3A Process
DATE=$1
TILE=$2
INDIR=$3
OUTDIR=$4
cd $INDIR
for f in $(ls | egrep $DATE.{21}$TILE) ; do
TMPDIR=MSIL3A_$DATE"_"$TILE"/"
cd $OUTDIR
if [ ! -d $TMPDIR"L2A/TCI/" ]; then
mkdir -p $TMPDIR"L2A/TCI/"
fi
if [ ! -d $TMPDIR"L2A/SCL/" ]; then
mkdir -p $TMPDIR"L2A/SCL/"
fi
JP2DIR=$TMPDIR"GRANULE/L3A_"$TILE"_"$DATE"/IMG_DATA/R60m/"
if [ ! -d $JP2DIR ]; then
mkdir -p $JP2DIR
fi
cd ..
ln -s $INDIR$f $OUTDIR$TMPDIR"L2A/"$f
unzip -n -j $OUTDIR$TMPDIR"L2A/"$f *TCI_60m.jp2 -d $OUTDIR$TMPDIR"L2A/TCI/"
unzip -n -j $OUTDIR$TMPDIR"L2A/"$f *SCL_60m.jp2 -d $OUTDIR$TMPDIR"L2A/SCL/"
echo $f
done
cd $OUTDIR$TMPDIR"L2A/"
L2AtoL3A.py $OUTDIR$TMPDIR"L2A/"
...@@ -22,7 +22,7 @@ echo $DIRNAME ...@@ -22,7 +22,7 @@ echo $DIRNAME
for f in $(ls); do echo ${f}; done; for f in $(ls); do echo ${f}; done;
#exit #exit
##------------------------------------------------------------------------------ ##------------------------------------------------------------------------------
MERGEDIMAGE=$DIRNAME"_TCI_60m_merged.tif" MERGEDIMAGE=$DIRNAME"_TCI_10m_merged.tif"
if [ ! -e $MERGEDIMAGE ]; then if [ ! -e $MERGEDIMAGE ]; then
echo "gdal_merge.py -o "$MERGEDIMAGE $(ls *TCI_10m.jp2) echo "gdal_merge.py -o "$MERGEDIMAGE $(ls *TCI_10m.jp2)
gdal_merge.py -o $MERGEDIMAGE $(ls *TCI_10m.jp2) gdal_merge.py -o $MERGEDIMAGE $(ls *TCI_10m.jp2)
...@@ -30,7 +30,7 @@ else ...@@ -30,7 +30,7 @@ else
echo PASSING $MERGEDIMAGE FOUND echo PASSING $MERGEDIMAGE FOUND
fi fi
CROPEDIMAGE=$OUTDIR$DIRNAME"_TCI_60m.tif" CROPEDIMAGE=$OUTDIR$DIRNAME"_TCI_10m.tif"
if [ ! -e $CROPEDIMAGE ]; then if [ ! -e $CROPEDIMAGE ]; then
gdal_translate -projwin $BOX -projwin_srs WGS84 -ot Byte -of GTiff $MERGEDIMAGE $CROPEDIMAGE gdal_translate -projwin $BOX -projwin_srs WGS84 -ot Byte -of GTiff $MERGEDIMAGE $CROPEDIMAGE
else else
......
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