Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
SEDEMA-AV
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mario Chirinos Colunga
SEDEMA-AV
Commits
62f3378c
Commit
62f3378c
authored
Dec 24, 2020
by
Mario Chirinos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
b97cb4d7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
95 additions
and
95 deletions
+95
-95
GI_L2ASCL_AreaProcessing.sh
scripts/GI_L2ASCL_AreaProcessing.sh
+95
-95
No files found.
scripts/GI_L2ASCL_AreaProcessing.sh
View file @
62f3378c
...
@@ -80,89 +80,89 @@ else
...
@@ -80,89 +80,89 @@ else
fi
fi
##4.- Mask raster with shape file
##4.- Mask raster with shape file
#
echo ${RED}"\nApplying Mask..."${NC}
echo
${
RED
}
"
\n
Applying Mask..."
${
NC
}
#
if [ $BYTILE -ne "0" ]; then
if
[
$BYTILE
-ne
"0"
]
;
then
#
echo "BY TILE"
echo
"BY TILE"
#
cd $USERDIR"out/"
cd
$USERDIR
"out/"
#
for d in $(ls -d */) ; do
for
d
in
$(
ls
-d
*
/
)
;
do
#
cd $d
cd
$d
#
if [ ! -d "mask" ]; then
if
[
!
-d
"mask"
]
;
then
#
mkdir mask
mkdir
mask
#
fi
fi
#
for i in $(ls *.tif) ; do
for
i
in
$(
ls
*
.tif
)
;
do
#
if [ ! -e mask/$i ]; then
if
[
!
-e
mask/
$i
]
;
then
#
gdalwarp -cutline $USERDIR"myshape/wkt.shp" -crop_to_cutline -dstalpha $i mask/$i
gdalwarp
-cutline
$USERDIR
"myshape/wkt.shp"
-crop_to_cutline
-dstalpha
$i
mask/
$i
#
else
else
#
echo "Passing " $i
echo
"Passing "
$i
#
fi
fi
#
done
done
#
cd ..
cd
..
#
done
done
#
else
else
#
echo "BY DATE"
echo
"BY DATE"
#
cd $USERDIR"out/"
cd
$USERDIR
"out/"
#
if [ ! -d "mask" ]; then
if
[
!
-d
"mask"
]
;
then
#
mkdir mask
mkdir
mask
#
fi
fi
#
for i in $(ls *.tif) ; do
for
i
in
$(
ls
*
.tif
)
;
do
#
if [ ! -e mask/$i ]; then
if
[
!
-e
mask/
$i
]
;
then
#
gdalwarp -cutline ../myshape/wkt.shp -crop_to_cutline -dstalpha $i mask/$i
gdalwarp
-cutline
../myshape/wkt.shp
-crop_to_cutline
-dstalpha
$i
mask/
$i
#
else
else
#
echo "Passing " $i
echo
"Passing "
$i
#
fi
fi
#
done
done
#
fi
fi
#
#
5.- Delete images with few data
#5.- Delete images with few data
#
echo ${RED}"\nDeleting Images..."${NC}
echo
${
RED
}
"
\n
Deleting Images..."
${
NC
}
#
if [ $BYTILE -ne "0" ]; then
if
[
$BYTILE
-ne
"0"
]
;
then
#
echo "BY TILE"
echo
"BY TILE"
#
cd $USERDIR"out/"
cd
$USERDIR
"out/"
#
for i in $(ls -d */) ; do
for
i
in
$(
ls
-d
*
/
)
;
do
#
cd $i"mask"
cd
$i
"mask"
#
echo $i
echo
$i
#
if [ ! -d "SCL" ]; then
if
[
!
-d
"SCL"
]
;
then
#
mkdir SCL
mkdir
SCL
#
fi
fi
#
cp *SCL_60m.tif SCL
cp
*
SCL_60m.tif SCL
#
cd SCL
cd
SCL
#
ls *.tif | parallel --jobs 4 imageMissingData.py {} $USERDIR"findproducts.json" 70
ls
*
.tif | parallel
--jobs
4 imageMissingData.py
{}
$USERDIR
"findproducts.json"
70
#
if [ ! -d "../TCI" ]; then
if
[
!
-d
"../TCI"
]
;
then
#
mkdir ../TCI
mkdir
../TCI
#
fi
fi
#
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_10m.tif" ../TCI/$fileprefix"_TCI_10m.tif"
cp
../
$fileprefix
"_TCI_10m.tif"
../TCI/
$fileprefix
"_TCI_10m.tif"
#
done
done
#
cd $USERDIR"out/"
cd
$USERDIR
"out/"
#
done
done
#
else
else
#
echo "BY DATE"
echo
"BY DATE"
#
cd $USERDIR"out/mask/"
cd
$USERDIR
"out/mask/"
#
if [ ! -d "SCL" ]; then
if
[
!
-d
"SCL"
]
;
then
#
mkdir SCL
mkdir
SCL
#
fi
fi
#
cp *SCL_60m.tif SCL
cp
*
SCL_60m.tif SCL
#
cd SCL
cd
SCL
#
ls *.tif | parallel --jobs 4 imageMissingData.py {} $USERDIR"findProducts.json" 70
ls
*
.tif | parallel
--jobs
4 imageMissingData.py
{}
$USERDIR
"findProducts.json"
70
#
if [ ! -d "../TCI" ]; then
if
[
!
-d
"../TCI"
]
;
then
#
mkdir ../TCI
mkdir
../TCI
#
fi
fi
#
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_10m.tif" ../TCI/$fileprefix"_TCI_10m.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 ${RED}"Creating Thumbnails"${NC}
##echo ${RED}"Creating Thumbnails"${NC}
##if [ $BYTILE -ne "0" ]; then
##if [ $BYTILE -ne "0" ]; then
...
@@ -201,28 +201,28 @@ fi
...
@@ -201,28 +201,28 @@ fi
##fi
##fi
#
#
7.-Extract SCL information
#7.-Extract SCL information
#
echo ${RED}"Extracting SCL information..."${NC}
echo
${
RED
}
"Extracting SCL information..."
${
NC
}
#
if [ $BYTILE -ne "0" ]; then
if
[
$BYTILE
-ne
"0"
]
;
then
#
echo "BY TILE"
echo
"BY TILE"
#
cd $USERDI##8.-Extract SCL morphology
cd
$USERDI
##8.-Extract SCL morphology
#
echo ${RED}"Extracting SCL morphology..."${NC}
echo
${
RED
}
"Extracting SCL morphology..."
${
NC
}
#
if [ $BYTILE -ne "0" ]; then
if
[
$BYTILE
-ne
"0"
]
;
then
#
echo "BY TILE"
echo
"BY TILE"
#
else
else
#
echo "BY DATE"
echo
"BY DATE"
#
cd $USERDIR"out/mask/SCL/"
cd
$USERDIR
"out/mask/SCL/"
#
if [ ! -d "morph" ]; then
if
[
!
-d
"morph"
]
;
then
#
mkdir morph
mkdir
morph
#
fi
fi
#
GI_SCLmorphImageListToJSON.sh $USERDIR"out/mask/SCL/" $USERDIR"findProducts.json" 6
GI_SCLmorphImageListToJSON.sh
$USERDIR
"out/mask/SCL/"
$USERDIR
"findProducts.json"
6
#
mv *.json morph
mv
*
.json morph
#
cd morph
cd
morph
#
mergeL2ASCL_JSON.py $USERDIR"out/mask/SCL/morph/" > $USERDIR"scl_morph.json"
mergeL2ASCL_JSON.py
$USERDIR
"out/mask/SCL/morph/"
>
$USERDIR
"scl_morph.json"
#
fi
fi
#exitR"out/"
#exitR"out/"
# for i in $(ls -d */) ; do
# for i in $(ls -d */) ; do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment