semantique.processor.arrays.Array.assign#
- Array.assign(y, at=None, track_types=True, **kwargs)[source]#
Apply the assign verb to the array.
The assign verb assigns new values to the pixels in an array, without any computation. Unless specifically stated through the
atargument, it does not assign new values to missing pixels (i.e. those pixels having a missing value).- Parameters:
y – Value(s) to be assigned. May be a constant, meaning that the same value is assigned to every pixel. May also be another array which can be aligned to the same shape as the input array. In the latter case, the value assigned to a pixel in the input array is the value of the pixel in array
ythat has the same dimension coordinates.at (
xarray.DataArray, optional) – Binary array which can be aligned to the same shape as the input array. To be used for conditional assignment, in which a pixel in the input will only be assigned a new value if the if the pixel inatwith the same dimension coordinates is true.track_types (
bool) – Should the value type of the output object be promoted, and should it be checked thatathas value type binary?**kwargs – Ignored.
- Returns:
- Raises:
exceptions.InvalidValueTypeError – If
track_types = Trueand the value type ofatis not binary.