pyorc.Velocimetry.mask.window_nan#
- Velocimetry.mask.window_nan(tolerance=0.7, wdw=1, **kwargs)#
Masks values if their surrounding neighbours (inc. value itself) contain too many NaNs. Meant to remove isolated velocity estimates.
- Parameters:
tolerance (float, optional) – minimum amount of valid values in search window measured as a fraction of total amount of values [0-1] (default: 0.3)
wdw (int, optional) – window size to use for sampling neighbours. zero means, only cell itself, 1 means 3x3 window. (default: 1) wdw is used to fill wdw_x_min and wdwd_y_min with its negative (-wdw) value, and wdw_y_min and wdw_y_max with its positive value, to create a sampling window.
wdw_x_min (int, optional) – window size in negative x-direction of grid (must be negative), overrules wdw in negative x-direction if set
wdw_x_max (int, optional) – window size in positive x-direction of grid, overrules wdw in positive x-direction if set
wdw_y_min (int, optional) – window size in negative y-direction of grid (must be negative), overrules wdw in negative y-direction if set
wdw_y_max (int, 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