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
1b7b4383
Commit
1b7b4383
authored
Oct 03, 2018
by
Mario Chirinos Colunga
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
links
parent
c040b4e2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
30 deletions
+24
-30
ExtractData.sh
tools/ExtractData.sh
+24
-30
No files found.
tools/ExtractData.sh
View file @
1b7b4383
#!/bin/sh
#!/bin/sh
FILE
=
$1
#Products Intput directory
FILE
=
$1
JP2DIR
=
$2
#JP2 Output Directory
JP2DIR
=
$2
#JP2 Output Directory
echo
$FILE
#S2A_MSIL2A_20170515T162341_N0205_R040_T16QBJ_20170515T163103.zip
#S2A_MSIL2A_20170515T162341_N0205_R040_T16QBJ_20170515T163103.zip
filepattern
=
$(
echo
$FILE
|
cut
-d
"_"
-f6
)
"_"
$(
echo
$FILE
|
cut
-d
"_"
-f3
)
"_"
#T16QBJ_20170515T162341_
filepattern
=
$(
echo
$FILE
|
cut
-d
"_"
-f6
)
"_"
$(
echo
$FILE
|
cut
-d
"_"
-f3
)
"_"
#T16QBJ_20170515T162341_
tile
=
$(
echo
$
FILE
ilepattern
|
cut
-d
"_"
-f1
)
#T16QBJ
tile
=
$(
echo
$
f
ilepattern
|
cut
-d
"_"
-f1
)
#T16QBJ
datetime
=
$(
echo
$
FILE
ilepattern
|
cut
-d
"_"
-f2
)
#20170515T162341
datetime
=
$(
echo
$
f
ilepattern
|
cut
-d
"_"
-f2
)
#20170515T162341
dateText
=
$(
echo
$datetime
|
cut
-d
"T"
-f1
)
#20170515
dateText
=
$(
echo
$datetime
|
cut
-d
"T"
-f1
)
#20170515
outDir
=
$JP2DIR$dateText
"/"
outDir
=
$JP2DIR$dateText
"/"
filePrefix
=
$outDir$
FILE
ilepattern
filePrefix
=
$outDir$
f
ilepattern
echo
$
FILE
ilePrefix
echo
$
f
ilePrefix
echo
$outDir
echo
$outDir
if
[
!
-d
$outDir
]
;
then
if
[
!
-d
$outDir
]
;
then
mkdir
$outDir
mkdir
$outDir
fi
fi
#if [ ! -e $FILEilePrefix"TCI_10m.jp2" -o ! -e $FILEilePrefix"TCI_20m.jp2" -o ! -e $FILEilePrefix"SCL_20m.jp2" ]; then
if
[
!
-e
$filePrefix
"TCI_10m.jp2"
-o
!
-e
$filePrefix
"TCI_20m.jp2"
-o
!
-e
$filePrefix
"SCL_20m.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_20m.jp2
*
SCL_20m.jp2
-d
$JP2DIR$dateText
# TCI10m=$outDir"L2A_"$FILEilepattern"TCI_10m.jp2"
TCI10m
=
$outDir
"L2A_"
$filepattern
"TCI_10m.jp2"
# TCI20m=$outDir"L2A_"$FILEilepattern"TCI_20m.jp2"
TCI20m
=
$outDir
"L2A_"
$filepattern
"TCI_20m.jp2"
# SCL20m=$outDir"L2A_"$FILEilepattern"SCL_20m.jp2"
SCL20m
=
$outDir
"L2A_"
$filepattern
"SCL_20m.jp2"
# if [ -e $TCI10m ]; then
if
[
-e
$TCI10m
]
;
then
# mv $TCI10m $FILEilePrefix"TCI_10m.jp2"
mv
$TCI10m
$filePrefix
"TCI_10m.jp2"
# fi
fi
# if [ -e $TCI20m ]; then
if
[
-e
$TCI20m
]
;
then
# mv $TCI20m $FILEilePrefix"TCI_20m.jp2"
mv
$TCI20m
$filePrefix
"TCI_20m.jp2"
# fi
fi
# if [ -e $SCL20m ]; then
if
[
-e
$SCL20m
]
;
then
# mv $SCL20m $FILEilePrefix"SCL_20m.jp2"
mv
$SCL20m
$filePrefix
"SCL_20m.jp2"
# fi
fi
#else
else
# echo PASS $FILE
echo
PASS
$FILE
#fi
fi
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