pyEELSMODEL.components.MScatter package

Submodules

pyEELSMODEL.components.MScatter.mscatter module

class pyEELSMODEL.components.MScatter.mscatter.Mscatter(specshape, llspectrum)

Bases: Component

A convolutor component can take the input of another component and apply a convolution operator to it and store the results of that operation in its own spectrum data. The model will treat this as special and first calculate the individual components that have canconvolute set, sum those and then apply these as input to a convolutor component (typically only 1 in a model). After this those components are added which have canconvolute=False (eg a background component)

calculate()

This calculates the spectral data of the component. Each derived class from Component will need to implement its own functionality here.

Return type:

None.

load(fh)

Loads different types of data. The possible datatypes are: .hdf5, .hspy, .dm3/.dm4 and .msa.

Parameters:
  • filename (string) – String of the filename where the extention should be ‘.hdf5’

  • flip_sign (boolean) – Indicates whether the offset value should be negative when loading a .dm file. (default: False)

Returns:

s – The spectrum which is contained in the filename

Return type:

Spectrum

padding(specshape, llspectrum)

Zero pads the low loss spectrum to have the same size as the spectrum shape. :param specshape: The spectrum shape on the spectrum it will be used, not the low

loss spectrum

Parameters:

llspectrum (Spectrum or MultiSpectrum) – The spectrum or multispectrum which is used to convolve the rest of the components with.

save(fh)

pyEELSMODEL.components.MScatter.mscatterfft module

class pyEELSMODEL.components.MScatter.mscatterfft.MscatterFFT(specshape, llspectrum, use_padding=True)

Bases: Mscatter

Mutiple scattering using FFT (e.g. to concolve model with LL spectrum)

calculate()

This calculates the spectral data of the component. Each derived class from Component will need to implement its own functionality here.

Return type:

None.

calculate_A_matrix(A_matrix)

Convolution via matrices instead of for loop. This function is not faster than the regular convolution and is not used in pyEELSMODEL.

calculate_raw()
calculate_w_padding()

Function which adds the zero padding to remove the intensity of the end of the model to come into the beginning of the model.

Module contents