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

Need Engage X and Y Pos info #40

Closed nihtmusic closed 5 months ago

nihtmusic commented 5 months ago

I'm trying to pull out "Engage X Pos" and "Engage Y Pos" from a bruker file.

parameter lists

I don't see this in the existing list I get from layers:

existing list

Is there another way to get that info from the file? It seems you are mostly only pulling the Ciao image list...not the File List shown in the first image that is a screen shot of nanoscope.

Thanks,

Kurt

dineshpinto commented 5 months ago

You can try and manually parse the information, example snippet:

import pySPM

with open("<path to afm file>", "rb") as f:
    line = f.readline().rstrip().replace(b"\\", b"")
    while line != b"*File list end":
        line = f.readline().rstrip().replace(b"\\", b"")
        if b"Engage X Pos" in line or b"Engage Y Pos" in line:
            print(line)

from which you can extract the number and unit.

nihtmusic commented 5 months ago

Hey! That worked! Thank you!

Kurt