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
edc3072c
Commit
edc3072c
authored
3 years ago
by
Gaëlle USSEGLIO
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Include resampling processing in python chains (part 3 : use doppler_0 as f0 on azimut)
parent
bb82256c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!52
Merge for v1.1.0
,
!47
TSX/PAZ/TDX processing in python_src
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
python_src/diapotb/lib/PreProcessing.py
+2
-1
2 additions, 1 deletion
python_src/diapotb/lib/PreProcessing.py
python_src/diapotb/lib/internal_processing/resampling.py
+7
-5
7 additions, 5 deletions
python_src/diapotb/lib/internal_processing/resampling.py
with
9 additions
and
6 deletions
python_src/diapotb/lib/PreProcessing.py
+
2
−
1
View file @
edc3072c
...
...
@@ -257,7 +257,8 @@ class ExecutorPreProcessingTSX(ExecutorSingleImage):
resample_deramp_file
)
resample_output_path
=
main_resampling
(
deramp_output_path
,
resample_deramp_output_path
,
self
.
_inputs
[
"
kwl_ref
"
],
self
.
_inputs
[
"
kwl_sec
"
])
self
.
_inputs
[
"
kwl_ref
"
],
self
.
_inputs
[
"
kwl_sec
"
],
app_doppler0
.
get_output_float_parameter
(
"
doppler0
"
))
# If a resampling was applied, only
...
...
This diff is collapsed.
Click to expand it.
python_src/diapotb/lib/internal_processing/resampling.py
+
7
−
5
View file @
edc3072c
...
...
@@ -66,7 +66,7 @@ def update_and_create_output_geom(geom_content_in, output_file, resampler, dimen
utils
.
write_geom
(
geom_content_out
,
geom_file
)
def
resampling_on_dimension
(
input_file
,
output_file
,
kwl_ref
,
kwl_sec
,
dimension
=
Dimension
.
AZIMUT
):
def
resampling_on_dimension
(
input_file
,
output_file
,
kwl_ref
,
kwl_sec
,
f0
,
dimension
=
Dimension
.
AZIMUT
):
"""
Call resampling for the given Dimension
"""
# Retrieve geom file
...
...
@@ -89,6 +89,7 @@ def resampling_on_dimension(input_file, output_file, kwl_ref, kwl_sec, dimension
# Assign f_in and f_out
resampler
.
f_in
=
f_in
resampler
.
f_out
=
f_out
resampler
.
f0
=
f0
do_resampling
=
resampler
.
do_resampling
(
int
(
kwl_sec
[
str
(
MetadataKeyInGeom
.
NUMBER_LINE
)]),
int
(
kwl_sec
[
str
(
MetadataKeyInGeom
.
NUMBER_COL
)]))
...
...
@@ -107,31 +108,32 @@ def resampling_on_dimension(input_file, output_file, kwl_ref, kwl_sec, dimension
return
False
def
main_resampling
(
input_file
,
output_file
,
kwl_ref
,
kwl_sec
):
def
main_resampling
(
input_file
,
output_file
,
kwl_ref
,
kwl_sec
,
dop0
):
"""
Main function to apply resampling on two dimensions, if needed
(if line_interval or Freq_sampling are different)
"""
# Resampling on two dimensions:
# First on Range and then on azimut with resampled image as input (if resampling was necessary on range)
# dop0 is used on azimut to set f0 (central frequency). On range, f0 is 0
# Create output file from input
output_file_ran
=
os
.
path
.
join
(
os
.
path
.
dirname
(
input_file
),
os
.
path
.
basename
(
input_file
).
split
(
"
.
"
)[
0
]
+
"
_range.tif
"
)
was_resampled_on_range
=
resampling_on_dimension
(
input_file
,
output_file_ran
,
kwl_ref
,
kwl_sec
,
Dimension
.
RANGE
)
kwl_ref
,
kwl_sec
,
0
,
Dimension
.
RANGE
)
if
was_resampled_on_range
:
output_file_azi
=
os
.
path
.
join
(
os
.
path
.
dirname
(
input_file
),
os
.
path
.
basename
(
output_file_ran
).
split
(
"
.
"
)[
0
]
+
"
_azimut.tif
"
)
was_resampled_on_azimut
=
resampling_on_dimension
(
output_file_ran
,
output_file_azi
,
kwl_ref
,
kwl_sec
,
Dimension
.
AZIMUT
)
kwl_ref
,
kwl_sec
,
dop0
,
Dimension
.
AZIMUT
)
else
:
output_file_azi
=
os
.
path
.
join
(
os
.
path
.
dirname
(
input_file
),
os
.
path
.
basename
(
input_file
).
split
(
"
.
"
)[
0
]
+
"
_azimut.tif
"
)
was_resampled_on_azimut
=
resampling_on_dimension
(
input_file
,
output_file_azi
,
kwl_ref
,
kwl_sec
,
Dimension
.
AZIMUT
)
kwl_ref
,
kwl_sec
,
dop0
,
Dimension
.
AZIMUT
)
# Return output file (following if resampling were applied)
output_file_resampled
=
input_file
...
...
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