scholi / pySPM

Python library to handle Scanning Probe Microscopy Images. Can read nanoscan .xml data, Bruker AFM images, Nanonis SXM files as well as iontof images(ITA, ITM and ITS).
Apache License 2.0
58 stars 33 forks source link

.pixels is upside-down #4

Closed shcrela closed 5 years ago

shcrela commented 5 years ago

Hi Olivier,

Thanks again for the package. I just wanted to turn your attention to the artefact I encountered. After loading the .spm file and choosing the channel, when I plot the numpy array I get from .pixels, it is upside-down in respect to the original image that gets shown when using your .show() function. There seems to be an np.flipud missing or something...

Thanks, Dejan.

scholi commented 5 years ago

Hi Dejan, Yes that is on purpose and it's normal. If you want to flip the array, use numpy.flipud() and if you want to flip the image using show(), the use .show(flip=True)

The reason for that is the difference between human and computers. Pixels and computer have the 0,0 ain the top-left corner of an image, while human prefer to have the 0,0 at the bottom-left corner.

In theory .show() should display the image in the exact same way as the software of the instrument does. If it's not the case, please tell me which instrument you are using.

Kind regards

Olivier