Skip to content

Instantly share code, notes, and snippets.

@thomasaarholt
Created April 26, 2016 13:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thomasaarholt/e4f921ea4ebb586a4777c02c07ad6655 to your computer and use it in GitHub Desktop.
Save thomasaarholt/e4f921ea4ebb586a4777c02c07ad6655 to your computer and use it in GitHub Desktop.
import hyperspy.api as hs
s = hs.load("MO")
# Get peak energy
Zr_Peak = 330.
O_peak = 532.
# Create signals with enough background and signal length to fit the components.
s_Zr = s.isig[Zr_Peak - 40.:Zr_Peak + 60.]
s_O = s.isig[O_peak - 40.:O_peak + 60.]
# Remove background
s_O2 = s_O.remove_background(signal_range=(395, 525.), background_type="PowerLaw", estimate_background=False)
s_Zr = s_Zr.remove_background(signal_range=(290.,320.), background_type="PowerLaw", estimate_background=False)
s_O2.plot()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment