I am having a new issue with Snappy when trying to read a raster band (S3 or other) into a numpy array.
Here is my code:
# Read raster or S3 file with snappy infile = '/path/to/raster' prod = ProductIO.readProduct(infile) # Get bandnames im_bands = list(prod.getBandNames()) # Get height and width h = prod.getSceneRasterHeight() w = prod.getSceneRasterWidth() arr = np.zeros((w,h),dtype=np.float32) # Empty array # Get the 1st band of the product for example currentband = prod.getBand( im_bands) # Read the pixels from the band to the empty array bandraster = currentband.readPixels(0, 0, w, h, arr)
However, when I plot my raster:
plt.imshow(bandraster), I get something very different from the band I am importing. The following subset of an S3 image for example:
comes up as this:
Has anybody run into this issue before? Or am I doing something wrong?