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

Scaling parts of the spectrum #15

Closed ghost closed 4 years ago

ghost commented 4 years ago

When using A.ShowSpectrum() is it possible to scale the spectrum to account for differences in intensity. As shown in the image.

Thanks

scholi commented 4 years ago

Hi. I think theire is no such function, but you can recover both mass, intensity vector with

mass, intensity = A.get_spectrum()

and do the scaling and plotting with matplotlib as you like

scholi commented 4 years ago

As an example

import matplotlib.pyplot as plt
m, I = A.get_spectrum()
m_thresh=80
plt.plot(m[m<=m_thresh], I[m<=m_thresh]))
plt.plot(m[m>m_thresh], I[m>m_thresh])*3)

of course you should also add the legend "×3"

ghost commented 4 years ago

thanks