Skip to content

Commit 673379c

Browse files
author
Jungkyo Jung
committed
add co-pol threshold
1 parent 2de58ec commit 673379c

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

src/dswx_sar/defaults/algorithm_parameter_ni.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ runconfig:
236236
dual_pol_ratio_min: 7
237237
dual_pol_ratio_threshold: 8
238238
cross_pol_min: -26
239+
copol_threshold: -10
239240
line_per_block: 300
240241
# If 'auto' is selected and GLAD is available, GLAD will be
241242
# used for inundated vegetation. In the 'auto' option,

src/dswx_sar/nisar/detect_inundated_vegetation.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def run(cfg):
3838
inundated_vege_ratio_threshold = \
3939
inundated_vege_cfg.dual_pol_ratio_threshold
4040
inundated_vege_cross_pol_min = inundated_vege_cfg.cross_pol_min
41-
41+
inundated_vege_copol_threshold = inundated_vege_cfg.copol_threshold
4242
target_file_type = inundated_vege_cfg.target_area_file_type
4343
target_worldcover_class = inundated_vege_cfg.target_worldcover_class
4444
target_glad_class = inundated_vege_cfg.target_glad_class
@@ -149,10 +149,13 @@ def run(cfg):
149149
cross_db = 10 * np.log10(
150150
np.squeeze(rtc_dual[crosspol_ind, :, :]) +
151151
_dswx_sar_util.Constants.negligible_value)
152-
152+
co_db = 10 * np.log10(
153+
np.squeeze(rtc_dual[copol_ind, :, :]) +
154+
_dswx_sar_util.Constants.negligible_value)
153155
output_data = np.zeros(filt_ratio.shape, dtype='uint8')
154156

155157
target_cross_pol = cross_db > inundated_vege_cross_pol_min
158+
target_co_pol = co_db > inundated_vege_copol_threshold
156159
if target_file_type == 'WorldCover':
157160
target_inundated_vege_class = mask_obj.get_mask(
158161
mask_label=target_worldcover_class,
@@ -184,7 +187,7 @@ def run(cfg):
184187

185188
all_inundated_cand = \
186189
(filt_ratio_db > inundated_vege_ratio_threshold) & \
187-
target_cross_pol
190+
target_cross_pol & target_co_pol
188191
inundated_vegetation = all_inundated_cand & \
189192
(target_inundated_vege_class > 0)
190193
output_data[inundated_vegetation] = 2

src/dswx_sar/nisar/dswx_ni_runconfig.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ def load_from_yaml(cls, yaml_path: str, workflow_name: str, args):
835835
flag_pol_freq_a_equal,
836836
flag_pol_freq_b_equal,
837837
freq_list,
838-
res_freq_b_equal,
838+
res_freq_a_equal,
839839
res_freq_b_equal,
840840
res_highest,
841841
nisar_uni_mode

src/dswx_sar/schemas/algorithm_parameter_ni.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ runconfig:
235235
dual_pol_ratio_min: num(min=0, max=30, required=False)
236236
dual_pol_ratio_threshold: num(min=0, max=30, required=False)
237237
cross_pol_min: num(min=-30, max=10, required=False)
238+
copol_threshold: num(min=-30, max=10, required=False)
238239
line_per_block: num(min=1, required=False)
239240
# If 'auto' is selected and GLAD is available, GLAD will be
240241
# used for inundated vegetation. In the 'auto' option,

0 commit comments

Comments
 (0)