0

I tried to use EELSFitter (https://lhcfitnikhef.github.io/EELSfitter/build/html/index.html) package for EEL spectra processing.

I am interested in the Kramers-Kronig analysis (https://lhcfitnikhef.github.io/EELSfitter/build/html/modules/EELSFitter.core.html#module-EELSFitter.core.spectral_image)

My code looks like this (I tried it on a Lorentzian curve)

import numpy as np
import matplotlib.pyplot as plt
import EELSFitter as ef
import EELSFitter.core
from EELSFitter.core.spectral_image import SpectralImage

def Lorentz(x, a, x0,b):
    return a/((x-x0)**2+b**2)

x = np.linspace(1,10,100)
mydata = Lorentz(x,1,5,1)

KramersKronig = SpectralImage.kramers_kronig_analysis(mydata, n_zlp=None, iterations=1, n=None, t=None, delta=0.5)

I got error "SpectralImage.kramers_kronig_analysis() missing 1 required positional argument: 'signal_ssd'".

When I put some other positional argument it looks like it wants arguments from the class (https://lhcfitnikhef.github.io/EELSfitter/build/html/modules/EELSFitter.core.html#module-EELSFitter.core.spectral_image), e.g. the beam_energy, which is one of the class arguments "class EELSFitter.core.spectral_image.SpectralImage(data, deltaE=None, pixel_size=None, beam_energy=None, collection_angle=None, convergence_angle=None, name=None, **kwargs)". The error is "AttributeError: 'numpy.ndarray' object has no attribute 'beam_energy'".

Can you help me, where should I specify the arguments for the class, so I can run the kramers_kronig_analysis()? It may be general question of how to specify class arguments for use in imported functions.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.