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
Hide 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
fi
##4.- Mask raster with shape file
#
echo ${RED}"\nApplying Mask..."${NC}
echo
${
RED
}
"
\n
Applying 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
}
"
\n
Deleting 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
...
...
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