pyorc.Velocimetry.mask.window_mean#

Velocimetry.mask.window_mean(tolerance=0.7, wdw=1, mode='or', **kwargs)#

Masks values when their value deviates more than tolerance (measured as relative fraction) from the mean of its neighbours (inc. itself).

Parameters:
  • tolerance (float, optional) – amount of velocity relative to the mean velocity (default: 0.7)

  • wdw (int, optional) – window used to determine relevant neighbours

  • 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.

  • mode (str) – can be “and” (default) or “or”. If “or” (“and”), then only one (both) of two vector components need(s) to be within tolerance.

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