I would like to set value of raster -999.0
as NaN
in crop_image
function, while reading/cropping file:
for band_path in range_bands:
# open raster as numpy array by rater.io in content manager(open/close file)
with rio.open(band_path) as band_src:
if "band4" in band_path:
print("band4")
## use crop.image() to read and crop
band4, band4_meta = es.crop_image(band_src, bound)
print(band4_meta)
# Update with NaN data values
band4_meta.update({'nodata': -999.0})
print(band4_meta)
How is possible to do?