pyorc.Velocimetry.mask.window_mean#
- Velocimetry.mask.window_mean(tolerance=0.7, wdw=1, mode='or', **kwargs)#
Mask values when their value deviates significantly from mean.
This is computed as relative fraction from the mean of its neighbours (inc. itself).
- tolerancefloat, optional
amount of velocity relative to the mean velocity (default: 0.7)
- wdwint, optional
window used to determine relevant neighbours
- modestr
can be “and” (default) or “or”. If “or” (“and”), then only one (both) of two vector components need(s) to be within tolerance.
- kwargsdict
keyword arguments to pass to
helpers.stack_window
. These can be: wdw_x_min : int, optionalwindow size in negative x-direction of grid (must be negative), overrules wdw in negative x-direction if set.
- wdw_x_maxint, optional
window size in positive x-direction of grid, overrules wdw in positive x-direction if set.
- wdw_y_minint, optional
window size in negative y-direction of grid (must be negative), overrules wdw in negative y-direction if set.
- wdw_y_maxint, optional
window size in positive y-direction of grid, overrules wdw in positive x-direction if set.
- Returns:
mask – mask applicable to input dataset with
ds.velocimetry.filter(mask)
. Ifinplace=True
, the dataset will be returned masked withmask
.- Return type:
xr.DataArray