Hi Till,
We're missing some information from you, namely, "what are you wanting to do"? Do you want to fit the spots and/or the background? Are you just interested in getting the position of the spots? Their intensity?
The main reason your fit isn't happening is because you're not calling fit() but creating a reference to the fit method (function) by calling "fit = m.fit". This just creates a "shortcut" to the m.fit method, rather than calling it.
You're currently creating a single component that tries to fit both a diffraction spot and the background. I don't really understand your expression and what the three parts of it fit (the first bit is a linear plane, the second is a gaussian, but what is the third?), but hyperspy's model advantage lies in dividing these up.
Try to create one component to define the background, and one for the peaks. For the Gaussian, you're probably better off using the predefined Gaussian2D component, and also setting it's minimum intensity to zero:
"
g = hs.model.components2D.Gaussian2D(A = 10, centre_x=4.359,centre_y=2.073)
g.A.bmin = 0
g.sigma_x.bmin = 0
g.sigma_y.bmin = 0
background = hs.model.components2D.Expression("a*(x-x0)+b*(y-y0)+c", name="Background")
m.extend([g, background])
m.fit(bounded=True)
m.print_current_values()
"
However. 2D model fitting in hyperspy is still in its infancy. It might be better to see if pycrystem or atomap (both built on hyperspy) can improve your situation.
Best,
Thomas