radarx.retrieve.azimuth_qc.azimuth_flags#
- radarx.retrieve.azimuth_qc.azimuth_flags(obj, *, tolerance=4.0, window=5, duplicate_fraction=0.1, gap_factor=2.5, n_threads=None, engine='auto')[source]#
Flag jumps in the ray angles of a sweep or volume.
- Parameters:
obj (
xarray.Datasetorxarray.DataTree) – A sweep (a Dataset with anazimuthdimension or coordinate, or anelevationone for an RHI), a single sweep node of a volume, or a volume whosesweep_*nodes are checked one by one.tolerance (
float, optional) – Deviation, in ray spacings, from the positions that the neighbours predict beyond which a ray is an outlier. Default 4.window (
int, optional) – Number of rays on each side that predict the position of a ray. Default 5; at least 2.duplicate_fraction (
float, optional) – A step to the next good ray of less than this share of a ray spacing marks a duplicate. Default 0.1.gap_factor (
float, optional) – A forward step of more than this many ray spacings marks a gap (rays are missing). Default 2.5.n_threads (
int, optional) – Threads of the compiled kernel (one sweep per thread). Default: all.engine (
{"auto", "compiled", "numpy"}, optional) – Implementation. Default"auto": the compiled kernel when built.
- Returns:
xarray.Datasetorxarray.DataTree– On the ray dimension:azimuth_flag(uint8 bitsoutlier1,duplicate2,gap4,reversal8,missing16; seeAZIMUTH_FLAGS),azimuth_fixed(the angle with the bad rays repaired, degrees in [0, 360) for the repaired rays) andazimuth_missing_rays(rays missing after a ray with thegapflag);azimuth_step(scalar) is the typical step in degrees. A DataTree gives one such node per sweep.
Notes
See the module description for the method and its limits. The check needs at least five rays with finite angles; a sweep with fewer is returned without flags other than
missing.Dask. This function computes the dask array: The ray angles are read into memory; the fields are not touched. The input is loaded into memory and the result is held in memory.
Examples
>>> flags = radarx.retrieve.azimuth_flags(sweep) >>> flags.azimuth_flag.where(flags.azimuth_flag > 0, drop=True)