Note
Go to the end to download the full example code.
EELS curve fitting#
Performs curve fitting to an EELS spectrum, plots the result and saves it as png file.
0%| | 0.00/42.3M [00:00<?, ?B/s]
0%| | 11.3k/42.3M [00:00<08:14, 85.4kB/s]
0%| | 109k/42.3M [00:00<01:54, 369kB/s]
1%|▍ | 489k/42.3M [00:00<00:31, 1.34MB/s]
3%|▉ | 1.06M/42.3M [00:00<00:17, 2.31MB/s]
6%|██ | 2.38M/42.3M [00:00<00:07, 5.25MB/s]
8%|██▉ | 3.33M/42.3M [00:00<00:06, 6.42MB/s]
15%|█████▍ | 6.14M/42.3M [00:00<00:02, 12.6MB/s]
21%|███████▌ | 8.69M/42.3M [00:01<00:02, 16.3MB/s]
27%|█████████▊ | 11.3M/42.3M [00:01<00:01, 19.1MB/s]
33%|████████████▏ | 13.9M/42.3M [00:01<00:01, 21.2MB/s]
39%|██████████████▎ | 16.4M/42.3M [00:01<00:01, 22.1MB/s]
45%|████████████████▋ | 19.0M/42.3M [00:01<00:00, 23.3MB/s]
51%|██████████████████▉ | 21.7M/42.3M [00:01<00:00, 24.3MB/s]
58%|█████████████████████▍ | 24.4M/42.3M [00:01<00:00, 25.2MB/s]
64%|███████████████████████▌ | 27.0M/42.3M [00:01<00:00, 21.5MB/s]
70%|██████████████████████████ | 29.7M/42.3M [00:01<00:00, 23.1MB/s]
77%|████████████████████████████▍ | 32.5M/42.3M [00:01<00:00, 24.3MB/s]
83%|██████████████████████████████▉ | 35.3M/42.3M [00:02<00:00, 25.3MB/s]
90%|█████████████████████████████████▍ | 38.1M/42.3M [00:02<00:00, 26.3MB/s]
97%|███████████████████████████████████▊ | 41.0M/42.3M [00:02<00:00, 26.8MB/s]
0%| | 0.00/42.3M [00:00<?, ?B/s]
100%|██████████████████████████████████████| 42.3M/42.3M [00:00<00:00, 272GB/s]
0%| | 0.00/66.1M [00:00<?, ?B/s]
0%| | 18.4k/66.1M [00:00<07:20, 150kB/s]
0%| | 89.1k/66.1M [00:00<03:18, 332kB/s]
0%|▏ | 249k/66.1M [00:00<01:30, 728kB/s]
1%|▍ | 803k/66.1M [00:00<00:28, 2.28MB/s]
2%|▉ | 1.61M/66.1M [00:00<00:15, 4.12MB/s]
5%|█▋ | 3.02M/66.1M [00:00<00:08, 7.20MB/s]
8%|███ | 5.47M/66.1M [00:00<00:04, 12.5MB/s]
13%|████▋ | 8.28M/66.1M [00:00<00:03, 14.9MB/s]
17%|██████▏ | 11.1M/66.1M [00:01<00:02, 18.5MB/s]
21%|███████▊ | 13.9M/66.1M [00:01<00:02, 21.2MB/s]
25%|█████████▎ | 16.7M/66.1M [00:01<00:02, 23.2MB/s]
30%|██████████▉ | 19.5M/66.1M [00:01<00:01, 23.7MB/s]
34%|████████████▍ | 22.3M/66.1M [00:01<00:01, 24.8MB/s]
38%|██████████████ | 25.1M/66.1M [00:01<00:01, 25.7MB/s]
42%|███████████████▌ | 27.8M/66.1M [00:01<00:01, 26.3MB/s]
46%|█████████████████▏ | 30.7M/66.1M [00:01<00:01, 26.9MB/s]
51%|██████████████████▊ | 33.5M/66.1M [00:01<00:01, 27.4MB/s]
55%|████████████████████▎ | 36.3M/66.1M [00:02<00:01, 23.8MB/s]
59%|█████████████████████▊ | 39.0M/66.1M [00:02<00:01, 24.9MB/s]
63%|███████████████████████▍ | 41.9M/66.1M [00:02<00:00, 26.0MB/s]
68%|█████████████████████████ | 44.8M/66.1M [00:02<00:00, 25.7MB/s]
72%|██████████████████████████▋ | 47.7M/66.1M [00:02<00:00, 26.6MB/s]
76%|████████████████████████████▎ | 50.5M/66.1M [00:02<00:00, 26.9MB/s]
80%|█████████████████████████████▊ | 53.2M/66.1M [00:02<00:00, 26.9MB/s]
85%|███████████████████████████████▌ | 56.3M/66.1M [00:02<00:00, 23.8MB/s]
90%|█████████████████████████████████▏ | 59.2M/66.1M [00:02<00:00, 25.2MB/s]
94%|██████████████████████████████████▊ | 62.2M/66.1M [00:03<00:00, 26.4MB/s]
99%|████████████████████████████████████▍| 65.2M/66.1M [00:03<00:00, 27.3MB/s]
0%| | 0.00/66.1M [00:00<?, ?B/s]
100%|██████████████████████████████████████| 66.1M/66.1M [00:00<00:00, 457GB/s]
import hyperspy.api as hs
s = hs.load("coreloss_spectrum.msa", signal_type="EELS")
ll = hs.load("lowloss_spectrum.msa", signal_type="EELS")
s.add_elements(("Mn", "O"))
s.set_microscope_parameters(
beam_energy=300, convergence_angle=24.6, collection_angle=13.6
)
m = s.create_model(low_loss=ll)
m.enable_fine_structure()
m.multifit(kind="smart")
m.plot()
# one can also use the Dirac GOS by specifying the GOS parameter
m = s.create_model(low_loss=ll, GOS="dirac")
m.enable_fine_structure()
m.multifit(kind="smart")
m.plot()
Total running time of the script: (0 minutes 16.771 seconds)