pyEELSMODEL.operators.quantification package
Submodules
pyEELSMODEL.operators.quantification.elemental_quantification module
- class pyEELSMODEL.operators.quantification.elemental_quantification.ElementalQuantification(spectrum, elements, edges, settings, ll=None)
Bases:
OperatorObject which has the workflow to perform elemental quantification. Many different attributes can be easily modified to have some flexibility in the workflow.
- align_zlp()
Align the multispectra using the low loss. If no multispectrum is used, then this method will not do anything.
- do_procedure()
Workflow to process core loss results. First it aligns the multispectrum using the low loss. Then the model is calculated and the fitter object is created and the fitting procedure begins.
- estimate_autofit_powerlaw()
Estimates the indices used to get information on the starting position of the power law. This is a region before the first edge in the spectrum.
- estimate_sampling()
- get_CRLB()
Returns the CRLB for the different components of the coreloss edges.
- get_elemental_maps()
- get_multimodels()
Calculates the different multimodels of the different components. The first multimodel is contains the fitted background. Then it adds the next edge until all edges are added. Hence the last multimodel in the list is the resulting fit. The inbetween results help interpreting the fitted cross sections.
- Returns:
multimodels – A list constaining multimodels to visualize how the resulting fit A list constaining multimodels to visualize how the resulting fit looks like.
- Return type:
list of MultiSpectrum
- make_background()
Makes the background component.
- make_coreloss()
Makes the atomic cross sections components. It uses Zezhongs calculated GOS array to compute the cross sections.
- make_finestructure()
Creates fine structure components for edge core loss edge. It uses the fine_intervals attribute to know the interval region of the fine structure. The sampling is determined by the fwhm of the zlp. The self.pre_fine is used to indicate how much before the edge onset the fine structure should start.
- make_fitter()
Makes the fitter object. If the self.background_model is linear then a linear fitter is used. Else a non-linear least squares fitter will be used.
- make_model()
Creates the model from the available components.
- make_mscatter()
Creates the multiple scattering component. It uses the lowloss for this.
- show_elements_maps()
Shows the elemental maps.
- visualize_autofit(bg)
Visualizes the region used for the estimation. Helpful for debugging
pyEELSMODEL.operators.quantification.extract_experimental_edge module
- class pyEELSMODEL.operators.quantification.extract_experimental_edge.ExperimentalEdgeExtractor(multispectrum, settings, ll)
Bases:
OperatorExtract experimental edge from an EELS map which can be used to do oxidation state mapping or other things.
- add_quantification_method(hl, ll, elements, edges, intervals, pre_fine)
Creates a quantification object. This could be used to modify some settings to optimize the fit itself.
- Parameters:
hl (Spectrum) – The spectrum from which to get the reference edge
ll (Spectrum) – The low loss spectrum which is from the same part as hl.
elements (list) – List of elements which are present in the spectrum hl
edges (list) – List of edge of the elements. The length of this list should be equal to the elements list.
intervals (list) – List of energy intervals [eV] over which to fit the fine structure.
pre_fine (list) – List of energies onset energy with respect to the onset energy of the atomic cross section. Hence a positive value indicates that the fine structure starts before expected onset from the atomic cross section. Negative values would be unexpected.
- calculate_spectra()
Calculates the average spectra from the areas which have been selected. These are stored in the self.spectra and self.llspectra attributes.
- define_new_region(input_map=None, max_points=4, coords=None)
Define an AreaSelection object. This object is able to extract the average spectrum from a given area which can be selected via the openend image. This is done by right clicking on the image. One could also provide coords which then selects the area from the given coordinates.
- Parameters:
input_map (numpy 2d array) – The image which is shown. Could be the ADF image acquired simul- taneously. If None, the image shows the total intensity of the detector at each probe position. (default: None)
max_points (uint) – The number of points used to draw the area.
coords (list) – A list with x and y-coordinates of the points. For instance for a rectangle with starting position (1,2), width=5 and height=7 coords = [[1,1,6,6],[2,9,9,2]].
- extract_edge(index, elements, edges, intervals, pre_fine)
Fits the average spectrum indicated by index using the elements and edges. The interval indicates the energy region over which to fit the fine structure. Pre_fine is used to modify the start position of the fine structure with respect to the atomic cross section. The sampling of the fine structure is determined by the fwhm of the zlp.
- Parameters:
index (int) – The index of the chosen area. The first area selected has index 0 and so forth. The show_regions() function also shows which area corresponds to which index.
elements (list) – List of elements which are present in the spectrum of index
edges (list) – List of edge of the elements. The length of this list should be equal to the elements list.
intervals (list) – List of energy intervals [eV] over which to fit the fine structure.
pre_fine (list) – List of energies onset energy with respect to the onset energy of the atomic cross section. Hence a positive value indicates that the fine structure starts before expected onset from the atomic cross section. Negative values would be unexpected.
- show_average_spectra()
Shows the average spectra from the different areas.
- Returns:
fig – The create figure
- Return type:
Figure
- show_regions()
Shows the selected areas together with the index. This index is usefull for the self.extract_edge() function.
- Returns:
fig – The create figure
- Return type:
Figure