Commit 1f7fb95e authored by Mario Chirinos Colunga's avatar Mario Chirinos Colunga 💬

60m

parent a6ed1c8b
Pipeline #4 failed with stages
......@@ -2,13 +2,13 @@
FILE=$1
JP2DIR=$2 #JP2 Output Directory
#S2A_MSIL2A_20170515T162341_N0205_R040_T16QBJ_20170515T163103.zip
filepattern=$(echo $FILE | cut -d"_" -f6)"_"$(echo $FILE | cut -d"_" -f3)"_" #T16QBJ_20170515T162341_
#S2A_MSIL2A_60170515T162341_N0605_R040_T16QBJ_60170515T163103.zip
filepattern=$(echo $FILE | cut -d"_" -f6)"_"$(echo $FILE | cut -d"_" -f3)"_" #T16QBJ_60170515T162341_
productType=$(echo $filepattern | cut -d"_" -f2) #MSIL2A
tile=$(echo $filepattern | cut -d"_" -f1) #T16QBJ
datetime=$(echo $filepattern | cut -d"_" -f2) #20170515T162341
dateText=$(echo $datetime | cut -d"T" -f1) #20170515
datetime=$(echo $filepattern | cut -d"_" -f2) #60170515T162341
dateText=$(echo $datetime | cut -d"T" -f1) #60170515
outDir=$JP2DIR$dateText"/"
......@@ -19,21 +19,21 @@ echo $outDir
if [ ! -d $outDir ]; then
mkdir $outDir
fi
if [ ! -e $filePrefix"TCI_10m.jp2" -o ! -e $filePrefix"TCI_20m.jp2" -o ! -e $filePrefix"SCL_20m.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_20m.jp2 *SCL_20m.jp2 -d $JP2DIR$dateText
unzip -n -j $FILE *TCI_10m.jp2 *TCI_60m.jp2 *SCL_60m.jp2 -d $JP2DIR$dateText
TCI10m=$outDir"L2A_"$filepattern"TCI_10m.jp2"
TCI20m=$outDir"L2A_"$filepattern"TCI_20m.jp2"
SCL20m=$outDir"L2A_"$filepattern"SCL_20m.jp2"
TCI60m=$outDir"L2A_"$filepattern"TCI_60m.jp2"
SCL60m=$outDir"L2A_"$filepattern"SCL_60m.jp2"
if [ -e $TCI10m ]; then
mv $TCI10m $filePrefix"TCI_10m.jp2"
fi
if [ -e $TCI20m ]; then
mv $TCI20m $filePrefix"TCI_20m.jp2"
if [ -e $TCI60m ]; then
mv $TCI60m $filePrefix"TCI_60m.jp2"
fi
if [ -e $SCL20m ]; then
mv $SCL20m $filePrefix"SCL_20m.jp2"
if [ -e $SCL60m ]; then
mv $SCL60m $filePrefix"SCL_60m.jp2"
fi
else
echo PASS $FILE
......
......@@ -41,7 +41,7 @@ cd jp2/merge_out/
if [ ! -d "SCL" ]; then
mkdir SCL
fi
cp *SCL_20m.tif SCL
cp *SCL_60m.tif SCL
cd SCL
ls *.tif | parallel --jobs 4 imageMissingData.py {} 50
......@@ -66,5 +66,5 @@ SCLimageListToJSON.sh $USERDIR"jp2/merge_out/SCL/" $USERDIR"mask.json" 6
mv *.json json
cd json
mergeL2ASCL_JSON.py $USERDIR"jp2/merge_out/SCL/json/" > $USERDIR"scl_data.json"
#mv *SCL_20m.tif json
#mv *SCL_60m.tif json
#cd json
......@@ -24,15 +24,15 @@ else
echo PASSING $CROPEDIMAGE FOUND
fi
##------------------------------------------------------------------------------
MERGEDIMAGE=$DIRNAME"_SCL_20m_merged.tif"
MERGEDIMAGE=$DIRNAME"_SCL_60m_merged.tif"
if [ ! -e $MERGEDIMAGE ]; then
echo "gdal_merge.py -o "$MERGEDIMAGE $(ls *SCL_20m.jp2)
gdal_merge.py -o $MERGEDIMAGE $(ls *SCL_20m.jp2)
echo "gdal_merge.py -o "$MERGEDIMAGE $(ls *SCL_60m.jp2)
gdal_merge.py -o $MERGEDIMAGE $(ls *SCL_60m.jp2)
else
echo PASSING $MERGEDIMAGE FOUND
fi
CROPEDIMAGE=../merge_out/$DIRNAME"_SCL_20m.tif"
CROPEDIMAGE=../merge_out/$DIRNAME"_SCL_60m.tif"
if [ ! -e $CROPEDIMAGE ]; then
gdal_translate -projwin $BOX -projwin_srs WGS84 -ot Byte -of JPEG $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