I'm running in a jupyter notebook (hyperspy 1.4.1) for calculating atomic percent of Mo and S in my sample:
file=folder+'/site 2.rpl'
s=hs.load(file).as_signal1D(0)
s.axes_manager[-1].name = 'Energy'
s.axes_manager['Energy'].units = 'keV'
s.axes_manager['Energy'].scale = 0.01
s.axes_manager['Energy'].offset = -0.2
s.set_signal_type('EDS_TEM')
s.set_elements(['Mo','S',])
s.set_lines(['Mo_La','S_Ka',])
kf = [2.459, 1.042] # k-factors for Mo and S
bw = s.estimate_background_windows(line_width=[1.5, 2.0])
i = s.sum().get_lines_intensity(background_windows=bw)
atomic_percent = s.quantification(intensities=i, method='CL',factors=kf)
The error showing below appeared when I ran the last line. Not sure where this error happened and how to correct. Any insight would be appreciated!
Thanks,
SSQ
---------------------------------------------------------------------------
IndexError Traceback (most recent call last)
<ipython-input-41-49ec6032779a> in <module>()
2 bw = s.estimate_background_windows(line_width=[1.5, 2.0])
3 i = s.sum().get_lines_intensity(background_windows=bw)
----> 4 atomic_percent = s.quantification(intensities=i, method='CL',factors=kf)
C:\Anaconda3\lib\site-packages\hyperspy\_signals\eds_tem.py in quantification(self, intensities, method, factors, composition_units, navigation_mask, closing, plot_result, **kwargs)
363 composition.data = utils_eds.quantification_cliff_lorimer(
364 composition.data, kfactors=factors,
--> 365 mask=navigation_mask) * 100.
366 elif method == 'zeta':
367 results = utils_eds.quantification_zeta_factor(
C:\Anaconda3\lib\site-packages\hyperspy\misc\eds\utils.py in quantification_cliff_lorimer(intensities, kfactors, mask)
393 if mask is not None:
394 for i in range(dim[0]):
--> 395 intens[i][mask] = 0
396 return intens
397 else:
IndexError: too many indices for array
Any insight would be appreciated!
Thanks,
Zack