Masks ... nodata ... nulls
The attached pdf will serve for now. I will add additional documentation here on how to work with rasters with nodata areas here soon.
A simple example here, using Matplotlib to do the mapping. The -- cells are nodata values
Raster/array values | Sample properties |
---|
>>> print(c.filled()) # -9 is nodata
[[ 3 1 3 -9 3 2 -9 -9 -9 2 2 2 3 -9 1 -9 3 3 -9 1]
[ 1 3 2 3 -9 -9 -9 3 1 3 3 -9 3 2 3 3 3 3 1 1]
[ 2 2 2 -9 1 2 2 -9 2 2 3 -9 3 -9 3 -9 2 2 1 3]
[ 3 1 3 2 -9 -9 2 -9 2 -9 -9 1 2 1 1 2 1 3 3 -9]
[-9 2 -9 2 -9 -9 1 2 1 -9 -9 2 2 1 1 1 3 1 3 3]
[-9 2 3 3 1 2 2 3 -9 1 1 3 1 -9 -9 -9 2 1 3 -9]
[-9 -9 -9 2 1 1 -9 2 2 1 1 2 2 3 2 3 2 2 2 -9]
[ 3 -9 3 -9 -9 2 3 -9 3 2 2 2 1 -9 3 2 -9 2 2 1]
[ 1 -9 2 2 1 -9 2 1 2 2 -9 -9 3 -9 2 2 -9 1 -9 1]
[ 1 1 -9 -9 -9 2 -9 2 3 2 -9 1 2 1 3 1 -9 -9 1 3]
[ 1 -9 -9 1 2 1 -9 1 -9 -9 -9 -9 1 -9 -9 -9 -9 2 -9 3]
[-9 3 -9 -9 -9 2 3 -9 -9 1 2 1 1 2 1 1 3 2 3 2]
[ 3 3 3 -9 3 1 3 -9 -9 -9 3 2 -9 -9 3 2 3 -9 1 -9]
[-9 2 2 3 3 1 3 1 -9 -9 2 3 3 1 1 1 1 1 -9 1]
[-9 1 -9 3 1 1 -9 2 -9 1 1 2 2 1 -9 2 2 3 -9 3]
[ 3 2 -9 2 2 -9 -9 2 1 2 1 2 -9 3 2 1 1 1 3 1]
[-9 -9 3 2 2 -9 2 2 1 2 -9 3 1 2 2 -9 3 3 2 1]
[ 1 -9 1 -9 2 2 3 -9 3 2 2 -9 1 2 3 -9 -9 -9 3 3]
[ 3 1 1 1 2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