radarx.grid.ugrid.gate_corners#

radarx.grid.ugrid.gate_corners(obj)[source]#

Compute the geographic corner nodes of every gate of a sweep.

Parameters:

obj (xarray.Dataset or xarray.DataArray) – PPI sweep on azimuth and range dimensions with elevation and the radar site latitude/longitude (altitude optional) as coordinates or variables.

Returns:

  • node_lon, node_lat (numpy.ndarray) – Corner longitudes and latitudes, shape (n_ray_edges, n_range + 1), where n_ray_edges is n_ray for a full 360 degree sweep and n_ray + 1 otherwise.

  • order (numpy.ndarray) – Ray indices that sort the sweep by azimuth; faces follow this order.

  • full_circle (bool) – Whether the sweep closes on itself.

Notes

Nodes lie halfway between gate centres in range, azimuth and elevation (a radarx convention, see the module docstring); the first and last edge of a sector extend by half a spacing. A sweep counts as a full circle if no gap between sorted azimuths exceeds twice the median spacing (a radarx threshold). The ground distance of each corner uses the 4/3 Earth model of Doviak and Zrnić (1993), Eqs. 2.28b-d (book, no DOI), through xradar.