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.

tolerancefloat, optional

minimum amount of valid values in search window measured as a fraction of total amount of values [0-1] (default: 0.3)

wdwint, 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

kwargsdict

keyword arguments to pass to helpers.stack_window. These can be: 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_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). If inplace=True, the dataset will be returned masked with mask.

Return type:

xr.DataArray