For KPFM data, the "scale" factor is wrong
To Reproduce
Take any Bruker KPFM data and you'll see the factor is wrong by multiple orders of magnitude (and not just from the physical unit factor)
The issue comes from line 193 in Bruker.py :
scale = float(result[1]) / 256**bpp
This works for topography data but not for Potential data, the fix is to take the value in parentheses from metadata :
@2:Z scale: V [Sens. Potential] (0.0003051758 V/LSB) 20.00000 V
Here for example it would be 0.0003051758
The good thing is that this value also works for topography, as it results in the same value as float([result[1])/256**bpp in my tests :
scale from code : 5.7220458984375e-09
scale from .spm metadata : 5.72205e-09
For KPFM data, the "scale" factor is wrong
To Reproduce
Take any Bruker KPFM data and you'll see the factor is wrong by multiple orders of magnitude (and not just from the physical unit factor)
The issue comes from line 193 in Bruker.py :
scale = float(result[1]) / 256**bpp
This works for topography data but not for Potential data, the fix is to take the value in parentheses from metadata :
@2:Z scale: V [Sens. Potential] (0.0003051758 V/LSB) 20.00000 V
Here for example it would be 0.0003051758
The good thing is that this value also works for topography, as it results in the same value as float([result[1])/256**bpp in my tests :
scale from code : 5.7220458984375e-09
scale from .spm metadata : 5.72205e-09