Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
diapotb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Remote Modules
diapotb
Commits
7a9a98e2
Commit
7a9a98e2
authored
3 years ago
by
Gaëlle USSEGLIO
Browse files
Options
Downloads
Patches
Plain Diff
ENH : Adapt generateConfigFile to TSX/PAZ/TDX products
parent
d5fade69
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!52
Merge for v1.1.0
,
!50
Finalize Python chains (v1.1.0)
,
!49
Add python tests
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
python_src/utils/generateConfigFile.py
+28
-7
28 additions, 7 deletions
python_src/utils/generateConfigFile.py
with
28 additions
and
7 deletions
python_src/utils/generateConfigFile.py
+
28
−
7
View file @
7a9a98e2
...
...
@@ -86,9 +86,11 @@ def askForMultiSlc(config_handler) :
+
str
(
Sensor
.
S1SM
)
+
\
"
(for Sentinel-1 StripMap mode) or
"
+
\
str
(
Sensor
.
CSK
)
+
\
"
(for Cosmo-Skymed Spotligth and StriMap mode) :
"
)
"
(for Cosmo-Skymed Spotligth and StriMap mode)
"
\
+
str
(
Sensor
.
TSX
)
+
\
"
(for TSX/PAZ/TDX products) :
"
)
if
sensor
not
in
[
str
(
Sensor
.
S1SM
),
str
(
Sensor
.
CSK
)]
:
if
sensor
not
in
[
str
(
Sensor
.
S1SM
),
str
(
Sensor
.
CSK
)
,
str
(
Sensor
.
TSX
)
]
:
prRed
(
"
Unknown sensor
"
)
quit
()
...
...
@@ -110,7 +112,13 @@ def askForMultiSlc(config_handler) :
# reference image (must be into Input_Path)
reference_image
=
inPurple
(
"
Which image is your reference :
"
)
check_file_dir
(
reference_image
)
reference_image
=
os
.
path
.
basename
(
reference_image
)
if
sensor
!=
str
(
Sensor
.
TSX
):
reference_image
=
os
.
path
.
basename
(
reference_image
)
else
:
# TSX mode : relative path to image (from input_dir)
common_path
=
os
.
path
.
commonpath
([
os
.
path
.
abspath
(
input_path
),
os
.
path
.
abspath
(
reference_image
)])
reference_image
=
os
.
path
.
relpath
(
reference_image
,
common_path
)
if
not
utils
.
get_img_from_dir
(
reference_image
,
input_path
)
:
prRed
(
reference_image
+
"
not found into given input path
"
+
\
...
...
@@ -165,6 +173,9 @@ def askForMultiSlc(config_handler) :
if
sensor
==
str
(
Sensor
.
CSK
):
ext
=
"
h5
"
pol
=
reference_image
.
split
(
"
_
"
)[
5
]
elif
sensor
==
str
(
Sensor
.
TSX
):
ext
=
"
cos
"
pol
=
os
.
path
.
basename
(
reference_image
).
split
(
"
_
"
)[
1
]
else
:
pol
=
reference_image
.
split
(
"
-
"
)[
3
]
...
...
@@ -178,6 +189,14 @@ def askForMultiSlc(config_handler) :
# Avoid duplicates
tiff_dates
=
utils
.
avoid_duplicates
(
tiff_dates
)
ref_abs_path
=
os
.
path
.
abspath
(
reference_image
)
if
sensor
==
str
(
Sensor
.
TSX
):
ref_abs_path
=
os
.
path
.
join
(
os
.
path
.
abspath
(
input_path
),
reference_image
)
if
os
.
path
.
abspath
(
ref_abs_path
)
in
tiff_dates
:
tiff_dates
.
remove
(
os
.
path
.
abspath
(
ref_abs_path
))
if
reference_image
in
tiff_dates
:
tiff_dates
.
remove
(
reference_image
)
...
...
@@ -203,7 +222,7 @@ def askForMultiSlc(config_handler) :
# EOF file
eof_path
=
None
if
sensor
!=
str
(
Sensor
.
CSK
):
if
sensor
not
in
[
str
(
Sensor
.
CSK
)
,
str
(
Sensor
.
TSX
)]
:
res_eof
=
inLightPurple
(
"
Would you like to indicate fine orbits (yes/no) :
"
)
if
res_eof
==
"
yes
"
:
...
...
@@ -244,9 +263,11 @@ def askForDiapOTB(config_handler):
+
str
(
Sensor
.
S1SM
)
+
\
"
(for Sentinel-1 StripMap mode) or
"
+
\
str
(
Sensor
.
CSK
)
+
\
"
(for Cosmo-Skymed Spotligth and StriMap mode) :
"
)
"
(for Cosmo-Skymed Spotligth and StriMap mode) or
"
\
+
str
(
Sensor
.
TSX
)
+
\
"
(for TSX/PAZ/TDX products) :
"
)
if
sensor
not
in
[
str
(
Sensor
.
S1SM
),
str
(
Sensor
.
CSK
)]
:
if
sensor
not
in
[
str
(
Sensor
.
S1SM
),
str
(
Sensor
.
CSK
)
,
str
(
Sensor
.
TSX
)
]
:
prRed
(
"
Unknown sensor
"
)
quit
()
...
...
@@ -284,7 +305,7 @@ def askForDiapOTB(config_handler):
# EOF file
eof_path
=
None
if
sensor
!=
str
(
Sensor
.
CSK
)
:
if
sensor
not
in
[
str
(
Sensor
.
CSK
)
,
str
(
Sensor
.
TSX
)]
:
res_eof
=
inLightPurple
(
"
Would you like to indicate fine orbits (yes/no) :
"
)
if
res_eof
==
"
yes
"
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment