Usage | Returns |
---|---|
Array.mask(mask) | Array |
Argument | Type | Details |
---|---|---|
this: input | Array | Array to mask. |
mask | Array | Mask array. |
Examples
Code Editor (JavaScript)
print(ee.Array([1]).mask([0])); // [] print(ee.Array([1]).mask([1])); // [1] print(ee.Array([0, 1, 2, 3]).mask([0, 4, -1, 1.2])); // [1,2,3] print(ee.Array([[1, 2, 3, 4]]).mask([[0, 0, 0, 0]])); // [[]] print(ee.Array([[1, 2, 3, 4]]).mask([[1, 0, 1, 1]])); // [[1,3,4]] var array = ee.Array([[1], [2], [3], [4]]); print(array.mask([[0], [0], [0], [0]])); // [] print(array.mask([[1], [0], [1], [1]])); // [[1],[3],[4]] var empty = ee.Array([], ee.PixelType.int8()); print(empty.mask(empty)); // []
import ee import geemap.core as geemap
Colab (Python)
display(ee.Array([1]).mask([0])) # [] display(ee.Array([1]).mask([1])) # [1] display(ee.Array([0, 1, 2, 3]).mask([0, 4, -1, 1.2])) # [1, 2, 3] display(ee.Array([[1, 2, 3, 4]]).mask([[0, 0, 0, 0]])) # [[]] display(ee.Array([[1, 2, 3, 4]]).mask([[1, 0, 1, 1]])) # [[1, 3, 4]] array = ee.Array([[1], [2], [3], [4]]) display(array.mask([[0], [0], [0], [0]])) # [] display(array.mask([[1], [0], [1], [1]])) # [[1], [3], [4]] empty = ee.Array([], ee.PixelType.int8()) display(empty.mask(empty)) # []