Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass through --max-tiles to spurt #471

Merged
merged 2 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading