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

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

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

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

  • kwargs (dict) –

    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_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). If inplace=True, the dataset will be returned masked with mask.

Return type:

xr.DataArray