Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

SAR geocoding and radiometric terrain correction

Design · range-Doppler geocoding, terrain flattening and layover and shadow masks for Sentinel-1, in radiomax, geoops, geoproducts and pipekit-array

5 Dec 2026 · proposed

TL;DR

1 Motivation

A Sentinel-1 GRD image is not a map. Its rows are azimuth times and its columns ground-range samples on the ellipsoid, so every mountain is displaced towards the sensor, foreslopes are compressed and bright, backslopes stretched and dark, and the steepest foreslopes fold over (layover) or vanish (shadow). Two corrections fix this, and the stack has neither:

  1. Geometric terrain correction (geocoding). For each cell of an output grid with a DEM height, find the radar pixel that saw it, by solving the range-Doppler equations, and read the image there.

  2. Radiometric terrain correction (terrain flattening). A radar pixel’s power comes from all the ground it illuminates, which depends on the terrain. Dividing by the illuminated area, computed from the DEM, gives γ⁰ that is comparable between foreslopes, backslopes and flat ground.

The blog post raphi-web, 2026 shows that the first one is a few hundred lines of NumPy: parse the annotation XML, interpolate 17 orbit state vectors, solve the zero-Doppler condition per DEM pixel, turn slant range into a GRD column with the annotation’s polynomial, and resample. It also shows the traps: it needed the geoid correction to make the image line up, it uses 60 bisection steps per pixel, and it stops before calibration and terrain flattening.

The stack already holds most of the ingredients, spread across packages that do not know about each other:

IngredientWhere it is today
geodetic to Earth-centred coordinates and backgeophysix geodetic_to_ecef, ecef_to_geodetic
the speed of light, the WGS84 ellipsoidgeophysix Constants.speed_of_light, WGS84
the line of sight, the local east–north–up frame, the view zenithradiomax view_angles
a ray meeting the ellipsoidradiomax earth_intersection
DN to σ⁰, β⁰, γ⁰, and conversions with an incidence angleradiomax dn_to_backscatter, sigma0_to_gamma0 and the rest of radiomax.sar
a warp as a functax plan with an adjointgeoops Reproject(engine="interp"), built on functax.interp plans
reading a grid at arbitrary points, differentiable in the pointsgeoops interp_at
DEM slope, gradientsgeoops slope_degrees, gradient_2d
speckle filtersgeoops despeckle_lee, despeckle_refined_lee, despeckle_frost
a vertical datum label on a height axisgeoarray’s height coordinate, datum ("EGM2008")

What is missing is the range-Doppler geometry that connects them, a reader that gets the annotation into arrays, and the radiometric step that needs the DEM.

Why not wrap SNAP or ISCE3. Both do all of this and more (§6). Wrapping them gives a file-to-file black box: no gradients through the geometry, no JAX, and no reuse of the pieces (the zero-Doppler time is also what a SAR forward model in a data-assimilation system needs). They stay the oracles that the stack’s version is checked against.

2 User stories

  1. A flood or wetland analyst wants γ⁰ on a UTM grid from a Sentinel-1 GRD scene and a Copernicus DEM, with layover and shadow masked, so a threshold on water does not fire on every backslope. They need the whole chain, SG-D1 to SG-D8.

  2. A data-assimilation developer in vardax wants the observation operator from a model state on a map grid to SAR backscatter in radar geometry, with its adjoint, so σ⁰ can enter a variational cost. The geocoding read-out H and its adjoint Hᵀ are that operator (SG-D4).

  3. A geolocation researcher wants derivatives of a target’s radar coordinates with respect to its height and the orbit, to estimate a DEM bias or an orbit offset from corner reflectors. The zero-Doppler solve has closed-form derivatives (§4.5), and a fixed-iteration Newton differentiates under JAX (SG-D3).

  4. A sea-ice or ocean-wind modeller in sesmax wants σ⁰ geocoded onto the model grid with the incidence angle of every pixel, because ocean backscatter falls steeply with incidence. They need G3 and G6; for wind they also need a geophysical model function (SG-O6).

  5. A reader developer in geoproducts wants one parser of the Sentinel-1 SAFE annotation that returns the orbit, timing, range polynomials, geolocation grid, calibration and noise tables as arrays, so no algorithm parses XML (SG-D8).

  6. A student wants to see why a mountain leans towards the satellite, by computing the radar coordinates of a few DEM cells by hand with the same functions the pipeline uses.

3 Scope

In scope

CodeAdditionPackage
G1Orbit read-out from state vectors: cubic Hermite (positions and velocities) and 8-point Lagrangeradiomax.sar
G2Zero-Doppler time, slant range, two-way delay, ground range from the annotation polynomial and backradiomax.sar
G3Radar coordinates (line, column) of Earth-centred points, for GRD and SLC timingradiomax.sar
G4Local incidence angle, projection angle, facet areas A_γ and A_β, and γ⁰ from areasradiomax.sar
G5Layover and shadow rules: the slope rule (elementwise) and the profile rules (monotone range, running maximum of the look angle)radiomax.sar, with G9
G6Geocoding from a coordinate field: a public warp whose source coordinates are given, returning the functax plan, so its adjoint is reachablegeoops
G7Vertical datum: orthometric to ellipsoidal heights with a geoid grid, honouring geoarray’s datumgeotoolz (geoops, geoarray)
G8Sentinel-1 SAFE annotation reader: orbit, timing, range polynomials, geolocation grid, calibration and noise tablesgeoproducts
G9cumulative_max on any array librarypipekit-array
G10A TerrainCorrect recipe composing G1 to G9 with radiomax’s calibration, and a geostack notebook on one subsampled scenegeoops; geostack

Out of scope

First release: steps S1 to S5 of §13 (G1 to G4, G6, G7 and G8). The masks (S6 with S8) and the recipe (S7) follow.

4 Background maths

4.1 Frames and the target

Everything is in Earth-centred, Earth-fixed coordinates (ECEF, m). A target at longitude λ, geodetic latitude φ and ellipsoidal height h is

P=((N+h)cos⁡φcos⁡λ,(N+h)cos⁡φsin⁡λ,(N(1−e2)+h)sin⁡φ),N=a1−e2sin⁡2φ\mathbf{P} = ((N + h)\cos\varphi\cos\lambda, (N + h)\cos\varphi\sin\lambda, (N(1 - e^2) + h)\sin\varphi), N = \frac{a}{\sqrt{1 - e^2 \sin^2\varphi}}

with a the semi-major axis and e² the squared eccentricity of WGS84; this is geophysix’s geodetic_to_ecef. The Copernicus DEM gives orthometric heights H above the EGM2008 geoid (EPSG:3855) on WGS84 longitudes and latitudes, and it is a surface model, so buildings and canopy are in it Airbus Defence and Space, 2022Pavlis et al., 2012. So the ellipsoidal height is h = H + N_g(λ, φ), with N_g the geoid undulation, tens of metres and varying over a scene. §4.5 shows what forgetting it costs.

4.2 The orbit

The annotation gives state vectors (tₖ, Sₖ, Vₖ), positions and velocities in ECEF, every 10 s. On the interval [tₖ, tₖ₊₁] of length Δ, at s = (t − tₖ)/Δ, the cubic Hermite read-out uses both:

S(t)=h00(s)Sk+h10(s)ΔVk+h01(s)Sk+1+h11(s)ΔVk+1\mathbf{S}(t) = h_{00}(s) \mathbf{S}_ k + h_{10}(s) \Delta\mathbf{V}_ k + h_{01}(s) \mathbf{S}_ {k+1} + h_{11}(s) \Delta\mathbf{V}_ {k+1}

with h₀₀ = 2s³ − 3s² + 1, h₁₀ = s³ − 2s² + s, h₀₁ = −2s³ + 3s², h₁₁ = s³ − s². Its derivatives give the velocity V(t) = Ṡ(t) and the acceleration A(t) = S̈(t), both needed below. SNAP reads the orbit with an 8-point Lagrange polynomial; ISCE3 defaults to a cubic Hermite and offers an 8th-order Legendre option; sarsen fits a degree-5 polynomial to the positions and differentiates it (§6). Because the velocities are in the Earth-fixed frame, the Earth’s rotation is already in them, and the geometry below needs no inertial frame.

4.3 The zero-Doppler condition

A SAR image is focused to zero Doppler: the target P is imaged at the azimuth time t at which the sensor is closest to it, where the range rate vanishes:

D(t)=(S(t)−P)⋅V(t)=0D(t) = (\mathbf{S}(t) - \mathbf{P}) \cdot \mathbf{V}(t) = 0

Its derivative is

D′(t)=∥V(t)∥2+(S(t)−P)⋅A(t)D'(t) = \lVert \mathbf{V}(t) \rVert^2 + (\mathbf{S}(t) - \mathbf{P}) \cdot \mathbf{A}(t)

The first term dominates: the second is the orbit’s curvature, a few percent of it. Newton’s step is t ← t − D(t)/D′(t). D is close to linear over a scene, so Newton converges in a few steps from any start inside the orbit table (§5).

4.4 Ranges and radar coordinates

At the zero-Doppler time t, the slant range and the two-way delay are

r=∥S(t)−P∥,τ=2rcr = \lVert \mathbf{S}(t) - \mathbf{P} \rVert, \tau = \frac{2r}{c}

with c the speed of light. The radar coordinates follow from the image timing, with t₀ the first line’s time, Δt the azimuth time interval, τ₀ the first sample’s two-way delay and Δτ the range sampling interval:

ℓ=t−t0Δt,jSLC=τ−τ0Δτ,jGRD=g(r)Δg,g(r)=∑i=0Kci(r−r0)i\ell = \frac{t - t_0}{\Delta t}, j_\mathrm{SLC} = \frac{\tau - \tau_0}{\Delta\tau}, j_\mathrm{GRD} = \frac{g(r)}{\Delta g}, g(r) = \sum_{i=0}^{K} c_i (r - r_0)^i

A GRD image is resampled to ground range on the ellipsoid, so its column is the ground range g over the ground pixel spacing Δg, and g comes from the annotation’s slant-to-ground polynomial (coefficients cᵢ about the reference slant range r₀), one set per azimuth time. The blog post takes the set nearest in time rather than interpolating the coefficients raphi-web, 2026; SG-O2 asks which to do.

4.5 Derivatives at zero Doppler

Two identities make the geometry cheap to differentiate. The range rate is zero at the solution, ∂r/∂t = D/r = 0, so the slant range’s derivative with respect to the target does not depend on how t moves (an envelope theorem):

∂r∂P=−(S−P)⊤r\frac{\partial r}{\partial \mathbf{P}} = -\frac{(\mathbf{S} - \mathbf{P})^\top}{r}

The azimuth time moves by the implicit function theorem, from ∂D/∂P = −Vᵀ:

∂t∂P=V⊤D′(t)\frac{\partial t}{\partial \mathbf{P}} = \frac{\mathbf{V}^\top}{D'(t)}

For a height error Δh along the ellipsoid normal n̂, the first gives Δr ≈ −Δh cos θᵢ, and on a GRD image a ground-range shift of about Δh / tan θᵢ, with θᵢ the incidence angle. The geoid undulation of §4.1 is such an error.

4.6 Local incidence and the projection angle

With the line of sight ℓ̂ = (S − P)/r and n̂_T the unit normal of the terrain from the DEM, the local incidence angle θ_loc and the projection angle ψ, the angle between n̂_T and the normal of the slant-range image plane (spanned by ℓ̂ and the along-track direction v̂ = V/‖V‖), are

cos⁡θloc=n^T⋅ℓ^,cos⁡ψ=n^T⋅v^×ℓ^∥v^×ℓ^∥\cos\theta_\mathrm{loc} = \hat{\mathbf{n}}_ T \cdot \hat{\boldsymbol{\ell}}, \cos\psi = \hat{\mathbf{n}}_ T \cdot \frac{\hat{\mathbf{v}} \times \hat{\boldsymbol{\ell}}}{\lVert \hat{\mathbf{v}} \times \hat{\boldsymbol{\ell}} \rVert}

up to the sign fixed by the look side. On flat ground θ_loc is the ellipsoid incidence θ and ψ = 90° − θ. Ulander’s slope correction is σ⁰_T = β⁰ cos ψ and γ⁰_T = β⁰ cos ψ / cos θ_loc Ulander, 1996, as the OPERA RTC-S1 algorithm document restates them Shiroma & Fattahi, 2024; on flat ground they reduce to radiomax’s β⁰ sin θ and β⁰ tan θ.

4.7 Terrain flattening by area projection

β⁰ is the backscatter per unit area in the slant-range image plane, A_β = δ_az δ_r per pixel. Small’s terrain-flattened γ⁰ divides the same power by the area the terrain presents to the radar, projected onto the plane normal to the look direction Small, 2011:

γT0=β0AβAγ,Aγ(j)=∑k→jakcos⁡θloc,k\gamma^0_T = \beta^0 \frac{A_\beta}{A_\gamma}, A_\gamma(j) = \sum_{k \to j} a_k \cos\theta_{\mathrm{loc},k}

where the sum runs over the DEM facets k imaged into radar pixel j, aₖ is a facet’s area, and facets in shadow or facing away (cos θ_loc ≤ 0) contribute nothing. On flat ground a radar pixel sees a ground area A_β / sin θ, so A_γ = A_β cot θ and γ⁰_T = β⁰ tan θ, radiomax’s sigma0_to_gamma0 composed with beta0_to_sigma0. In layover, several facets far apart on the ground fall into one radar pixel; the sum adds their areas, so their pooled power is shared out rather than counted once per facet, which a per-pixel cos ψ correction cannot do.

The area sum is the adjoint of geocoding. Write the geocoding read-out as a matrix H (N_Ω × N_r), from the N_r radar pixels to the N_Ω DEM cells, so that geocoded β⁰ is H β⁰. Spreading each facet’s projected area into the radar pixels it falls in, with the same weights, is its transpose:

Aγ=H⊤(a⊙cos⁡θloc)\mathbf{A}_\gamma = \mathbf{H}^\top \left(\mathbf{a} \odot \cos\boldsymbol{\theta}_\mathrm{loc}\right)

with a and θ_loc the per-cell vectors. The terrain-flattened, geocoded image is then H(β⁰ ⊙ A_β ⊘ A_γ): one plan, applied once forward and once adjoint. Small spreads each facet’s area with bilinear weights, which is the transpose of a bilinear read-out, and needs the DEM upsampled well beyond the radar grid to avoid gaps Small, 2011Shiroma & Fattahi, 2024. ISCE3’s area projection, used by OPERA RTC-S1, instead splits each cell into four triangles, maps their vertices to radar geometry and rasterises the projected polygon into weights, which is a different H with the same adjoint structure Shiroma et al., 2022Shiroma & Fattahi, 2024. The facet area is half the norm of the cross product of two edges.

4.8 Layover and shadow

Along one range line (fixed azimuth time), let x be the ground distance from the sensor’s nadir, z(x) the terrain, r(x) the slant range and α(x) the look angle from the sensor’s vertical. Then:

ISCE3 computes its mask this way: it samples each range line on a grid twice as wide as the image, flags shadow by the running maximum of the elevation angle, and flags layover by checking that the cross-track coordinate stays monotone when the points are sorted by slant range, in a near-to-far and a far-to-near pass. Its bitmask is 1 for shadow, 2 for layover and 3 for both.

5 Background numerics

The prototype measures the choices the design makes. Its orbit is circular, at 693 km and 98.18° inclination, seen from WGS84 rotating at 7.292115 × 10⁻⁵ rad s⁻¹, sampled every 10 s over 160 s as the annotation’s 17 state vectors are. Its targets are nine points on the ellipsoid at incidence angles from 32.5° to 46.7°, near Sentinel-1 IW’s range. Its terrain is a Gaussian hill on one range line in the zero-Doppler plane, on locally flat ground.

QuantityMeasured
Orbit read-out, maximum position error over the inner 100 s: straight chord between state vectors102 m
the same, cubic Hermite with velocities0.25 mm
the same, 8-point Lagrangebelow 10 nm (float64 round-off)
Velocity error: Hermite; 8-point Lagrange7.7 × 10⁻⁵ m s⁻¹; below 10⁻¹⁰ m s⁻¹ (round-off)
Zero-Doppler iterations to 10⁻⁹ s from the table’s middle: Newton with D′ exact1 to 4
the same, Newton with D′ ≈ ‖V‖²1 to 12
the same, bisection over the table38
Largest difference between the Newton and bisection times2.9 × 10⁻¹⁰ s
∂r/∂h at 35° look: closed form (§4.5) against a central difference−0.771896 both; relative gap 3 × 10⁻⁸
∂t/∂h: closed form against a central difference3.161 × 10⁻⁷ s m⁻¹ both
A 47 m height error at 32.5° incidence: slant range; ground range39.6 m; 73.8 m = 7.4 GRD pixels
the same at 46.7° incidence32.3 m; 44.4 m = 4.4 GRD pixels
the same, along track0.015 ms of azimuth time, about 0.1 m
Hill 1,500 m high, σ = 1 km, 35° incidence: active, passive layover, shadow (share of hill cells)13.2 %, 14.8 %, 0 %
the same hill at 41°5.6 %, 5.6 %, 0 %
Hill 800 m, σ = 1.5 km, 35°0 %, 0 %, 0 %
Hill 2,500 m, σ = 1 km, 41°18.3 %, 24.3 %, 21.8 %
Agreement of the elementwise slope rule with ∂r/∂x ≤ 0, every case100 %
Ellipsoid γ⁰ (radiomax today) on flat bins, true γ⁰ = 1 under the area modelwithin 0.05 dB
the same on slope bins outside layover−8.1 to +2.9 dB
the same on layover bins+10.2 to +15.2 dB

What follows from it.

The prototype does not measure the area projection’s own accuracy, because its synthetic β⁰ is generated by the same area model it would invert. S5 tests it against a published terrain-flattened product instead (§13).

6 Prior art

ProcessorWhat it hasWhat to takeWhat to avoid
ESA SNAP (s1tbx, now the microwave-toolbox; GPL-3.0, Java), RangeDopplerGeocodingOp, TerrainFlatteningOpthe reference processor for Sentinel-1: zero-Doppler time by bisection by default (a Newton variant exists), 8-point Lagrange orbits, terrain flattening after Small on an oversampled DEM, a layover and shadow band from SARSimulationOp; for Sentinel-1 it skips the residual bistatic correctionthe processing order; its outputs as an oracle for S7Java, file to file; no gradients
ISCE3 (Apache-2.0, C++ with Python bindings): geo2rdr, rdr2geo, RTC, TopoNASA-JPL’s SAR library: geo2rdr by Newton with a finite-difference Doppler derivative and a bracketing variant; Hermite (default) or Legendre orbits; RTC by area projection or Small’s bilinear distribution; the layover and shadow mask of §4.8; the processor behind OPERA RTC-S1, which starts from SLC and applies the bistatic and static-troposphere corrections Shiroma & Fattahi, 2024Newton; the area projection Shiroma et al., 2022; the mask convention; OPERA’s products as an oracle for S5no JAX, no array-API backends
sarsen with xarray-sentinel (B-Open; Apache-2.0, Python)backward geocoding and gamma flattening of Sentinel-1 on xarray and dask: zero-Doppler by secant or Newton with an analytic derivative, a degree-5 polynomial orbit, gamma areas from cross products spread with bilinear or nearest weights; xarray-sentinel reads the orbit, ground control points and srgr and grsr tablesthat a Python and xarray version is practical; the reader’s field setNumPy only, no adjoint; no layover or shadow mask was found in its source
pyroSAR (MIT), OST (MIT)workflows that drive SNAP (and, for pyroSAR, GAMMA) for Sentinel-1, with layover and shadow mask optionsthe recipes and defaultsthey wrap other processors
The blog post raphi-web, 2026geometric terrain correction of GRD in NumPy, with a test against the geolocation gridthe annotation fields used, the half-pixel convention, the geolocation grid as a test oraclebisection; uncalibrated output; no masks or flattening

No JAX or otherwise differentiable implementation of SAR geocoding or terrain flattening was found. The gap common to all of them is the geometry as differentiable array functions that compose with the rest of a JAX stack, and the area projection as the adjoint of the read-out rather than a second code path.

7 What it builds on

Each name below was read on main of its repository on 5 Dec 2026: radiomax v0.0.17, geophysix at 5837c8d, functax at 10b76c9, geotoolz at 6b4443a5, pipekit at 638267d.

NeedUpstream nameState
geodetic to Earth-centred coordinates and backgeophysix.earth.geodetic_to_ecef, ecef_to_geodetic, WGS84today (geophysix)
the speed of lightgeophysix.constants.STANDARD.speed_of_lighttoday (geophysix)
line of sight in the local east–north–up frameradiomax.geometry.view_anglestoday (radiomax)
a ray meeting the ellipsoidradiomax.geometry.earth_intersectiontoday (radiomax)
DN to backscatter; β⁰, σ⁰, γ⁰ conversions with an incidenceradiomax.sar.dn_to_backscatter, beta0_to_sigma0, sigma0_to_gamma0 and their inversestoday (radiomax)
the array backend, elementwise kernelspipekit_array.arrays.floating_inputs, pipekit_array.kernels.elementwisetoday (pipekit-array)
a warp as a functax plan; the plan’s adjointgeoops Reproject(engine="interp") with the private warp(gt, target, scheme, boundary, coordinates); functax.interp.Plan.adjointtoday (geoops, functax); the coordinate entry is private
reading a grid at points, differentiable in the pointsgeoops.geom.interp_attoday (geoops)
DEM gradientsgeoops.geom.gradient_2d, geoops.mask slope_degreestoday (geoops)
a vertical datum label on heightsgeoarray’s height coordinate, field datumtoday (geoarray), a label only
a carrier for data in sensor geometrygeoarray.GeoSwath (data with per-pixel lat and lon on row col)today (geoarray)
speckle filtersgeoops.restore despeckle_lee, despeckle_refined_lee, despeckle_frosttoday (geoops)
a cubic Hermite read-out, as a test oraclefunctax.interp.HermiteFit, HermiteGeometrytoday (functax), JAX only, slopes computed from the values
testing helperspipekit_array.testing.assert_matches_oracle, assert_grad_matches_fd, assert_adjoint, assert_backends_agreetoday (pipekit-array)

Gaps, each sent to the package that owns the concept.

GapOwnerWhy there
G1 to G5: orbit read-out, zero-Doppler, ranges, radar coordinates, local incidence, facet areas, layover and shadow rulesradiomaxsensor geometry and radiometry pixel by pixel, with no state to retrieve: radiomax’s placement test
G6: geocoding from a coordinate field, with the plan’s adjoint publicgeoopsthe warp already lives there, on functax plans
G7: geoid undulation and the datum conversiongeotoolz (geoops operator, geoarray datum)it reads a geoid grid file and changes a carrier’s coordinate; geoarray already names the datum
G8: the SAFE annotation readergeoproductsreaders and file formats are geoproducts’; algorithms take arrays
G9: cumulative_maxpipekit-arraya helper over NumPy’s maximum.accumulate and JAX’s lax.cummax, the kind of helper the owner reserves pipekit-array for
functax HermiteFit from given slopesfunctax, optionalHermiteFit computes slopes from values; an orbit has its slopes (the velocities). Only needed if functax is to be the oracle for G1

What stays local. Nothing: geostack holds the prototype and, after S7, one notebook.

New dependency edges. None. radiomax keeps NumPy, geophysix and pipekit-array; geoops already imports radiomax and functax; geoproducts already imports geoarray. functax stays a test reference for radiomax, as the owner decided for integrix and functax on 23 Nov 2026.

8 Architecture

The chain, from files to a terrain-corrected map, with the package of each step:

Two geometries, one plan. The radar image lives on a (line, column) grid; the DEM and the output on a map grid. radiomax maps each DEM cell to fractional (line, column); geoops turns those coordinates into a functax plan H on the radar grid. H geocodes (forward), and Hᵀ carries DEM-cell quantities into radar geometry (adjoint). Everything radiometric that needs the terrain is computed per DEM cell, elementwise, and moved with Hᵀ.

The radar grid as a carrier. A GRD image in radar geometry is a GeoSwath: rows along track, columns across, with lat and lon per pixel. The reader fills lat and lon from the geolocation grid, which places the pixels on the ellipsoid, not on the terrain; the geometry records travel beside the carrier, not inside it (SG-O1).

Backends. radiomax’s functions take any array-API array and return the same kind; the Newton solve has a fixed iteration count and no data-dependent branch. The plan runs on NumPy or JAX as geoops’ Reproject(engine="interp") does today. The profile rules of G5 need cumulative_max (G9).

9 API proposal

Every name is proposed unless marked today. Shapes: N_v = 17 state vectors; N_Ω DEM cells (a map grid, flattened when it reads better); N_ℓ × N_j radar pixels (lines × columns); K + 1 polynomial coefficients; N_c coefficient sets in azimuth time.

Records from the reader (geoproducts, G8). A frozen record per annotation, arrays in its fields:

from dataclasses import dataclass

from jaxtyping import Array, Float


# proposed (G8)
@dataclass(frozen=True)
class S1Annotation:
    # tₖ, s since the first line's UTC day start; Sₖ, Vₖ in ECEF m, m s⁻¹
    orbit_time: Float[Array, " vector"]
    orbit_position: Float[Array, "vector 3"]
    orbit_velocity: Float[Array, "vector 3"]
    # t₀, Δt (s); τ₀ (s, two-way); Δg (m)
    first_line_time: float
    azimuth_interval: float
    slant_range_time: float
    ground_spacing: float
    # srgr sets: azimuth time, r₀ and cᵢ of g(r) = Σ cᵢ (r − r₀)ⁱ
    srgr_time: Float[Array, " set"]
    srgr_origin: Float[Array, " set"]
    srgr_coefficients: Float[Array, "set coefficient"]
    # geolocation grid: line, column, lat, lon, h, incidence at tie points
    tie_points: dict[str, Float[Array, " point"]]

The calibration and noise tables follow the same pattern and feed radiomax.sar.dn_to_backscatter (today).

Geometry (radiomax.sar, G1 to G5). Each is a free function in radiomax’s style, any array library in, the same out, ECEF components as separate arguments where radiomax does so today (view_angles):

# Shapes: N_v state vectors; N_Ω DEM cells; N_c coefficient sets; K + 1 coefficients

# proposed (G1)
# S(t), V(t), A(t) by cubic Hermite (method="hermite") or 8-point Lagrange
# (N_Ω,), (N_v,), (N_v, 3), (N_v, 3) → (N_Ω, 3), (N_Ω, 3), (N_Ω, 3)
position, velocity, acceleration = rmx.sar.orbit_state(
    time, orbit_time, orbit_position, orbit_velocity, method="hermite"
)

# proposed (G2)
# t: D(t) = (S(t) − P) · V(t) = 0, Newton t ← t − D / D′, a fixed 6 steps
# (N_Ω, 3), (N_v,), (N_v, 3), (N_v, 3) → (N_Ω,)
azimuth_time = rmx.sar.zero_doppler_time(
    target, orbit_time, orbit_position, orbit_velocity,
    initial=None, iterations=6,
)

# proposed (G2)
# r = ‖S(t) − P‖
# (N_Ω, 3), (N_Ω, 3) → (N_Ω,)
slant = rmx.sar.slant_range(target, position)

# proposed (G2)
# g(r) = Σᵢ cᵢ (r − r₀)ⁱ with the set nearest in azimuth time
# (N_Ω,), (N_Ω,), (N_c,), (N_c,), (N_c, K + 1) → (N_Ω,)
ground = rmx.sar.ground_range(
    slant, azimuth_time, srgr_time, srgr_origin, srgr_coefficients
)

# proposed (G3)
# ℓ = (t − t₀) / Δt; j = g / Δg (GRD) or (2r / c − τ₀) / Δτ (SLC)
# (N_Ω, 3), S1Annotation → (N_Ω,), (N_Ω,)
line, column = rmx.sar.radar_coordinates(target, annotation_arrays)

# proposed (G4)
# cos θ_loc = n̂_T · ℓ̂; cos ψ = n̂_T · (ℓ̂ × v̂) / ‖ℓ̂ × v̂‖
# (N_Ω, 3) ×3 → (N_Ω,), (N_Ω,)
local_incidence, projection = rmx.sar.local_angles(
    target, position, velocity, terrain_normal
)

# proposed (G4)
# a_k cos θ_loc,k, zero where cos θ_loc ≤ 0
# (N_Ω,), (N_Ω,) → (N_Ω,)
projected_area = rmx.sar.gamma_area(facet_area, local_incidence)

# proposed (G5)
# active layover: slope towards the sensor ≥ look angle (elementwise)
# (N_Ω,), (N_Ω,) → (N_Ω,) bool
active_layover = rmx.sar.active_layover(local_incidence, look_angle)

# proposed (G5, needs G9)
# shadow: α < cummax α along each range line; passive layover from r's intervals
# (N_ℓ, N_x), (N_ℓ, N_x) → (N_ℓ, N_x) bool, (N_ℓ, N_x) bool
shadow, passive_layover = rmx.sar.profile_masks(look_angle_profile, range_profile)

annotation_arrays is the reader’s record (or any object with its fields); radiomax does not import geoproducts.

Geocoding plan (geoops, G6). The private warp becomes public with given coordinates and returns the plan:

# Shapes: N_Ω DEM cells; N_ℓ × N_j radar pixels

# proposed (G6)
# H: (N_ℓ N_j) → N_Ω, a functax plan on the radar grid read at (ℓ, j)
# (N_Ω,), (N_Ω,) → plan
plan = geoops.geom.coordinate_plan(
    radar_shape, line, column, scheme="linear", boundary="edge"
)

# today (functax)
# Hᵀ a: DEM-cell quantities into radar geometry
# (N_Ω,) → (N_ℓ N_j,)
area_gamma = plan.adjoint(projected_area)

The recipe (geoops, G10). TerrainCorrect(dem, annotation, scheme="linear", flatten=True, masks=True), an Operator from a GeoSwath of DN in radar geometry to a GeoArray on the DEM grid with bands γ⁰_T (or σ⁰ without flattening), the local incidence angle and a layover and shadow bitmask.

10 Usage examples

From a GRD scene and a DEM tile to γ⁰ on the DEM grid. Every name is marked; today names were checked on the repositories’ main. In the block, dem is a one-band GeoArray of orthometric heights H; λ, φ and h are each DEM cell’s longitude, latitude and ellipsoidal height, flattened to N_Ω; P stacks the cells’ ECEF coordinates; aₖ and θ_loc are the facet areas and local incidence angles of §4.6 and §4.7, from the S5 functions of §9; A_β is the radar pixel area of §4.7; and the other symbols are those of §4.

import geoops
import geophysix as gpx
import geoproducts
import radiomax as rmx
from einx import id as rearrange

# Shapes: N_Ω DEM cells; N_ℓ × N_j radar pixels

# proposed (G8)
annotation, dn_swath, calibration = geoproducts.sentinel1.read_grd(safe_path, pol="VV")

# proposed (G7)
# h = H + N_g(λ, φ)
dem_ellipsoidal = geoops.geom.ToEllipsoidal(geoid="egm2008")(dem)

# today (geophysix)
# P = ((N + h) cos φ cos λ, (N + h) cos φ sin λ, (N(1 − e²) + h) sin φ)
# (N_Ω,) ×3 → (N_Ω,) ×3
target_x, target_y, target_z = gpx.earth.geodetic_to_ecef(lon, lat, height)

# P, one row per cell
# (N_Ω,) ×3 → (N_Ω, 3)
target = rearrange("cell, cell, cell -> cell (1 + 1 + 1)", target_x, target_y, target_z)

# proposed (G3)
# (ℓ, j) of every DEM cell
# (N_Ω, 3) → (N_Ω,), (N_Ω,)
line, column = rmx.sar.radar_coordinates(target, annotation)

# today (radiomax)
# β⁰ = (DN / A_β)²
# (N_ℓ, N_j) → (N_ℓ, N_j)
beta0 = rmx.sar.dn_to_backscatter(dn_swath.data, calibration.beta)

# proposed (G6)
# H: radar grid → DEM cells
plan = geoops.geom.coordinate_plan(beta0.shape, line, column, scheme="linear")

# proposed (G4)
# a_k cos θ_loc,k
# → (N_Ω,)
projected_area = rmx.sar.gamma_area(facet_area, local_incidence)

# today (functax)
# A_γ = Hᵀ (a ⊙ cos θ_loc)
# (N_Ω,) → (N_ℓ N_j,)
area_gamma = plan.adjoint(projected_area)

# user
# γ⁰_T = H (β⁰ A_β / A_γ)
# (N_ℓ N_j,) → (N_Ω,)
gamma0_terrain = plan(beta0.ravel() * pixel_area_beta / area_gamma)

11 Decisions

Proposed; each awaits the owner.

SG-D1, the geometry is radiomax’s. The orbit read-out, zero-Doppler solve, ranges, radar coordinates, local angles, facet areas and layover and shadow rules go into radiomax.sar, beside the calibration. They pass radiomax’s placement test (geometry and unit conversion, no radiative transfer, no state), and radtrax, geoops and vardax can all reach radiomax.

SG-D2, Hermite by default, Lagrange as an option. Both are far below the orbit’s accuracy (§5); Hermite uses two state vectors and the velocities the annotation gives; Lagrange matches SNAP for oracle tests. The read-out is written in radiomax with its own four-tap stencil, because functax’s HermiteFit needs JAX and radiomax must run without it; functax checks it in the tests.

SG-D3, Newton with a fixed count. Six Newton steps with the exact D′, starting from the geolocation grid’s azimuth time interpolated to the target when given, otherwise from the middle of the orbit table, and clipped to the table. Under JAX, a custom_jvp uses §4.5 so the gradient does not unroll the loop.

SG-D4, geocoding is a functax plan made by geoops. geoops exposes coordinate_plan, the existing warp’s construction with the source coordinates given, and returns the plan, so both H and Hᵀ are public. No new interpolation code.

SG-D5, the datum is converted before geometry. radiomax takes ellipsoidal heights only and says so; geoops gains ToEllipsoidal, which reads the geoid grid through pyproj and honours geoarray’s datum label, refusing a DEM without one.

SG-D6, flattening by area projection through the adjoint. γ⁰_T = H(β⁰ A_β ⊘ Hᵀ(a ⊙ cos θ_loc)), with Ulander’s cos ψ (§4.6) as the cheap option for scenes without layover. Facet areas and normals come from the ellipsoidal DEM in ECEF, per cell.

SG-D7, the masks. Active layover by the elementwise slope rule; passive layover and shadow by the profile rules on range lines, with cumulative_max from pipekit-array. The output is one bitmask band in ISCE3’s convention (1 shadow, 2 layover, 3 both), so it compares directly with OPERA’s mask layer.

SG-D8, the reader returns arrays. geoproducts parses the SAFE annotation, calibration and noise XML into records of arrays and a GeoSwath of DN; no algorithm parses XML.

SG-D9, no SAR state in the carrier. The geometry records travel beside the GeoSwath, not in its attrs, so the carrier stays generic (see SG-O1).

12 Open questions

IDQuestionRecommendation
SG-O1Should a radar-geometry carrier (GeoRadar, a GeoSwath with the timing and orbit) exist in geoarray?Not yet: records beside a GeoSwath until a second SAR sensor needs the same shape.
SG-O2The range polynomial: nearest set in azimuth time, or interpolate the coefficients?Nearest, as the blog post and SNAP’s GRD path do, then measure the difference against the geolocation grid in S2.
SG-O3Thermal-noise removal (subtracting the noise table’s η in intensity before calibration): radiomax or the reader?radiomax, as an optional noise= argument to dn_to_backscatter; it is arithmetic on tables, and dn_to_backscatter’s docstring now leaves it to the reader.
SG-O4Precise orbit files (POEORB, RESORB): a geoproducts reader now, or annotation orbits only?Annotation orbits first, measuring them against the geolocation grid in S2; a POEORB reader in geoproducts if that test shows an error near a pixel.
SG-O5When do the sub-pixel corrections (troposphere, residual timing, tides) enter?The static troposphere first if S7 shows a range bias against SNAP or OPERA, since it is the largest at 3 to 4 m; the rest with SLC and interferometry (§3).
SG-O6Should radiomax.retrievals gain the CMOD5.N geophysical model function, σ⁰ to ocean wind speed Hersbach, 2010?Yes if sesmax or an ocean user asks; it is an empirical formula with fitted coefficients applied per pixel, radiomax’s other placement case.

13 Steps

Each step is one issue in the repository whose code changes, linked as a sub-issue of one epic in jejjohnson/geostack. S1, S2 and S8 can start in parallel.

StepRepoWorkOracleGate
S1geoproductssentinel1 reader: S1Annotation, calibration and noise tables, DN as a GeoSwatha small synthetic SAFE fixture; field-by-field against the XMLSG-D8
S2radiomaxG1 to G3: orbit_state, zero_doppler_time, slant_range, ground_range, radar_coordinates§5’s numbers; the geolocation grid’s (line, column) from its (lat, lon, h) to a tenth of a pixel; the delay c τ / 2 against the range; assert_backends_agree, assert_grad_matches_fdSG-D1, SG-D2, SG-D3, SG-O2
S3geoopsG6: coordinate_plan, public; Reproject(engine="interp") built on itthe existing warp tests unchanged; assert_adjoint on the planSG-D4
S4geoops, geoarrayG7: ToEllipsoidal with pyproj’s geoid gridsknown undulations at a few points from the geoid model’s own tablesSG-D5
S5radiomaxG4: local_angles, facet_area, gamma_area; flat-ground identity γ⁰_T = β⁰ tan θflat terrain to rounding; Ulander’s and Small’s normalisations agree outside layover on a synthetic hill; an OPERA RTC-S1 tile over relief, as a notebook in geostackSG-D6, S2, S3
S6radiomaxG5: active_layover, profile_masks§5’s hill fractions; the slope rule against the profile ruleSG-D7, S8
S7geoops, geostackG10: TerrainCorrect; a notebook on one subsampled sceneSNAP’s terrain-corrected output on the same scene, by eye and by a histogram of differencesS1 to S6
S8pipekit-arrayG9: cumulative_maxNumPy maximum.accumulate; JAX lax.cummaxnone

Later, not filed now: POEORB reader (SG-O4), thermal-noise removal (SG-O3), CMOD5.N (SG-O6), SLC and bursts.

14 What it does not do

Not hereWhere instead
scene, DEM and orbit search and downloadgeocatalog and geocloud
speckle filtering, multilookinggeoops (restore, Resize)
interferometry, polarimetric decompositions, SLC burst assemblya later design
water, flood or change detection thresholdsgeoops masks, or a user’s recipe
radiative transfer of microwaves through a mediumradtrax, if ever

15 References

The stack repositories were read on 5 Dec 2026 at the commits in §7. The papers and documents are cited from references.bib and listed by MyST at the end of the page; each DOI was resolved on 5 Dec 2026. Small (2011) and Ulander (1996) were not read in full: their formulas here are as the OPERA RTC-S1 algorithm document restates them.

Processors, read on their default branches on 5 Dec 2026:

References
  1. raphi-web. (2026). I am scared of SAR: terrain correcting Sentinel-1 GRD. Blog post. https://raphi-web.github.io/sar_terrain_correction/
  2. Small, D. (2011). Flattening Gamma: Radiometric Terrain Correction for SAR Imagery. IEEE Transactions on Geoscience and Remote Sensing, 49(8), 3081–3093. 10.1109/TGRS.2011.2120616
  3. Small, D., & Schubert, A. (2022). Guide to Sentinel-1 Geocoding (Techreport UZH-S1-GC-AD, issue 1.12). University of Zurich, Remote Sensing Laboratories. https://sentinels.copernicus.eu/documents/247904/1653442/Guide-to-Sentinel-1-Geocoding.pdf
  4. Gisinger, C., Schubert, A., Breit, H., Garthwaite, M., Balss, U., Willberg, M., Small, D., Eineder, M., & Miranda, N. (2021). In-Depth Verification of Sentinel-1 and TerraSAR-X Geolocation Accuracy Using the Australian Corner Reflector Array. IEEE Transactions on Geoscience and Remote Sensing, 59(2), 1154–1181. 10.1109/TGRS.2019.2961248
  5. Airbus Defence and Space. (2022). Copernicus DEM Product Handbook (Techreport GEO.2018-1988-2, version 5.0). Airbus Defence. https://dataspace.copernicus.eu/sites/default/files/media/files/2024-06/geo1988-copernicusdem-spe-002_producthandbook_i5.0.pdf
  6. Pavlis, N. K., Holmes, S. A., Kenyon, S. C., & Factor, J. K. (2012). The development and evaluation of the Earth Gravitational Model 2008 (EGM2008). Journal of Geophysical Research: Solid Earth, 117(B4). 10.1029/2011JB008916
  7. Ulander, L. M. H. (1996). Radiometric slope correction of synthetic-aperture radar images. IEEE Transactions on Geoscience and Remote Sensing, 34(5), 1115–1122. 10.1109/36.536527
  8. Shiroma, G. H. X., & Fattahi, H. (2024). OPERA Radiometric Terrain-Corrected SAR Backscatter from Sentinel-1 (RTC-S1): Algorithm Theoretical Basis Document (Techreport JPL D-107393, version 1.0). Jet Propulsion Laboratory, California Institute of Technology. https://cumulus.asf.earthdatacloud.nasa.gov/PUBLIC/DATA/OPERA/D-107393_OPERA_RTC-S1_ATBD_Initial_2024-06-25_wsigs.pdf
  9. Shiroma, G. H. X., Lavalle, M., & Buckley, S. M. (2022). An Area-Based Projection Algorithm for SAR Radiometric Terrain Correction and Geocoding. IEEE Transactions on Geoscience and Remote Sensing, 60, 1–23. 10.1109/TGRS.2022.3147472
  10. Hersbach, H. (2010). Comparison of C-Band Scatterometer CMOD5.N Equivalent Neutral Winds with ECMWF. Journal of Atmospheric and Oceanic Technology, 27(4), 721–736. 10.1175/2009JTECHO698.1