semantique.ArrayProxy.filter

semantique.ArrayProxy.filter#

ArrayProxy.filter(filterer, **kwargs)[source]#

Filter the values in an array.

Filters the pixel values in the input based on a condition. The evaluated condition should be provided as a binary array that can be aligned to the same shape as the input. Only the values of pixels corresponding to a “true” value in the evaluated condition are preserved, the others are assigned a nodata value.

Parameters:
  • filterer (ArrayProxy) – Proxy of a binary array which can be aligned to the same shape as the input.

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

Returns:

ArrayProxy

Examples

>>> import semantique as sq
>>> sq.entity("water").filter(sq.entity("cloud").evaluate("not"))
>>> sq.entity("water").filter(sq.self())