xradar.util.is_sweep#

xradar.util.is_sweep(obj, strict=False)[source]#

Check whether a Dataset holds a radar sweep.

The check is based on the structure, not on names:

  • a range dimension and one ray dimension (time, azimuth or elevation),

  • azimuth and elevation variables along the ray dimension,

  • at least one data variable with dimensions (ray, range).

With strict=True the mandatory sweep metadata variables are required, too (sweep_number, sweep_mode, follow_mode, prt_mode, sweep_fixed_angle, see FM301 Table 301-7a). Not all backends fill these yet (e.g. HPL and Metek), so their sweeps are only recognized with strict=False.

Parameters:
  • obj (xarray.Dataset or xarray.DataTree) – Dataset or DataTree node to check.

  • strict (bool, optional) – Also require the mandatory sweep metadata variables. Defaults to False.

Returns:

sweep (bool) – True if obj holds a radar sweep.