-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Description of peak fitting (e.g., in XPS) #170
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make n-dimensional
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Intersting approach, but I find it a bit much XPS-specific. I suggest to create a more universal description of a curve fitting procedure (see specific suggestions)
I agree with the points @rettigl suggested. I think it would be nice to have specialisations of NXpeak (or NXpeak_fit), e.g., NXgaussian_fit, NXlorentz_fit, which supply a specific fixed set of parameters but I would also supply a general NXcurve_fit, which allows to use a formula. Gaussian and Lorentz lineshapes could also be reflected in it, but it requires a bit more effort from the user. This is what I opted to use in NXdispersive_material to describe dispersion curves with the option the specialise it later (https://fairmat-nfdi.github.io/nexus_definitions/classes/contributed_definitions/NXdispersion_function.html#nxdispersion-function). I also build a grammar for the function notation (see https://fairmat-nfdi.github.io/nexus_definitions/ellipsometry-structure.html#dispersive-material). The specialised lineshape could also be a formula notation with a literal specifying the actual formula. That way a reader wouldn't actually need to know the different peak lineshapes but could directly parse the formula and use that (I wrote a small formula parser for the dispersive material: https://github.com/PyEllips/formula-dispersion). We could also build a similar grammar for the xps peak fitting. I'm also part of a NIAC task force to design formula notation inside the NeXus format in which we will finalise a more rigid notation until September. One small additional question: What happens if multiple peaks are supplied? Are they simply summed up? |
Thanks for everybody's comments. Based on your ideas, I suggest the following structure: we have an
This is then meant to be used for a peak fit in one region. For the XPS example, this could be used to describe the fitting of one measured C 1s spectrum. Then, the |
After implementing the structure outlined above, I have started working on a more rigorous description of the fit functions and its parameters. A draft can be found in Now, peaks and backgrounds have a
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NXxps seems to be mostly fine, but the indended use of the NXfit base classes is at various places not clear to me. Do you have a working example of how to use this?
6bfa90f
to
eedcbf6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR has in my opinion already been developed and converged well enough to merge as a version to have something for the discussion with the NIAC @lukaspie
Aspects of what would be nice to have additionally we can always solve along the way.
Currently though NXpeak,
BUT merge conflicts need to be resolved
12a5edc
to
6ffb9d6
Compare
Merged, there may be small updates if an example is available. |
NXfit
.NXxps
Resolves #158.