torchbp.interferometry module
- torchbp.interferometry.elevation_to_phase_slant_polar(z, origin1, origin2, fc, grid)[source]
Compute traditional (slant-range) interferometric phase at given elevation.
For scatterers at height z above the imaging plane:
phi = (4pi fc/c0)*(r1 − r2)
where r_n = slant range in nth image
Reduces to
flat_earth_phase_polar()when z = 0.- Parameters:
z (Tensor or float) – Elevation map [nr, ntheta] or scalar height.
origin1 (Tensor) – Master APC [x, y, z].
origin2 (Tensor) – Slave APC [x, y, z].
fc (float) – RF center frequency (Hz).
grid (PolarGrid or dict) – Polar grid definition.
- Returns:
phase – Interferometric phase [nr, ntheta].
- Return type:
Tensor
- torchbp.interferometry.flat_earth_phase_cart(origin1, origin2, fc, grid)[source]
Compute flat earth interferometric phase for a Cartesian grid.
- Parameters:
origin1 (Tensor) – 3D antenna phase center of the master image [x, y, z].
origin2 (Tensor) – 3D antenna phase center of the slave image [x, y, z].
fc (float) – RF center frequency in Hz.
grid (CartesianGrid or dict) – Cartesian grid definition.
- Returns:
phase – Flat earth phase tensor. Shape: [nx, ny].
- Return type:
Tensor
- torchbp.interferometry.flat_earth_phase_polar(origin1, origin2, fc, grid)[source]
Compute flat earth interferometric phase for a polar grid.
For images formed by backprojection on a flat (z=0) grid, the interferometric phase contains baseline geometry fringes even over flat terrain. This function computes that phase so it can be removed, isolating the topographic signal.
- Parameters:
origin1 (Tensor) – 3D antenna phase center of the master image [x, y, z].
origin2 (Tensor) – 3D antenna phase center of the slave image [x, y, z].
fc (float) – RF center frequency in Hz.
grid (PolarGrid or dict) – Polar grid definition.
- Returns:
phase – Flat earth phase tensor. Shape: [nr, ntheta].
- Return type:
Tensor
- torchbp.interferometry.goldstein_filter(igram, patch_size=64, w=3, alpha=1, overlap=0.75)[source]
Goldstein phase filter. [1]
- Parameters:
igram (Tensor) – Complex interferogram.
patch_size (int) – Patch side-length.
w (int) – Smoothing window size. Must be odd.
alpha (float) – Smoothing exponent.
overlap (float) – Overlap between patches as fraction of patch_size.
- Return type:
Tensor
References
[1]R. M. Goldstein and C. L. Werner, “Radar interferogram filtering for geophysical applications,” in Geophysical Research Letters, vol. 25, no. 21, pp 4035-4038, 1998
- Returns:
filtered – Filtered interferogram.
- Return type:
Tensor
- Parameters:
igram (Tensor)
patch_size (int)
w (int)
alpha (float)
overlap (float)
- torchbp.interferometry.phase_to_elevation(unw, coords, origin1, origin2, fc)[source]
Convert phase unwrapped interferogram to elevation.
- Parameters:
unw (Tensor) – Unwrapped phase tensor. Shape: [Nx, Ny].
coords (Tensor) – Coordinates for each position in image. Shape: [3, Nx, Ny].
origin1 (Tensor) – 3D antenna phase center location of the master image.
origin2 (Tensor) – 3D antenna phase center location of the slave image.
fc (float) – RF center frequency in Hz.
- Returns:
z – Elevation tensor with the same shape as unw.
- Return type:
Tensor
- torchbp.interferometry.phase_to_elevation_cart(unw, origin1, origin2, fc, grid)[source]
Convert phase unwrapped interferogram to elevation.
- Parameters:
unw (Tensor) – Unwrapped phase tensor. Shape: [Nx, Ny].
origin1 (Tensor) – 3D antenna phase center location of the master image.
origin2 (Tensor) – 3D antenna phase center location of the slave image.
fc (float) – RF center frequency in Hz.
grid (CartesianGrid or dict) – Image grid definition. CartesianGrid object or dictionary.
- Returns:
z – Elevation tensor with the same shape as unw.
- Return type:
Tensor
- torchbp.interferometry.phase_to_elevation_polar(unw, origin1, origin2, fc, grid)[source]
Convert phase unwrapped interferogram to elevation.
- Parameters:
unw (Tensor) – Unwrapped phase tensor. Shape: [Nx, Ny].
origin1 (Tensor) – 3D antenna phase center location of the master image.
origin2 (Tensor) – 3D antenna phase center location of the slave image.
fc (float) – RF center frequency in Hz.
grid (PolarGrid or dict) – Image grid definition. PolarGrid object or dictionary.
- Returns:
z – Elevation tensor with the same shape as unw.
- Return type:
Tensor
- torchbp.interferometry.phase_to_elevation_slant_polar(unw, origin1, origin2, fc, grid, n_iter=5)[source]
Convert unwrapped topographic phase to elevation via Newton iteration.
Inverts the traditional interferometric relationship:
phi_topo(z) = elevation_to_phase_slant_polar(z, ...) − elevation_to_phase_slant_polar(0, ...)Starts from the linearised BP-interferometry estimate and refines with Newton’s method.
- Parameters:
unw (Tensor) – Unwrapped topographic phase (flat-earth removed) [nr, ntheta].
origin1 (Tensor) – Master APC [x, y, z].
origin2 (Tensor) – Slave APC [x, y, z].
fc (float) – RF center frequency (Hz).
grid (PolarGrid or dict) – Polar grid definition.
n_iter (int) – Number of Newton iterations (default 5).
- Returns:
z – Estimated elevation [nr, ntheta].
- Return type:
Tensor
- torchbp.interferometry.subpixel_correlation(im_m, im_s)[source]
Solve for subpixel offset that maximize coherent correlation between the two input images. [1]
- Parameters:
im_m (Tensor) – Master image.
im_s (Tensor) – Slave image.
- Return type:
tuple[Tensor, Tensor]
References
[1]D. Li and Y. Zhang, “A Fast Offset Estimation Approach for InSAR Image Subpixel Registration,” in IEEE Geoscience and Remote Sensing Letters, vol. 9, no. 2, pp. 267-271, March 2012.
- Returns:
offsets (Tensor) – Solved X and Y subpixel offsets.
corrs (Tensor) – Correlation at the best subpixel offset.
- Parameters:
im_m (Tensor)
im_s (Tensor)
- Return type:
tuple[Tensor, Tensor]