hyperspy.misc.eels package¶
Submodules¶
hyperspy.misc.eels.base_gos module¶
hyperspy.misc.eels.effective_angle module¶
-
hyperspy.misc.eels.effective_angle.
effective_angle
(E0, E, alpha, beta)¶ Calculates the effective collection angle
Parameters: - E0 (float) – electron beam energy in keV
- E (float) – energy loss in eV
- alpha (float) – convergence angle in mrad
- beta (float) – collection angle in mrad
Returns: float
Return type: effective collection angle in mrad
Notes
Code translated to Python from Egerton (second edition) page 420
hyperspy.misc.eels.hartree_slater_gos module¶
-
class
hyperspy.misc.eels.hartree_slater_gos.
HartreeSlaterGOS
(element_subshell)¶ Bases:
hyperspy.misc.eels.base_gos.GOSBase
Read Hartree-Slater Generalized Oscillator Strenght parametrized from files.
Parameters: element_subshell (str) – For example, ‘Ti_L3’ for the GOS of the titanium L3 subshell -
readgosfile
()¶ Read the GOS files of the element subshell from the location defined in Preferences.
-
get_qaxis_and_gos
(ienergy, qmin, qmax)¶ given the energy axis index and qmin and qmax values returns the qaxis and gos between qmin and qmax using linear interpolation to include qmin and qmax in the range.
-
energy_axis
¶ array – The tabulated energy axis
-
qaxis
¶ array – The tabulated qaxis
-
energy_onset
¶ float – The energy onset for the given element subshell as obtained from iternal tables.
-
integrateq
(onset_energy, angle, E0)¶
-
readgosfile
()
-
hyperspy.misc.eels.hydrogenic_gos module¶
-
class
hyperspy.misc.eels.hydrogenic_gos.
HydrogenicGOS
(element_subshell)¶ Bases:
hyperspy.misc.eels.base_gos.GOSBase
Computes the K and L GOS using R. Egerton’s routines.
Parameters: element_subshell (str) – For example, ‘Ti_L3’ for the GOS of the titanium L3 subshell -
parametrize_GOS
()¶ Parametrize the GOS to speed up the calculation.
-
get_qaxis_and_gos
(ienergy, qmin, qmax)¶ Given the energy axis index and qmin and qmax values returns the qaxis and gos between qmin and qmax using linear interpolation to include qmin and qmax in the range.
-
energy_axis
¶ array – The tabulated energy axis
-
qaxis
¶ array – The tabulated qaxis
-
energy_onset
¶ float – The energy onset for the given element subshell as obtained from iternal tables.
Notes
The Hydrogeninc GOS are calculated using R. Egerton’s SIGMAK3 and SIGMAL3 routines that has been translated from Matlab to Python by I. Iyengar. See http://www.tem-eels.ca/ for the original code.
-
gosfuncK
(E, qa02)¶
-
gosfuncL
(E, qa02)¶
-
integrateq
(onset_energy, angle, E0)¶
-
hyperspy.misc.eels.tools module¶
-
hyperspy.misc.eels.tools.
eels_constant
(s, zlp, t)¶ - Calculate the constant of proportionality (k) in the relationship
between the EELS signal and the dielectric function. dielectric function from a single scattering distribution (SSD) using the Kramers-Kronig relations.
$S(E)=
rac{I_{0}t}{pi a_{0}m_{0}v^{2}}lnleft[1+left( rac{eta}
{ heta_{E}}ight)^{2} ight]Im( rac{-1}{epsilon(E)})=
kIm(rac{-1}{epsilon(E)})$
- zlp: {number, Signal}
- If the ZLP is the same for all spectra, the intengral of the ZLP can be provided as a number. Otherwise, if the ZLP intensity is not the same for all spectra, it can be provided as i) a Signal of the same dimensions as the current signal containing the ZLP spectra for each location ii) a Signal of signal dimension 0 and navigation_dimension equal to the current signal containing the integrated ZLP intensity.
- t: {None, number, Signal}
- The sample thickness in nm. If the thickness is the same for all spectra it can be given by a number. Otherwise, it can be provided as a Signal with signal dimension 0 and navigation_dimension equal to the current signal.
k: Signal instance
-
hyperspy.misc.eels.tools.
estimate_variance_parameters
(noisy_signal, clean_signal, mask=None, pol_order=1, higher_than=None, return_results=False, plot_results=True, weighted=False)¶ Find the scale and offset of the Poissonian noise
By comparing an SI with its denoised version (i.e. by PCA), this plots an estimation of the variance as a function of the number of counts and fits a polynomy to the result.
Parameters: - clean_SI (noisy_SI,) –
- mask (numpy bool array) – To define the channels that will be used in the calculation.
- pol_order (int) – The order of the polynomy.
- higher_than (float) – To restrict the fit to counts over the given value.
- return_results (Bool) –
- plot_results (Bool) –
Returns: - Dictionary with the result of a linear fit to estimate the offset
- and scale factor
-
hyperspy.misc.eels.tools.
power_law_perc_area
(E1, E2, r)¶
-
hyperspy.misc.eels.tools.
ratio
(edge_A, edge_B)¶
-
hyperspy.misc.eels.tools.
rel_std_of_fraction
(a, std_a, b, std_b, corr_factor=1)¶