semantique.ArrayProxy.shift

semantique.ArrayProxy.shift#

ArrayProxy.shift(dimension, steps, **kwargs)[source]#

Shift the values in an array along a dimension.

Shifts the pixel values a given number of steps along a given dimension.

Parameters:
  • dimension (str) – Name of the dimension to shift along.

  • steps (int) – Amount of steps each value should be shifted. A negative integer will result in a shift to the left, while a positive integer will result in a shift to the right. A shift along the spatial dimension follows the pixel order defined by the CRS, e.g. starting in the top-left and moving down each column.

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

Returns:

ArrayProxy

Examples

>>> import semantique as sq
>>> sq.entity("water").shift("time", 1)
>>> sq.entity("water").shift("space", -1, coord = "x")