semantique.ArrayProxy.smooth

semantique.ArrayProxy.smooth#

ArrayProxy.smooth(reducer, dimension, size, **kwargs)[source]#

Smooth the values in an array through a moving window.

Smoothes the pixel values by applying a moving window function along a given dimension.

The moving window functions are reducer functions that reduce the values in the window to a single value. See here for an overview of the built-in reducer functions that can be chosen from (they should be referred to by their name, without the underscore at the end).

Parameters:
  • reducer (str) – Name of the reducer function to be used to reduce the values in the moving window.

  • dimension (str) – Name of the dimension to smooth along.

  • size (int) – Size k defining the extent of the rolling window. The pixel being smoothed will always be in the center of the window, with k pixels at its left and k pixels at its right. If the dimension to smooth over is the spatial dimension, the size will be used for both the X and Y dimension, forming a square window with the smoothed pixel in the middle.

  • **kwargs – Additional keyword arguments passed on to Array.smooth.

Returns:

ArrayProxy

Examples

>>> import semantique as sq
>>> sq.entity("water").smooth("any", "time", 1)