From a0f7aaf1ace9843fc5d95dc56e31658faf3eadd8 Mon Sep 17 00:00:00 2001 From: Scott Staniewicz Date: Tue, 29 Oct 2024 15:24:58 -0400 Subject: [PATCH 1/2] Pass through `--max-tiles` to spurt --- src/dolphin/unwrap/_unwrap_3d.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dolphin/unwrap/_unwrap_3d.py b/src/dolphin/unwrap/_unwrap_3d.py index 26b626d4..235dbdf8 100644 --- a/src/dolphin/unwrap/_unwrap_3d.py +++ b/src/dolphin/unwrap/_unwrap_3d.py @@ -40,7 +40,7 @@ def unwrap_spurt( # Mark the "bad" pixels (good=1, bad=0, following the unwrapper mask convention) temp_coh_mask = temp_coh > options.temporal_coherence_threshold combined_mask = temp_coh_mask - if similarity_filename: + if similarity_filename and options.similarity_threshold: sim = io.load_gdal(similarity_filename, masked=True).filled(0) sim_mask = sim > options.similarity_threshold # A good pixel can have good similarity, or good temp. coherence @@ -87,6 +87,8 @@ def unwrap_spurt( [ "--pts-per-tile", str(options.tiler_settings.target_points_per_tile), + "--max-tiles", + str(options.tiler_settings.max_tiles), ] ) From ca1126533394480aa95f06f8e0ffec83b0ed37ac Mon Sep 17 00:00:00 2001 From: Scott Staniewicz Date: Tue, 29 Oct 2024 15:25:30 -0400 Subject: [PATCH 2/2] Bump up coherence threshold for spurt, add more description --- .../workflows/config/_unwrap_options.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/dolphin/workflows/config/_unwrap_options.py b/src/dolphin/workflows/config/_unwrap_options.py index 677d7755..20aee94d 100644 --- a/src/dolphin/workflows/config/_unwrap_options.py +++ b/src/dolphin/workflows/config/_unwrap_options.py @@ -115,9 +115,11 @@ class SnaphuOptions(BaseModel, extra="forbid"): ) single_tile_reoptimize: bool = Field( False, - description="If True, after unwrapping with multiple tiles, an additional" - " post-processing unwrapping step is performed to re-optimize the unwrapped" - " phase using a single tile", + description=( + "If True, after unwrapping with multiple tiles, an additional" + " post-processing unwrapping step is performed to re-optimize the unwrapped" + " phase using a single tile" + ), ) _to_tuple = field_validator("ntiles", "tile_overlap", mode="before")(to_tuple) @@ -249,14 +251,18 @@ class SpurtOptions(BaseModel, extra="forbid"): """ temporal_coherence_threshold: float = Field( - 0.6, - description="Temporal coherence to pick pixels used on an irregular grid", + 0.7, + description="Temporal coherence to pick pixels used on an irregular grid.", ge=0.0, lt=1.0, ) similarity_threshold: float = Field( 0.5, - description="Similarity to pick pixels used on an irregular grid", + description=( + "Similarity to pick pixels used on an irregular grid. Any pixel with" + " similarity above `similarity_threshold` *or* above the temporal coherence" + " threshold is chosen." + ), ge=0.0, lt=1.0, )