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

10m

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