easysnowdata.processing.local_incidence_angle#

easysnowdata.processing.local_incidence_angle(dem: DataArray, incidence_angle: DataArray | float, look_azimuth_deg: float | DataArray, *, clip_to_valid: bool = True) DataArray[source]#

Local incidence angle from a DEM and the ellipsoidal incidence angle.

The credential-free counterpart of the OPERA RTC-S1-STATIC layer, and the replacement for the 350-line Earth Engine routine (issue #10). Pure xarray, so it works on any DEM and is unit-testable on a synthetic slope.

Parameters:
  • dem – Elevation in metres on a projected (metric) grid.

  • incidence_angle – Ellipsoidal incidence angle in degrees: a scalar for a scene, or a raster aligned with dem.

  • look_azimuth_deg – Radar look azimuth in degrees clockwise from north (see look_azimuth(); S1_HEADING has the Sentinel-1 headings).

  • clip_to_valid – Clip the result to [0, 90] degrees; False keeps the raw arccosine, which exceeds 90° where the slope faces away from the radar (layover and shadow candidates).

Returns:

xarray.DataArray – Local incidence angle in degrees, shaped like dem.

Notes

Following the standard radar-geometry formulation (Small 2011; the Earth Engine recipe at https://gis.stackexchange.com/a/352658):

cos(θ_lia) = cos(α_az) · cos(θ_i α_r)

where α_r and α_az are the terrain slope components in the range and azimuth directions.