Skip to content

Commit 0795be3

Browse files
Explain realized 2D unwrapping algorithm in docstring
1 parent 428096b commit 0795be3

3 files changed

Lines changed: 33 additions & 10 deletions

File tree

insardev/insardev/Batch.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,6 +1332,12 @@ def unwrap2d_irls(self, weight: 'BatchUnit | None' = None, device: str = 'auto',
13321332
- unwrapped: Batch of unwrapped phase (float32)
13331333
- conncomp: BatchUnit of component labels (uint16, 0=invalid, 1=largest, ...)
13341334
1335+
Notes
1336+
-----
1337+
Uses a novel DCT+IRLS algorithm that combines DCT efficiency with IRLS
1338+
robustness. See `utils_unwrap2d.irls_unwrap_2d` for algorithm details
1339+
and references.
1340+
13351341
Examples
13361342
--------
13371343
>>> phase, corr = stack.pairs(baseline.tolist()).phasediff(wavelength=30).angle()

insardev/insardev/Stack_unwrap2d.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -758,11 +758,12 @@ def unwrap2d_irls(self, phase, weight=None, device='auto',
758758
Notes
759759
-----
760760
- GPU/TPU-accelerated using PyTorch (TPU via XLA, CUDA/ROCm, MPS, or CPU)
761-
- Uses accelerated DCT for fast initialization
762-
- L¹ norm preserves discontinuities better than L² (DCT)
761+
- L¹ norm preserves discontinuities better than L² (DCT alone)
763762
- Correlation weighting handles phase residues properly
764763
- Provides consistent results across multi-burst data
765-
- Based on arXiv:2401.09961
764+
765+
**Algorithm**: Uses a novel DCT+IRLS combination. See
766+
`utils_unwrap2d.irls_unwrap_2d` for algorithm details and references.
766767
"""
767768
import dask
768769
import dask.array as da

insardev/insardev/utils_unwrap2d.py

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,14 +1125,30 @@ def irls_unwrap_2d(phase, weight=None, device='auto', max_iter=50, tol=1e-3,
11251125
11261126
Notes
11271127
-----
1128-
The algorithm uses GPU-accelerated DCT as initial solution (same as
1129-
standalone DCT method), then refines it through weighted iterations.
1130-
The DCT initialization provides a good starting point, and the IRLS
1131-
iterations correct for residue-induced errors using correlation weights.
1132-
1133-
Based on: Dubois-Taine et al., "Iteratively Reweighted Least Squares
1134-
for Phase Unwrapping", arXiv:2401.09961 (2024).
1128+
**Algorithm novelty**: This implementation uses DCT to solve the weighted
1129+
least squares subproblem within each IRLS iteration. This specific combination
1130+
does not appear in the literature:
1131+
1132+
- **DCT for phase unwrapping** (Ghiglia & Romero): Uses DCT to solve least
1133+
squares, but with static weights only (not iteratively reweighted).
1134+
- **IRLS for phase unwrapping** (arXiv:2401.09961): Uses IRLS iterations,
1135+
but with preconditioned conjugate gradient as the inner solver, not DCT.
1136+
- **Weighted DCT (WDCT)**: Uses weights but they are fixed, not iteratively
1137+
updated based on residuals.
1138+
1139+
This implementation combines DCT's efficiency with IRLS's robustness by
1140+
using DCT as the fast solver within each IRLS iteration, updating weights
1141+
based on residuals after each step.
1142+
1143+
References
1144+
----------
1145+
- Ghiglia & Romero, "Robust two-dimensional weighted and unweighted phase
1146+
unwrapping that uses fast transforms and iterative methods", JOSA A (1994)
1147+
- Dubois-Taine et al., "Iteratively Reweighted Least Squares for Phase
1148+
Unwrapping", arXiv:2401.09961 (2024), https://arxiv.org/abs/2401.09961
11351149
1150+
Performance
1151+
-----------
11361152
Achieves 10-20x speedup over SNAPHU on GPU/TPU.
11371153
11381154
Default parameters ensure robust convergence for InSAR processing:

0 commit comments

Comments
 (0)