radarx.retrieve.cappi.create_cappi#

radarx.retrieve.cappi.create_cappi(obj, height, method='cartesian_idw', vertical_tolerance=None, apply_filter=False, *, data_vars=None, sweeps=None, x=None, y=None, x_res=1000.0, y_res=1000.0, padding=0.0, texture_threshold=None, linear_units=False)[source]#

Create a Constant Altitude Plan Position Indicator (CAPPI).

Parameters:
  • obj (xarray.DataTree) – Georeferenced radar volume containing one or more sweep groups.

  • height (float) – Target CAPPI altitude in meters.

  • method ({) – “cartesian_idw”, “polar_vertical_interpolation”, “height_window_composite”,

  • }, optional – CAPPI retrieval method. "cartesian_idw" performs 3D anisotropic inverse-distance weighting on a regular x/y grid. "polar_vertical_interpolation" retains the native azimuth/range geometry and interpolates vertically across sweeps. "height_window_composite" forms a CAPPI-like composite by selecting the nearest gates within a prescribed vertical window after sweep alignment. Legacy aliases "cartesian", "polar", and "pseudo_cappi" are also accepted.

  • vertical_tolerance (float or None, optional) – Maximum vertical distance above and below the requested CAPPI height, in meters, used by the selected retrieval method. If omitted, a method-specific default is used (3000 m, 500 m and 500 m for the three methods in the order above). For "polar_vertical_interpolation" a pixel without a gate this close to height is masked, also in the linear interpolation, and numpy.inf interpolates across any gap as before.

  • apply_filter (bool, optional) – Apply built-in gate filtering when supported by the selected method. Currently this is used by method="height_window_composite".

  • data_vars (list[str] or None, optional) – Radar variables to retrieve. If omitted, likely 2D radar fields are selected automatically.

  • sweeps (list[str] or None, optional) – Sweep names to include in the retrieval. If omitted, all available sweep groups are used.

  • x, y (array-like or None, optional) – Target Cartesian grid coordinates in meters. Used only with method="cartesian_idw".

  • x_res, y_res (float, optional) – Cartesian output spacing in meters when x and y are not supplied. Used only with method="cartesian_idw".

  • padding (float, optional) – Extra padding, in meters, applied to the Cartesian output domain. Used only with method="cartesian_idw".

  • texture_threshold (float or None, optional) – Velocity-texture limit (m/s) of the gate filter, used with apply_filter=True: gates where the standard deviation of the radial velocity in a 50-gate window along range is at or above it are removed. Default 8 m/s (a radarx choice, not a published value).

  • linear_units (bool, optional) – "cartesian_idw" and "polar_vertical_interpolation": average reflectivity (dBZ) and differential reflectivity (dB) in linear units and convert back, instead of averaging the dB values, which biases the result low. Default False (the dB values are averaged). Radial velocity and differential phase are interpolated as they are, with a warning: velocity from different look directions and a cumulative phase are not meaningful when averaged, so leave them out with data_vars. Gates without echo (NaN) never enter the weights.

Returns:

xarray.Dataset – CAPPI dataset in either Cartesian (y, x) or native polar (azimuth, range) geometry, depending on the selected method. The Cartesian CAPPI is georeferenced like the grids of radarx.grid.grid_cones(): crs_wkt (the azimuthal equidistant CRS centred on the radar position, which is how xradar defines x and y; none if the volume has no latitude and longitude), grid_mapping on the fields, 2-D lat(y, x) and lon(y, x) and standard_name, units and axis on the coordinates.

Notes

The three methods are radarx’s own constructions and not implementations of a published CAPPI algorithm; only the inverse-distance weighting of "cartesian_idw" follows a published concept (Shepard 1968 [1]). All default values (the IDW neighbour count 16, search radius 5000 m, power 2, vertical scale 3, at least 3 neighbours, vertical tolerances of 3000 m and 500 m, and the gate filter with a 50-gate velocity texture window and reflectivity limits of -10 and 75 dBZ) are radarx choices.

Dask. This function computes the dask array: it interpolates between the sweeps of the volume. The input is loaded into memory and the result is held in memory.

References