torchbp.ops.afbp module

torchbp.ops.afbp.afbp(data, grid, fc, r_res, pos, nsub, d0=0.0, dealias=False, data_fmod=0.0, alias_fmod=0.0, guard_theta=4, att=None, g=None, g_extent=None, normalize=True, weight_map_downsample=4, weight_eps=None, dem=None, _batched_fusion=None, data_interp_method='linear')[source]

Accelerated factorized backprojection. [1]

Single-level factorized backprojection for short apertures. The aperture is split into nsub subapertures which are backprojected onto a shared polar grid decimated nsub times in theta; because every subaperture image uses the same origin, each one holds a contiguous patch of the full image’s azimuth wavenumber spectrum, aliased into the decimated grid band. The full-resolution image is assembled in the 2-D wavenumber domain: FFT of the subaperture images, placement of each aliased spectrum patch at its true azimuth wavenumber (the patch center K_r * x_u is proportional to the range wavenumber, so the placement is computed per range-wavenumber row), and inverse FFT. There is no interpolation anywhere, which makes the fusion considerably more accurate than the recursive ffbp() merges; the output matches backprojection_polar_2d(data, grid, ...) including pixel phase.

The subaperture spectrum patch positions assume a straight track along the y-axis in the grid coordinate frame (pos should be centered, see torchbp.util.center_pos()). Deviations of the track from a straight line are handled exactly by the subaperture backprojections and only degrade the fusion in proportion to the deviation over the aperture length. The classical algorithm assumes a slant plane image; here the grid is the torchbp ground plane one and the track altitude scales the patch positions by the ground-to-slant range ratio, which varies over the swath. The fusion follows it by processing the swath in range blocks, each with the ratio at its own center (automatic, exact in the flat geometry limit). For long apertures over a wide near-in swath prefer ffbp(), which handles altitude exactly, possibly with afbp as its base layer (ffbp(..., afbp_nsub=nsub)).

Gradient can be calculated with respect to data. Gradient with respect to pos flows through the subaperture backprojections; the fusion spectrum placement is treated as constant (same as ffbp()).

Parameters:
  • data (Tensor) – Range compressed input data. Shape should be [nsweeps, samples].

  • grid (PolarGrid or dict) –

    Polar grid definition. Can be:

    • PolarGrid object: PolarGrid(r_range=(50, 100), theta_range=(-1, 1), nr=200, ntheta=400)

    • dict: {"r": (r0, r1), "theta": (theta0, theta1), "nr": nr, "ntheta": ntheta}

    where theta represents sin of angle (-1, 1 for 180 degree view). The theta axis should be oversampled with respect to the full aperture azimuth bandwidth; the subaperture spectrum patches only stay unaliased on the decimated grid when (theta1 - theta0) / ntheta <= lambda_min / (2 * L / nsub) where L is the aperture length (checked, warns when violated).

  • fc (float) – RF center frequency in Hz.

  • r_res (float) – Range bin resolution in data (meters). For FMCW radar: c/(2*bw*oversample), where c is speed of light, bw is sweep bandwidth, and oversample is FFT oversampling factor.

  • pos (Tensor) – Position of the platform at each data point. Shape should be [nsweeps, 3].

  • nsub (int) – Number of subapertures, treated as an upper bound. The subaperture backprojection cost drops roughly nsub times below direct backprojection. Larger values need a theta-oversampled grid (see grid) and increase the relative cost of the guard band and the fusion. The value is lowered silently when the requested split cannot work: to keep at least two pulses per subaperture, and to keep the internal grid alpha extent within the grating-free extent of the pulse sampling lambda_min / (2 * max pulse spacing) — a subaperture of few pulses has azimuth grating replicas at that period which would alias through the fusion, and the internal extent grows with nsub through the guard band. The cap keeps a clearance below the replica spacing (fill factor 0.7) because the replica sidelobe skirts leak in well before the replicas themselves. Accuracy still degrades gradually as nsub grows: the skirt floor scales with the pulses per subaperture (measured on a full |theta| <= 1 grid: ~1 % error at 30+ pulses per subaperture, several percent below ~10, concentrated at the theta extent edges) — for edge-critical scenes keep the subapertures tens of pulses long rather than requesting the largest nsub. Falls back to direct backprojection when no split works: the output theta extent alone reaches the grating replicas (a direct image of such a grid carries grating lobes anyway), or the decimated grid would not be smaller than the output.

  • d0 (float) – Zero range correction.

  • dealias (bool) – If True removes the range spectrum aliasing. Equivalent to applying torchbp.util.bp_polar_range_dealias on the SAR image. Default is False.

  • data_fmod (float) – Range modulation frequency applied to input data.

  • alias_fmod (float) – Range modulation frequency applied to SAR image.

  • guard_theta (int) – Internal guard band on each side of the theta extent in decimated grid cells, cropped from the output. The subaperture images treat theta as circular, so the response of a target near the grid edge wraps around with a broadband spectral skirt that the fusion cannot separate; the guard moves the wrap point away from the scene. The default suits scenes with targets at the theta edges; a scene with an empty margin can use less.

  • att (Tensor or None) – Antenna rotation tensor [roll, pitch, yaw], shape [nsweeps, 3]. Only used with an antenna pattern.

  • g (Tensor or None) – Square-root of two-way antenna gain in spherical coordinates, shape: [elevation, azimuth]. With normalize=False the output is the unnormalized gain-weighted accumulation, matching backprojection_polar_2d(..., normalize=False) (used by ffbp() as its base image). With normalize=True the accumulation is normalized with regularized illumination moment maps, matching the antenna-weighted ffbp() output; the direct kernel’s exact per-pixel normalization is an aperture-wide quantity that cannot be reassembled from subaperture images, so backprojection_polar_2d(..., normalize=True) is only matched where the illumination is not weak. A gain table that ends inside the scene theta extent puts a hard cutoff step into every subaperture image which the wavenumber fusion cannot represent: the accumulation dims and smears around the cutoff (~40 % loss at the edge columns measured on a full-extent grid; warned). Roll the pattern off smoothly to zero with torchbp.util.taper_antenna_pattern() to remove the step. Even then the weighted accumulation carries the fusion’s spectral leakage floor into weakly illuminated theta zones at full amplitude, where a downstream Wiener normalization amplifies it — inside ffbp(), scenes reaching the beam edges should use antenna_leaf_gain="subaperture", which applies the gain after the fusion and attenuates the leakage where the normalization would amplify it.

  • g_extent (list or None) – List of [g_el0, g_az0, g_el1, g_az1]. See backprojection_polar_2d().

  • normalize (bool) – See g. Ignored when no antenna pattern is given.

  • weight_map_downsample (int) – Decimation of the illumination weight maps used by the normalize=True antenna path, as in ffbp(). The maps are additionally computed from a 1/nsub subset of the pulses (the per-pulse footprints move slowly along the aperture); computed from every pulse they can cost more than the backprojection itself.

  • weight_eps (float or None) – Regularization of the antenna normalization, see ffbp().

  • dem (Tensor or None) – Digital elevation model. Height of every pixel in the image, shape [dem_nr, dem_ntheta], covering the same r and theta extent as grid; may be coarser than the grid. The subaperture backprojections place the pixels at the DEM height (edge-clamped over the internal theta guard band) and the dealias carrier is DEM-referenced, matching backprojection_polar_2d(..., dem=dem) with the same dealias. The wavenumber fusion follows the ground-to-slant factor of the per-range-row mean terrain height through its range blocks; the variation of the terrain with theta within a row is not representable in the row-ensemble fusion model and causes a localized amplitude error at bright targets on strong theta slopes, growing roughly as nsub**2 while the pixel phase stays exact (measured: a couple percent at nsub=4 with relief ~10 % of the slant range, well under 1 % for flat or range-only terrain profiles). Use a smaller nsub or direct backprojection when peak amplitude accuracy on steep terrain matters. Gradients are not supported with a DEM (the backprojection kernels have no DEM gradient); backward raises like backprojection_polar_2d(..., dem=dem).

  • data_interp_method (str or tuple) – Range interpolation method of the subaperture backprojections, see backprojection_polar_2d(). Gradients are only supported with the default “linear”.

  • _batched_fusion (bool | None)

Returns:

img – Polar format radar image. Shape is [nr, ntheta].

Return type:

Tensor

References

[1]
  1. Zhang, H. -l. Li, Z. -j. Qiao and Z. -w. Xu, “A Fast BP

Algorithm With Wavenumber Spectrum Fusion for High-Resolution Spotlight SAR Imaging,” in IEEE Geoscience and Remote Sensing Letters, vol. 11, no. 9, pp. 1460-1464, Sept. 2014.