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 regularx/ygrid."polar_vertical_interpolation"retains the nativeazimuth/rangegeometry 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 (
floatorNone, 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 toheightis masked, also in the linear interpolation, andnumpy.infinterpolates across any gap as before.apply_filter (
bool, optional) – Apply built-in gate filtering when supported by the selected method. Currently this is used bymethod="height_window_composite".data_vars (
list[str]orNone, optional) – Radar variables to retrieve. If omitted, likely 2D radar fields are selected automatically.sweeps (
list[str]orNone, 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 withmethod="cartesian_idw".x_res, y_res (
float, optional) – Cartesian output spacing in meters whenxandyare not supplied. Used only withmethod="cartesian_idw".padding (
float, optional) – Extra padding, in meters, applied to the Cartesian output domain. Used only withmethod="cartesian_idw".texture_threshold (
floatorNone, optional) – Velocity-texture limit (m/s) of the gate filter, used withapply_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 withdata_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 ofradarx.grid.grid_cones():crs_wkt(the azimuthal equidistant CRS centred on the radar position, which is how xradar definesxandy; none if the volume has nolatitudeandlongitude),grid_mappingon the fields, 2-Dlat(y, x)andlon(y, x)andstandard_name,unitsandaxison 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