Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GeoSentinel
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
GeoSentinel
Commits
1f7fb95e
Commit
1f7fb95e
authored
Oct 16, 2018
by
Mario Chirinos Colunga
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
60m
parent
a6ed1c8b
Pipeline
#4
failed with stages
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
18 deletions
+18
-18
ExtractData.sh
tools/ExtractData.sh
+12
-12
L2ASCL_AreaProcessing.sh
tools/L2ASCL_AreaProcessing.sh
+2
-2
mergeImages.sh
tools/mergeImages.sh
+4
-4
No files found.
tools/ExtractData.sh
View file @
1f7fb95e
...
...
@@ -2,13 +2,13 @@
FILE
=
$1
JP2DIR
=
$2
#JP2 Output Directory
#S2A_MSIL2A_
20170515T162341_N0205_R040_T16QBJ_2
0170515T163103.zip
filepattern
=
$(
echo
$FILE
|
cut
-d
"_"
-f6
)
"_"
$(
echo
$FILE
|
cut
-d
"_"
-f3
)
"_"
#T16QBJ_
2
0170515T162341_
#S2A_MSIL2A_
60170515T162341_N0605_R040_T16QBJ_6
0170515T163103.zip
filepattern
=
$(
echo
$FILE
|
cut
-d
"_"
-f6
)
"_"
$(
echo
$FILE
|
cut
-d
"_"
-f3
)
"_"
#T16QBJ_
6
0170515T162341_
productType
=
$(
echo
$filepattern
|
cut
-d
"_"
-f2
)
#MSIL2A
tile
=
$(
echo
$filepattern
|
cut
-d
"_"
-f1
)
#T16QBJ
datetime
=
$(
echo
$filepattern
|
cut
-d
"_"
-f2
)
#
2
0170515T162341
dateText
=
$(
echo
$datetime
|
cut
-d
"T"
-f1
)
#
2
0170515
datetime
=
$(
echo
$filepattern
|
cut
-d
"_"
-f2
)
#
6
0170515T162341
dateText
=
$(
echo
$datetime
|
cut
-d
"T"
-f1
)
#
6
0170515
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_2
0m.jp2"
]
;
then
if
[
!
-e
$filePrefix
"TCI_10m.jp2"
-o
!
-e
$filePrefix
"TCI_
60m.jp2"
-o
!
-e
$filePrefix
"SCL_6
0m.jp2"
]
;
then
unzip
-n
-j
$FILE
*
TCI_10m.jp2
*
TCI_
20m.jp2
*
SCL_2
0m.jp2
-d
$JP2DIR$dateText
unzip
-n
-j
$FILE
*
TCI_10m.jp2
*
TCI_
60m.jp2
*
SCL_6
0m.jp2
-d
$JP2DIR$dateText
TCI10m
=
$outDir
"L2A_"
$filepattern
"TCI_10m.jp2"
TCI
20m
=
$outDir
"L2A_"
$filepattern
"TCI_2
0m.jp2"
SCL
20m
=
$outDir
"L2A_"
$filepattern
"SCL_2
0m.jp2"
TCI
60m
=
$outDir
"L2A_"
$filepattern
"TCI_6
0m.jp2"
SCL
60m
=
$outDir
"L2A_"
$filepattern
"SCL_6
0m.jp2"
if
[
-e
$TCI10m
]
;
then
mv
$TCI10m
$filePrefix
"TCI_10m.jp2"
fi
if
[
-e
$TCI
2
0m
]
;
then
mv
$TCI
20m
$filePrefix
"TCI_2
0m.jp2"
if
[
-e
$TCI
6
0m
]
;
then
mv
$TCI
60m
$filePrefix
"TCI_6
0m.jp2"
fi
if
[
-e
$SCL
2
0m
]
;
then
mv
$SCL
20m
$filePrefix
"SCL_2
0m.jp2"
if
[
-e
$SCL
6
0m
]
;
then
mv
$SCL
60m
$filePrefix
"SCL_6
0m.jp2"
fi
else
echo
PASS
$FILE
...
...
tools/L2ASCL_AreaProcessing.sh
View file @
1f7fb95e
...
...
@@ -41,7 +41,7 @@ cd jp2/merge_out/
if
[
!
-d
"SCL"
]
;
then
mkdir
SCL
fi
cp
*
SCL_
2
0m.tif SCL
cp
*
SCL_
6
0m.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_
2
0m.tif json
#mv *SCL_
6
0m.tif json
#cd json
tools/mergeImages.sh
View file @
1f7fb95e
...
...
@@ -24,15 +24,15 @@ else
echo
PASSING
$CROPEDIMAGE
FOUND
fi
##------------------------------------------------------------------------------
MERGEDIMAGE
=
$DIRNAME
"_SCL_
2
0m_merged.tif"
MERGEDIMAGE
=
$DIRNAME
"_SCL_
6
0m_merged.tif"
if
[
!
-e
$MERGEDIMAGE
]
;
then
echo
"gdal_merge.py -o "
$MERGEDIMAGE
$(
ls
*
SCL_
2
0m.jp2
)
gdal_merge.py
-o
$MERGEDIMAGE
$(
ls
*
SCL_
2
0m.jp2
)
echo
"gdal_merge.py -o "
$MERGEDIMAGE
$(
ls
*
SCL_
6
0m.jp2
)
gdal_merge.py
-o
$MERGEDIMAGE
$(
ls
*
SCL_
6
0m.jp2
)
else
echo
PASSING
$MERGEDIMAGE
FOUND
fi
CROPEDIMAGE
=
../merge_out/
$DIRNAME
"_SCL_
2
0m.tif"
CROPEDIMAGE
=
../merge_out/
$DIRNAME
"_SCL_
6
0m.tif"
if
[
!
-e
$CROPEDIMAGE
]
;
then
gdal_translate
-projwin
$BOX
-projwin_srs
WGS84
-ot
Byte
-of
JPEG
$MERGEDIMAGE
$CROPEDIMAGE
else
...
...
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