Another issue I found that I think is related to this one is that when I try to extract some bands from the image, it gives the same NullPointerException in the function ReadPixels() as shown below:
red = product.getBand(‘B4’)
w1 = red.getSpectralWavelength()
width = product.getSceneRasterWidth()
height = product.getSceneRasterHeight()
targetProduct = Product(‘Test_Product’, ‘FLH_Type’, width, height)
targetBand1 = targetProduct.addBand(‘Red’, ProductData.TYPE_FLOAT32)
ProductUtils.copyGeoCoding(product, targetProduct)
targetProduct.setProductWriter(ProductIO.getProductWriter(‘GeoTIFF’)) targetProduct.writeHeader(String(os.path.join(path,‘Pre-Processed_’+image_name+‘.tif’)))
r1 = np.zeros(width, dtype=np.float32)
for y in range(height):
r = red.readPixels(0, y, width, 1, r1)
targetBand1.writePixels(0, y, width, 1, r)
targetProduct.closeIO()
pd: the only reason I think these problems are related is because they appeared at the same time, after being working until now.