torchbp.interferometry module
- torchbp.interferometry.elevation_to_phase_slant_polar(z, origin1, origin2, fcenter, grid)[source]
Compute traditional (slant-range) interferometric phase at given elevation.
For scatterers at height z above the imaging plane:
phi = (4pi fcenter/c0)*(r1 − r2)
where r_n = slant range in nth image
Traditional slant-range model with a single physical wavelength. Its
z = 0value is the flat-earth phase of that model, which is not the flat-earth phase of a dealiased backprojection interferogram (flat_earth_phase_polar()evaluated with the imagefc); only the topographic differencephi(z) - phi(0)is used byphase_to_elevation_slant_polar().- 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].
fcenter (float) – Center frequency of the transmitted spectrum in Hz, sets the wavelength. Not necessarily the same as the backprojection
fc, which is a phase reference (see Choosing fc for backprojection).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.
See
flat_earth_phase_polar(): only images dealiased with their own origins carry this phase, with the opposite sign.- 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) – Phase reference frequency the images were dealiased with, i.e. the
fcgiven totorchbp.util.bp_polar_range_dealias(). This is the backprojection phase reference, not the transmitted center frequency (see Choosing fc for backprojection).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.
Images backprojected onto the flat (z=0) grid without dealiasing have no flat-earth phase: the phase compensation of each image already removes the range to its own origin, so the interferogram
img1 * conj(img2)of flat terrain is zero and only the topographic signal remains. Images dealiased withtorchbp.util.bp_polar_range_dealias(), each with its own origin, carry the dealias ramps and their interferogram over flat terrain is-flat_earth_phase_polar(origin1, origin2, fc, grid); add the returned phase to flatten it. Dealiasing both images with the same origin also leaves no flat-earth phase.The sign is the traditional convention, opposite to the backprojection interferogram, consistent with the negation in
phase_to_elevation().- 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) – Phase reference frequency the images were dealiased with, i.e. the
fcgiven totorchbp.util.bp_polar_range_dealias(). This is the backprojection phase reference, not the transmitted center frequency (see Choosing fc for backprojection).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, fcenter, model='layover')[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.
fcenter (float) – Center frequency of the transmitted spectrum in Hz, sets the wavelength. Not necessarily the same as the backprojection
fc, which is a phase reference (see Choosing fc for backprojection).model (str) – Height-sensitivity model.
"layover"(default): the scatterer imaged at a ground-plane pixel is the one whose master range equals the pixel’s."point": the point-phase-center form (z2/r2 - z1/r1), which assumes the scatterer sits directly above the pixel. Not as accurate with layover.
- Returns:
z – Elevation tensor with the same shape as unw.
- Return type:
Tensor
- torchbp.interferometry.phase_to_elevation_cart(unw, origin1, origin2, fcenter, grid, model='layover')[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.
fcenter (float) – Center frequency of the transmitted spectrum in Hz, sets the wavelength. Not necessarily the same as the backprojection
fc, which is a phase reference (see Choosing fc for backprojection).grid (CartesianGrid or dict) – Image grid definition. CartesianGrid object or dictionary.
model (str) – Height-sensitivity model.
"layover"(default): the scatterer imaged at a ground-plane pixel is the one whose master range equals the pixel’s."point": the point-phase-center form (z2/r2 - z1/r1), which assumes the scatterer sits directly above the pixel. Not as accurate with layover.
- Returns:
z – Elevation tensor with the same shape as unw.
- Return type:
Tensor
- torchbp.interferometry.phase_to_elevation_polar(unw, origin1, origin2, fcenter, grid, model='layover')[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.
fcenter (float) – Center frequency of the transmitted spectrum in Hz, sets the wavelength. Not necessarily the same as the backprojection
fc, which is a phase reference (see Choosing fc for backprojection).grid (PolarGrid or dict) – Image grid definition. PolarGrid object or dictionary.
model (str) – Height-sensitivity model.
"layover"(default): the scatterer imaged at a ground-plane pixel is the one whose master range equals the pixel’s."point": the point-phase-center form (z2/r2 - z1/r1), which assumes the scatterer sits directly above the pixel. Not as accurate with layover.
- Returns:
z – Elevation tensor with the same shape as unw.
- Return type:
Tensor
- torchbp.interferometry.phase_to_elevation_slant_polar(unw, origin1, origin2, fcenter, 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].
fcenter (float) – Center frequency of the transmitted spectrum in Hz, sets the wavelength. Not necessarily the same as the backprojection
fc, which is a phase reference (see Choosing fc for backprojection).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]