Skip to content

How to access the information after the fitting? #62

Answered by georgievgeorgi
nicocopez asked this question in Q&A
Discussion options

You must be logged in to vote

fitres[i] is of type lmfit.model.ModelResult. Documentation for lmfit library is available here.

I didn't know to to access the x-values (those provided during fit) so i found out that it is available in dictionary of user-provided keywords.
You can reproduce the plot by:

ax = spe.plot()
ax.plot(fitres[1].userkws['x'], fitres[1].best_fit)

Anyway, usually one needs to compare the result with a known y-values at fixed x-position or x-positions may be manually generated.

fitres[1].eval(x=np.arange(100, 1000))

I always generated new x-values based on the FWHM / STDEV of leftmost and rightmost peaks of the group.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by nicocopez
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants