Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Gaetano Raffaele
moringa
Commits
2a06d3aa
Commit
2a06d3aa
authored
Jun 09, 2021
by
Gaetano Raffaele
Browse files
ENH: Add possibility to integrate Sen2Cor options.
parent
c18ee24e
Changes
1
Hide whitespace changes
Inline
Side-by-side
runSen2Cor.py
View file @
2a06d3aa
...
...
@@ -5,8 +5,8 @@ import getopt
import
shutil
from
mtdUtils
import
queuedProcess
def
runSen2Cor
(
fld
,
s2c_fld
,
nproc
=
1
):
basecmd
=
[
s2c_fld
+
os
.
sep
+
'bin'
+
os
.
sep
+
'L2A_Process'
]
def
runSen2Cor
(
fld
,
s2c_fld
,
nproc
=
1
,
options
=
[]
):
basecmd
=
[
s2c_fld
+
os
.
sep
+
'bin'
+
os
.
sep
+
'L2A_Process'
]
+
options
lst
=
glob
.
glob
(
fld
+
os
.
sep
+
'*MSIL1C*.SAFE'
)
cmdlist
=
[
' '
.
join
(
basecmd
+
[
l
]
+
[
'>'
,
l
.
replace
(
'.SAFE'
,
'.log'
)])
for
l
in
lst
]
...
...
@@ -25,7 +25,7 @@ def runSen2Cor(fld, s2c_fld, nproc = 1):
if
__name__
==
'__main__'
:
if
len
(
sys
.
argv
)
<
3
:
sys
.
exit
(
'Usage: python runSen2Cor.py [-n <number of parallel processes> def. 1] <Sen2Cor install folder> <folder containing S2 MSIL1C>
\n
'
'Usage: python runSen2Cor.py [-n <number of parallel processes> def. 1]
[-o <Sen2Cor options in a quote>]
<Sen2Cor install folder> <folder containing S2 MSIL1C>
\n
'
'Ex. python runSen2Cor.py -n 12 /home/ocsol_data/_tools/Sen2Cor-02.05.05-Linux64 /home/ocsol_data/Montcuq/S2'
)
else
:
try
:
...
...
@@ -33,9 +33,12 @@ if __name__ == '__main__':
except
getopt
.
GetoptError
as
err
:
print
(
str
(
err
))
options
=
[]
nproc
=
1
for
opt
,
val
in
opts
:
if
opt
==
'-n'
:
nproc
=
int
(
val
)
if
opt
==
'-o'
:
options
=
val
.
split
(
' '
)
runSen2Cor
(
args
[
1
],
args
[
0
],
nproc
)
runSen2Cor
(
args
[
1
],
args
[
0
],
nproc
,
options
)
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