radarx.retrieve.azimuth_qc.fix_azimuth#
- radarx.retrieve.azimuth_qc.fix_azimuth(obj, method='interpolate', *, tolerance=4.0, window=5, duplicate_fraction=0.1, gap_factor=2.5, regularize_tolerance=0.5, n_threads=None, engine='auto')[source]#
Repair the ray angles of a sweep or volume.
- Parameters:
obj (
xarray.Datasetorxarray.DataTree) – A sweep, a single sweep node, or a volume (seeazimuth_flags()).method (
{"interpolate", "drop", "fill", "regularize"}, optional) –"interpolate"(default) replaces the angle of the outliers, duplicates and missing angles with the interpolation between the nearest good rays and keeps every ray; the angle before the repair is kept inazimuth_raw."drop"removes those rays."fill"interpolates and then inserts a ray of missing values for every ray that is missing in a gap, with an interpolated angle and time, and keeps every real ray (azimuth_filledmarks the new rays)."regularize"interpolates and then puts the sweep on a regular angle grid with the typical step: every grid angle takes the nearest ray if it lies withinregularize_tolerancespacings and is otherwise filled with missing values. Rays that are closer than a spacing (the antenna decelerates at the end of a sector) are merged, so the number of real rays can fall. It needs the rays in scan order and raises an error for a sweep with areversal.tolerance, window, duplicate_fraction, gap_factor, n_threads, engine – As in
azimuth_flags().regularize_tolerance (
float, optional) – For"regularize": largest distance, in ray spacings, between a grid angle and the ray it takes. Default 0.5.
- Returns:
xarray.Datasetorxarray.DataTree– The input with the ray angles repaired (azimuth_flagsays which rays were bad). A DataTree keeps its other nodes.
Notes
Gaps and reversals are not repaired by
"interpolate"and"drop": the true angles of missing rays are not known. Seeazimuth_flags().Dask. This function computes the dask array: Rays can be removed or added, so the size of the result depends on the data. The input is loaded into memory and the result is held in memory.
Examples
>>> fixed = radarx.retrieve.fix_azimuth(volume) >>> regular = radarx.retrieve.fix_azimuth(sweep, "regularize")