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

Bruker spm format: request for explanantion of overall scale computation #27

Closed mottelet closed 1 year ago

mottelet commented 1 year ago

Hello, I have great difficulties for understand how is computed the final factor by which is multiplied the raw data (e.g. 32 bits signed integer) to obtain the correct unit (meter in the below example) For example in my actual file I have

\*Ciao image list
\Data offset: 80960
\Data length: 1048576
\Bytes/pixel: 4
\Start context: OL
\Data type: AFM
\Data Type Description: 
\Note: 
\Plane fit: 0 0 0 5
\Frame direction: Down
\Capture start line: 0
\Color Table Index: 12
\Relative frame time: 5091.9
\Invalid Data Flag: None
\Invalid Data Fill: None
\Samps/line: 512
\Number of lines: 512
\Aspect Ratio: 1:1
\Scan Size: 10 10 ~m
\Scan Line: Main
\Line Direction: Retrace
\Highpass: 0
\Lowpass: 0
\Realtime Planefit: Line
\Offline Planefit: None
\Valid data start X: 0
\Valid data start Y: 0
\Valid data len X: 512
\Valid data len Y: 512
\Tip x width correction factor: 1
\Tip y width correction factor: 1
\Tip x width correction factor sigma: 1
\Tip y width correction factor sigma: 1
\@2:Image Data: S [ZSensor] "Height Sensor"
\@Z magnify: C [2:Z scale] 4.14356 
\@2:Z scale: V [Sens. ZsensSens] (0.0000000000370204 V/LSB) 0.159002 V
\@2:Z offset: V [Sens. ZsensSens] (0.0000000000370204 V/LSB) 0.000000 V

I don't manage to recover the actual factor from numbers in the lines

\@Z magnify: C [2:Z scale] 4.14356 
\@2:Z scale: V [Sens. ZsensSens] (0.0000000000370204 V/LSB) 0.159002 V
\@2:Z offset: V [Sens. ZsensSens] (0.0000000000370204 V/LSB) 0.000000 V

Thanks for help.

S.

scholi commented 1 year ago

Please have a look at the source code: https://github.com/scholi/pySPM/blob/master/pySPM/Bruker.py I already answered you by email, but as it might interest other users here is a quick summary:

Basically you can use the Z scale to pass from binary to Volt and you should find the scanner value (not visible in your example) to go from Volt to meter. Thwe scanner name is what is in square bracket. So here: Sens. ZsensSens