Skip to content

Commit

Permalink
Pass through --max-tiles to spurt (#471)
Browse files Browse the repository at this point in the history
* Pass through `--max-tiles` to spurt

* Bump up coherence threshold for spurt, add more description
  • Loading branch information
scottstanie authored Oct 29, 2024
1 parent 8bba457 commit 3aec7d0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/dolphin/unwrap/_unwrap_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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),
]
)

Expand Down
18 changes: 12 additions & 6 deletions src/dolphin/workflows/config/_unwrap_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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,
)
Expand Down

0 comments on commit 3aec7d0

Please sign in to comment.