torchbp.ops.backproj module
- torchbp.ops.backproj.backprojection_cart_2d(data, grid, fc, r_res, pos, d0=0.0, beamwidth=3.141592653589793, data_fmod=0)[source]
2D backprojection with cartesian coordinates.
Gradient can be calculated with respect to data and pos.
- Parameters:
data (Tensor) – Range compressed input data. Shape should be [nbatch, nsweeps, samples] or [nsweeps, samples]. If input is 3 dimensional the first dimensions is number of independent images to form at the same time. Whole batch is processed with same grid and other arguments.
grid (CartesianGrid or dict) –
Cartesian grid definition. Can be:
CartesianGrid object:
CartesianGrid(x_range=(-50, 50), y_range=(-50, 50), nx=200, ny=200)dict:
{"x": (x0, x1), "y": (y0, y1), "nx": nx, "ny": ny}
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].
beamwidth (float) – Beamwidth of the antenna in radians. Points outside the beam are not calculated.
d0 (float) – Zero range correction.
data_fmod (float) – Range modulation frequency applied to input data.
- Returns:
img – Cartesian format radar image.
- Return type:
Tensor
- torchbp.ops.backproj.backprojection_cart_2d_tx_power(wa, g, g_extent, grid, r_res, pos, att, normalization=None, azimuth_resolution=True)[source]
Cartesian-grid variant of
backprojection_polar_2d_tx_power().Calculates square root of transmitted power to each pixel of a Cartesian image grid. Can be used to correct for antenna pattern and distance effect on a Cartesian radar image (e.g. from
backprojection_cart_2d()).Each pixel takes its ground position
(x, y, 0)directly from the Cartesian grid (z = 0 ground plane); the platform altitude used for the elevation, distance and incidence-angle calculations is the per-sweepposz coordinate.- Parameters:
wa (Tensor) – Weighting coefficient for amplitude of each pulse. Should include window function and transmit power variation if known, shape: [nsweeps] or [nbatch, nsweeps].
g (Tensor) – Square-root of two-way antenna gain in spherical coordinates, shape: [elevation, azimuth]. If TX antenna equals RX antenna, then this should be just antenna gain. (0, 0) angle is at the beam center.
g_extent (list) –
[g_el0, g_az0, g_el1, g_az1]giving the elevation/azimuth axis limits ofgin radians.grid (CartesianGrid or dict) –
Cartesian grid definition. Can be:
CartesianGrid object:
CartesianGrid(x_range=(-50, 50), y_range=(-50, 50), nx=200, ny=200)dict:
{"x": (x0, x1), "y": (y0, y1), "nx": nx, "ny": ny}
r_res (float) – Range bin resolution in data (meters). Currently unused by the computation and kept for API compatibility; the nadir resolution floor uses the image grid x spacing instead.
pos (Tensor) – Position of the platform at each data point. Shape should be [nsweeps, 3] or [nbatch, nsweeps, 3].
att (Tensor) – Euler angles of the radar antenna at each data point. Shape should be [nsweeps, 3] or [nbatch, nsweeps, 3]. [Roll, pitch, yaw]. Pitch rotates the antenna pattern about its boresight (the along-track attitude angle for a side-looking antenna).
normalization (str or None) –
- Valid choices are:
”sigma” to divide each value by sin of incidence angle. “gamma” to divide each value by of tan of incidence angle. “beta” or None for no incidence angle normalization. “point” to normalize to constant reflectivity (no ground patch).
azimuth_resolution (bool) – If True (default), also normalize for the varying azimuth resolution. See
backprojection_polar_2d_tx_power()for details. Pixels with fewer than two contributing sweeps have no measurable azimuth aperture and are set to inf. Set to False to get the pure antenna/range illumination.
- Returns:
tx_power – Cartesian format image of square root of power returned from each pixel assuming constant reflectivity.
- Return type:
Tensor
- torchbp.ops.backproj.backprojection_polar_2d(data, grid, fc, r_res, pos, d0=0.0, dealias=False, att=None, g=None, g_extent=None, data_fmod=0, alias_fmod=0, normalize=True, dem=None, interp_method='linear')[source]
2D backprojection with pseudo-polar coordinates.
Gradient can be calculated with respect to data and pos (not supported with dem, and only with
interp_method="linear").- Parameters:
data (Tensor) – Range compressed input data. Shape should be [nbatch, nsweeps, samples] or [nsweeps, samples]. If input is 3 dimensional the first dimensions is number of independent images to form at the same time. Whole batch is processed with same grid and other arguments.
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
thetarepresents sin of angle (-1, 1 for 180 degree view).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] or [nbatch, nsweeps, 3].
d0 (float) – Zero range correction.
dealias (bool) – If True removes the range spectrum aliasing. Equivalent to applying torchbp.util.bp_polar_range_dealias (with the same dem) on the SAR image. When dem is given, the carrier is always referenced to the DEM height instead of the z=0 plane: a flat-plane carrier would leave a terrain-dependent residual whose local frequency aliases the image spectrum on any significant topography. Default is False.
att (Tensor) – Antenna rotation tensor. [Roll, pitch, yaw]. Only yaw is used and only if beamwidth < Pi to filter out data outside the antenna beam.
g (Tensor or None) – Square-root of two-way antenna gain in spherical coordinates, shape: [elevation, azimuth]. If TX antenna equals RX antenna, then this should be just antenna gain. (0, 0) angle is at the beam center.
g_extent (list or None) – List of [g_el0, g_az0, g_el1, g_az1]. g_el0, g_el1 are grx and gtx elevation axis start and end values. Units in radians. -pi/2 + +pi/2 if including data over the whole sphere. g_az0, g_az1 are grx and gtx azimuth axis start and end values. Units in radians. -pi to +pi if including data over the whole sphere.
data_fmod (float) – Range modulation frequency applied to input data.
alias_fmod (float) – Range modulation frequency applied to SAR image.
normalize (bool) – If True (default), apply W1/W2 normalization when antenna pattern is used. The antenna pattern should be nonzero everywhere to avoid noise amplification at pixels illuminated only near pattern nulls. Set to False for FFBP to output unnormalized accumulation.
dem (Tensor or None) – Digital elevation model sampled on the image polar grid. Shape [dem_nr, dem_ntheta], covering the same r and theta extent as grid. The DEM resolution can be coarser than the image grid; heights are bilinearly interpolated at each pixel. Values are pixel z coordinates in the same frame as pos. If None (default) pixels are assumed to lie on the z=0 plane. See torchbp.util.dem_to_polar for resampling a Cartesian DEM onto the polar grid.
interp_method (str or tuple) –
Range interpolation method of the input data:
”linear” (default): linear interpolation. The only method that supports gradients.
(“lanczos”, order): Lanczos interpolation with
ordertaps. CUDA only.(“knab”, order, oversample): Knab interpolation with
ordertaps, designed for data oversampled byoversample(>= 1). Much lower range interpolation error than linear when the data is oversampled. On CPUordermust be even and <= 16.
- Returns:
img – Pseudo-polar format radar image.
- Return type:
Tensor
- torchbp.ops.backproj.backprojection_polar_2d_knab(data, grid, fc, r_res, pos, d0=0.0, dealias=False, order=4, oversample=2, att=None, g=None, g_extent=None, data_fmod=0, alias_fmod=0, dem=None)[source]
2D backprojection with pseudo-polar coordinates. Interpolates input data using knab interpolation. Same as
backprojection_polar_2d()withinterp_method=("knab", order, oversample).Gradient not supported.
The CPU implementation evaluates the kernel through a precomputed polyphase weight table (nearest of 2048 fractional-position rows) instead of transcendentally per tap; the quantization error is ~-70 dB, below the kernel truncation error at practical orders. CPU requires an even
order<= 16.- Parameters:
data (Tensor) – Range compressed input data. Shape should be [nbatch, nsweeps, samples] or [nsweeps, samples]. If input is 3 dimensional the first dimensions is number of independent images to form at the same time. Whole batch is processed with same grid and other arguments.
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
thetarepresents sin of angle (-1, 1 for 180 degree view).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] or [nbatch, nsweeps, 3].
d0 (float) – Zero range correction.
dealias (bool) – If True removes the range spectrum aliasing. Equivalent to applying torchbp.util.bp_polar_range_dealias (with the same dem) on the SAR image. When dem is given the carrier is referenced to the DEM height instead of the z=0 plane. Default is False.
order (int) – Number of nearby samples to use for interpolation of one new sample. Even number is preferred.
oversample (float) – Oversampling factor in the input data.
att (Tensor) – Antenna rotation tensor. [Roll, pitch, yaw]. Only yaw is used and only if beamwidth < Pi to filter out data outside the antenna beam.
g (Tensor or None) – Square-root of two-way antenna gain in spherical coordinates, shape: [elevation, azimuth]. If TX antenna equals RX antenna, then this should be just antenna gain. (0, 0) angle is at the beam center.
g_extent (list or None) – List of [g_el0, g_az0, g_el1, g_az1]. g_el0, g_el1 are grx and gtx elevation axis start and end values. Units in radians. -pi/2 + +pi/2 if including data over the whole sphere. g_az0, g_az1 are grx and gtx azimuth axis start and end values. Units in radians. -pi to +pi if including data over the whole sphere.
data_fmod (float) – Range modulation frequency applied to input data.
alias_fmod (float) – Range modulation frequency applied to SAR image.
dem (Tensor or None) – Digital elevation model sampled on the image polar grid. Shape [dem_nr, dem_ntheta], covering the same r and theta extent as grid. May be coarser than the image grid. See backprojection_polar_2d.
- Returns:
img – Pseudo-polar format radar image.
- Return type:
Tensor
- torchbp.ops.backproj.backprojection_polar_2d_lanczos(data, grid, fc, r_res, pos, d0=0.0, dealias=False, order=6, att=None, g=None, g_extent=None, data_fmod=0, alias_fmod=0, dem=None)[source]
2D backprojection with pseudo-polar coordinates. Interpolates input data using lanczos interpolation. Same as
backprojection_polar_2d()withinterp_method=("lanczos", order).Gradient not supported. CUDA only.
- Parameters:
data (Tensor) – Range compressed input data. Shape should be [nbatch, nsweeps, samples] or [nsweeps, samples]. If input is 3 dimensional the first dimensions is number of independent images to form at the same time. Whole batch is processed with same grid and other arguments.
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
thetarepresents sin of angle (-1, 1 for 180 degree view).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] or [nbatch, nsweeps, 3].
d0 (float) – Zero range correction.
dealias (bool) – If True removes the range spectrum aliasing. Equivalent to applying torchbp.util.bp_polar_range_dealias (with the same dem) on the SAR image. When dem is given the carrier is referenced to the DEM height instead of the z=0 plane. Default is False.
order (int) – Number of nearby samples to use for interpolation of one new sample.
att (Tensor) – Antenna rotation tensor. [Roll, pitch, yaw]. Only yaw is used and only if beamwidth < Pi to filter out data outside the antenna beam.
g (Tensor) – Square-root of two-way antenna gain in spherical coordinates, shape: [elevation, azimuth]. If TX antenna equals RX antenna, then this should be just antenna gain. (0, 0) angle is at the beam center.
g_extent (list or None) – List of [g_el0, g_az0, g_el1, g_az1]. g_el0, g_el1 are grx and gtx elevation axis start and end values. Units in radians. -pi/2 + +pi/2 if including data over the whole sphere. g_az0, g_az1 are grx and gtx azimuth axis start and end values. Units in radians. -pi to +pi if including data over the whole sphere.
data_fmod (float) – Range modulation frequency applied to input data.
alias_fmod (float) – Range modulation frequency applied to SAR image.
dem (Tensor or None) – Digital elevation model sampled on the image polar grid. Shape [dem_nr, dem_ntheta], covering the same r and theta extent as grid. May be coarser than the image grid. See backprojection_polar_2d.
- Returns:
img – Pseudo-polar format radar image.
- Return type:
Tensor
- torchbp.ops.backproj.backprojection_polar_2d_resolution(wa, g, g_extent, grid, fc, pos, att, altitude=0.0, sweeps_chunk=64)[source]
Estimate the angular (azimuth) resolution of every polar pixel from the trajectory and antenna pattern.
- Parameters:
wa (Tensor) – Per-sweep amplitude weighting (window and/or transmit power), the same
wapassed tobackprojection_polar_2d_tx_power(), shape: [nsweeps] or [nbatch, nsweeps].g (Tensor) – Square-root of two-way antenna gain, shape: [elevation, azimuth]. See
backprojection_polar_2d_tx_power().g_extent (list) –
[el0, az0, el1, az1]angular extent ofgin radians.grid (PolarGrid or dict) – Polar grid definition,
thetais the sine of the azimuth angle.fc (float) – Radar center frequency (Hz). Used for the wavelength
c/fc.pos (Tensor) – Platform position per sweep, shape: [nsweeps, 3] or [nbatch, nsweeps, 3].
att (Tensor) – Antenna Euler angles [roll, pitch, yaw] per sweep, same shape as
pos. Roll and yaw are used (pitch is ignored), matchingbackprojection_polar_2d_tx_power().altitude (float) – If > 0 the grid is treated as slant-range (BP origin at sensor altitude,
posz ~ 0) and pixels are mapped to the ground using this altitude, matchingbackprojection_polar_2d_tx_power_slant(). If 0 (default) the grid is ground-range and the per-sweepposz is used.sweeps_chunk (int) – Number of sweeps processed at once. Trades memory for speed, does not affect the result.
- Returns:
resolution – Pseudo-polar map of the estimated angular azimuth resolution (radians), shape [nr, ntheta] or [nbatch, nr, ntheta]. Pixels never illuminated by any sweep are
inf.- Return type:
Tensor
- torchbp.ops.backproj.backprojection_polar_2d_tx_power(wa, g, g_extent, grid, r_res, pos, att, normalization=None, azimuth_resolution=True, dem=None)[source]
Calculate square root of transmitted power to image plane. Can be used to correct for antenna pattern and distance effect on the radar image.
- Parameters:
wa (Tensor) – Weighting coefficient for amplitude of each pulse. Should include window function and transmit power variation if known, shape: [nsweeps] or [nbatch, nsweeps].
g (Tensor) – Square-root of two-way antenna gain in spherical coordinates, shape: [elevation, azimuth]. If TX antenna equals RX antenna, then this should be just antenna gain. (0, 0) angle is at the beam center.
g_az0 (float) – grx and gtx azimuth axis starting value. Units in radians. -pi if including data over the whole sphere.
g_el0 (float) – grx and gtx elevation axis starting value. Units in radians. -pi/2 if including data over the whole sphere.
g_az1 (float) – grx and gtx azimuth axis end value. Units in radians. +pi if including data over the whole sphere.
g_el1 (float) – grx and gtx elevation axis end value. Units in radians. +pi/2 if including data over the whole sphere.
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
thetarepresents sin of angle (-1, 1 for 180 degree view).r_res (float) – Range bin resolution in data (meters). Currently unused by the computation and kept for API compatibility; the nadir resolution floor uses the image grid range spacing instead.
pos (Tensor) – Position of the platform at each data point. Shape should be [nsweeps, 3] or [nbatch, nsweeps, 3].
att (Tensor) – Euler angles of the radar antenna at each data point. Shape should be [nsweeps, 3] or [nbatch, nsweeps, 3]. [Roll, pitch, yaw]. Pitch rotates the antenna pattern about its boresight (the along-track attitude angle for a side-looking antenna).
normalization (str or None) –
- Valid choices are:
”sigma” to divide each value by sin of incidence angle. “gamma” to divide each value by of tan of incidence angle. “beta” or None for no incidence angle normalization. “point” to normalize to constant reflectivity (no ground patch).
azimuth_resolution (bool) – If True (default), also normalize for the varying azimuth resolution. The gain-weighted angular spread of the line of sight is measured per pixel and folded into the returned power so that dividing a SAR image by tx_power removes the residual azimuth brightness slope (caused by the resolution cell growing toward the swath edges) in addition to the antenna pattern and range falloff. See
backprojection_polar_2d_resolution()for the standalone map. Pixels with fewer than two contributing sweeps have no measurable azimuth aperture and are set to inf. Set to False to get the pure antenna/range illumination.dem (Tensor or None) – Digital elevation model heights, shape [dem_nr, dem_ntheta], sampled on the image polar grid: same r and theta extent as grid. The resolution can be lower than the image grid, in which case heights are interpolated bilinearly for each pixel. Values are pixel z coordinates in the same coordinate system as pos. torchbp.util.dem_to_polar can be used to resample a Cartesian DEM to the polar grid. Default is None: pixels lie on the z=0 plane. The DEM height fixes the range and the antenna pattern elevation angle, and the “sigma” and “gamma” normalizations use the local terrain slope: “sigma” divides by the projected-area factor (sin(inc) - u*cos(inc))/N with up-range slope u and surface normal magnitude N (terrain surface area normalization), “gamma” additionally divides by the cosine of the local incidence angle (terrain-flattened gamma). Layover folds clamp at the nadir resolution floor; facets past grazing (shadow) contribute nearly zero to the gamma illumination.
g_extent (list)
- Returns:
tx_power – Pseudo-polar format image of square root of power returned from each pixel assuming constant reflectivity.
- Return type:
Tensor
- torchbp.ops.backproj.backprojection_polar_2d_tx_power_slant(wa, g, g_extent, grid, r_res, pos, att, altitude, normalization=None, azimuth_resolution=True, dem=None)[source]
Slant-range variant of
backprojection_polar_2d_tx_power().For slant-range BP images (BP origin at sensor altitude, pos z ≈ 0), the standard tx_power kernel gets wrong elevation angles because pos_z ≈ 0. This variant maps each polar pixel (r, θ) to its ground position
(sqrt(r²cos²θ − H²), r·sinθ)and uses the supplied altitude H for all elevation / distance / normalization calculations.- Parameters:
wa (Tensor) – Same as
backprojection_polar_2d_tx_power().g (Tensor) – Same as
backprojection_polar_2d_tx_power().g_extent (list) – Same as
backprojection_polar_2d_tx_power().grid (PolarGrid | dict) – Same as
backprojection_polar_2d_tx_power().r_res (float) – Same as
backprojection_polar_2d_tx_power().pos (Tensor) – Same as
backprojection_polar_2d_tx_power().att (Tensor) – Same as
backprojection_polar_2d_tx_power().normalization (str | None) – Same as
backprojection_polar_2d_tx_power().azimuth_resolution (bool) – Same as
backprojection_polar_2d_tx_power().altitude (float) – Sensor altitude above ground (metres). Must be > 0.
dem (Tensor or None) – Not supported for the slant variant; must be None.
- Returns:
tx_power – Same as
backprojection_polar_2d_tx_power().- Return type:
Tensor
- torchbp.ops.backproj.blocksvd_alpha(img, data, pos, blocks, fc, r_res, r0, dr, theta0, dtheta, d0=0.0, data_fmod=0.0)[source]
Per-block inner product of a master image against per-sweep slave backprojection footprints, used by
torchbp.autofocus.insar_rme_blocksvd().For each block
band sweepm:alpha[b, m] = Sum_pix conj(img[pix]) * data[m, r_idx(pix, m)] * exp(j k R(pix, m))
where the sum runs over the block’s pixel rectangle on the polar grid. Pixels are at
r = r0 + dr * i,theta = theta0 + dtheta * jon the z=0 plane, matchingbackprojection_polar_2d(). Linear range interpolation; samples outside the data range window contribute zero. Equivalent toconj(img_patch) @ BwithBfromgpga_backprojection_2d_core()over the block’s pixels, without materializingB.- Parameters:
img (Tensor [nr, ntheta]) – Complex master image on the polar grid, with any per-pixel weighting (e.g. coherence) already applied.
data (Tensor [nsweeps, nsamples]) – Range-compressed slave data.
pos (Tensor [nsweeps, 3]) – Slave platform positions.
blocks (Tensor [nblocks, 6]) – Integer block definitions
(r_idx0, r_idx1, theta_idx0, theta_idx1, sweep_lo, sweep_hi). Pixel rectangles are half-open index ranges intoimg;alpha[b, m]is zero for sweeps outside[sweep_lo, sweep_hi).fc (float) – RF center frequency in Hz.
r_res (float) – Range bin resolution in data (meters).
r0 (float) – Polar grid definition.
dr (float) – Polar grid definition.
theta0 (float) – Polar grid definition.
dtheta (float) – Polar grid definition.
d0 (float) – Zero range correction.
data_fmod (float) – Range modulation frequency applied to input data.
- Returns:
alpha – Complex per-block per-sweep inner products.
- Return type:
Tensor [nblocks, nsweeps]
- torchbp.ops.backproj.gpga_backprojection_2d_core(target_pos, data, pos, fc, r_res, d0=0.0, interp_method='linear', data_fmod=0)[source]
Generalized phase gradient autofocus.
- Parameters:
target_pos (Tensor) – Positions of point-like targets to use to focus the image. 3D Cartesian coordinates (x, y, z). Dimensions: [ntargets, 3].
data (Tensor) – Range compressed input data. Shape should be [nsweeps, samples].
pos (Tensor) – Position of the platform at each data point. Shape should be [nsweeps, 3].
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.
d0 (float) – Zero range correction.
interp_method (str) – Interpolation method “linear”: linear interpolation. (“lanczos”, N): Lanczos interpolation with order N.
data_fmod (float) – Range modulation frequency applied to input data.
- Returns:
data_out – Values from input data used in backprojection of each target in target_pos tensor. Shape is [ntargets, nsweeps].
- Return type:
Tensor
- torchbp.ops.backproj.projection_cart_2d(img, pos, grid, fc, fs, gamma, sweep_samples, d0=0.0, dem=None, att=None, g=None, g_extent=None, use_rvp=True, normalization='beta', vel=None)[source]
Calculate FMCW radar data for each radar position in pos when measuring the scene in img.
- Parameters:
img (Tensor) – SAR image in Cartesian coordinates. Shape [nx, ny] or [nbatch, nx, ny].
grid (CartesianGrid or dict) –
Cartesian grid definition. Can be:
CartesianGrid object:
CartesianGrid(x_range=(-50, 50), y_range=(-50, 50), nx=200, ny=200)dict:
{"x": (x0, x1), "y": (y0, y1), "nx": nx, "ny": ny}
fc (float) – RF center frequency in Hz.
fs (float) – Sampling frequency in Hz.
gamma (float) – Distance to IF frequency conversion factor. For FMCW radar: BW / tsweep.
pos (Tensor) – Position of the platform at each data point. Shape should be [nsweeps, 3] or [nbatch, nsweeps, 3].
d0 (float) – Zero range correction.
dem (Tensor or None) – Digital elevation map. Should have shape: [nx, ny]. Set to zero if None.
att (Tensor or None) – Euler angles of the radar antenna at each data point. Shape should be [nsweeps, 3] or [nbatch, nsweeps, 3]. [Roll, pitch, yaw]. Only roll and yaw are used at the moment.
g (Tensor or None) – Square-root of two-way antenna gain in spherical coordinates, shape: [elevation, azimuth]. If TX antenna equals RX antenna, then this should be just antenna gain. (0, 0) angle is at the beam center.
g_extent (list or None) – List of [g_el0, g_az0, g_el1, g_az1]. g_el0, g_el1 are grx and gtx elevation axis start and end values. Units in radians. -pi/2 + +pi/2 if including data over the whole sphere. g_az0, g_az1 are grx and gtx azimuth axis start and end values. Units in radians. -pi to +pi if including data over the whole sphere.
use_rvp (bool) – True to add residual video phase term.
normalization (str) – Surface reflectivity definition to use. Valid choices are “beta” (default), “sigma” or “gamma”. “beta” (or “sigma” or None): No look angle dependency. “gamma”: Multiply the reflectivity be cross-sectional area of the patch (more realistic).
vel (Tensor or None) – Velocity tensor in m/s. Shape should match with pos.
sweep_samples (int)
- Returns:
data – FMCW radar data at each position. Shape [nbatch, nsweeps, nsamples].
- Return type:
Tensor
- torchbp.ops.backproj.projection_cart_2d_nufft(img, pos, grid, fc, fs, gamma, sweep_samples, d0=0.0, dem=None, att=None, g=None, g_extent=None, use_rvp=True, normalization='beta')[source]
NUFFT-based forward projection. Equivalent to
projection_cart_2d()without velocity (vel=None) but uses a Type-1 NUFFT for O(N log M) cost instead of O(N·M).Parameters match
projection_cart_2d()exceptvelis not accepted.- Parameters:
img (Tensor)
pos (Tensor)
grid (CartesianGrid | dict)
fc (float)
fs (float)
gamma (float)
sweep_samples (int)
d0 (float)
dem (Tensor | None)
att (Tensor | None)
g (Tensor | None)
g_extent (list | None)
use_rvp (bool)
normalization (str)
- Return type:
Tensor