Best way to load a DIM Product in numpy?


What’s the best way to load snap’s .dim products in numpy?
At the moment I have…

band = product.getBand(band_name)
width = product.getSceneRasterWidth()
height = product.getSceneRasterHeight()
n_array = numpy.zeros((width, height), dtype=numpy.float32)
band.readPixels(0, 0, width-1, height-1, n_array)

However this is not showing the correct matrix when I plot the n_array I get an image like this:

Found the solution in this thread: Numpy array issue
The per line transfer algorithm worked and the fortran format one was skewed at an angle unfortunately.