Hello,
I am trying to read data from a specific band and then to overwrite some values. My code works as follow:
1- Read the data into a numpy array
2- Perform some operations on the numpy array
3- Update the pixels from the numpy array
band = product.getBand(name)
width = band.getRasterWidth()
height = band.getRasterHeight()
band_numpy = np.zeros((height, width), dtype=np.float32)
band.readPixels(0, 0, width, height, band_numpy)
# Do something
band.setPixels(0, 0, width, height, band_numpy)
I can read the data into a numpy array without any issue but as soon as I try to use the function setPixels(), I get the following error:
RuntimeError: java.lang.NullPointerException
Did I miss something? Or is there an alternative to way to update the pixel values (without writing to disk)?
Thanks in advance for your help!
SNAP version 8.0 Unix