Skip to content

Commit 70e58ea

Browse files
authored
Add in the interpolation_cor_threshold when creating the recommended mask (#327)
* Add in the `interpolation_cor_threshold` when creating the recommended mask With isce-framework/dolphin#612 , the pixels with very low `estimated_phase_quality` (aka sliding window correlation) are masking and interpolated over. Thus, they should not be recommended * Update dolphin to 0.40.0
1 parent 1e72cc4 commit 70e58ea

2 files changed

Lines changed: 16 additions & 5 deletions

File tree

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ ARG MAMBA_DOCKERFILE_ACTIVATE=1
7171
RUN pip install git+https://github.com/isce-framework/spurt@v0.1.1
7272
# --no-deps because they are installed with conda
7373
RUN pip install --no-deps git+https://github.com/opera-adt/opera-utils@v0.23.0
74-
RUN pip install --no-deps git+https://github.com/isce-framework/dolphin@v0.39.0
74+
RUN pip install --no-deps git+https://github.com/isce-framework/dolphin@v0.40.0
7575

7676
COPY --chown=$MAMBA_USER:$MAMBA_USER . .
7777
RUN python -m pip install --no-deps .

src/disp_s1/product.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,18 +273,28 @@ def _get_start_end_cslcs(files):
273273
< algorithm_parameters.recommended_temporal_coherence_threshold
274274
)
275275
bad_similarity = similarity < algorithm_parameters.recommended_similarity_threshold
276+
277+
cor_threshold = (
278+
dolphin_config.unwrap_options.preprocess_options.interpolation_cor_threshold
279+
)
280+
sliding_window_corr = io.load_gdal(ifg_corr_filename, masked=True)
281+
is_masked_from_corr = sliding_window_corr < cor_threshold
282+
276283
is_low_quality = bad_temporal_coherence & bad_similarity
277284

278285
# If a pixel has any of the reasons to be bad, recommend masking
279286
if algorithm_parameters.recommended_use_conncomp:
280287
is_zero_conncomp = conncomps == 0
288+
bad_pixel_mask = (
289+
is_water | is_low_quality | is_zero_conncomp | is_masked_from_corr
290+
)
281291
# An alternate way to view this:
282-
# good_conncomp & is_no_water & (good_temporal_coherence | good_similarity)
283-
bad_pixel_mask = is_water | is_low_quality | is_zero_conncomp
292+
# good_pixels = high_quality & good_conncomp & is_not_water & is_not_masked
293+
# where high_quality = good_temporal_coherence | good_similarity
284294
else:
295+
bad_pixel_mask = is_water | is_low_quality | is_masked_from_corr
285296
# An alternate way to view this:
286-
# is_land & (has_good_temporal_coherence or has_good_similarity)
287-
bad_pixel_mask = is_water | is_low_quality
297+
# good_pixels = is_not_water & high_quality & is_not_masked
288298

289299
recommended_mask = np.logical_not(bad_pixel_mask)
290300
del temporal_coherence, conncomps, similarity
@@ -296,6 +306,7 @@ def _get_start_end_cslcs(files):
296306
"temporal_coherence_threshold": str(
297307
algorithm_parameters.recommended_temporal_coherence_threshold
298308
),
309+
"estimated_phase_quality_threshold": str(cor_threshold),
299310
"uses_connected_component_labels": str(
300311
algorithm_parameters.recommended_use_conncomp
301312
),

0 commit comments

Comments
 (0)