Skip to content
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

Examples: aligning and merging datasets with Python #480

Open
lnaglecocco opened this issue Nov 29, 2023 · 1 comment
Open

Examples: aligning and merging datasets with Python #480

lnaglecocco opened this issue Nov 29, 2023 · 1 comment

Comments

@lnaglecocco
Copy link

Hi,

I have seen that there are some very nice Python examples for using larch within the examples/Jupyter folder.

I am unsure the best practice for when we have several datasets collected sequentially (each with reference data) and wish to align and merge them. As far as I can tell, there is not currently an example of this amongst the examples. This is straightforward with XAS Viewer but in Python I am unsure how best to do this, and it would be nice to see what is considered the best way to code this, from the developer of xraylarch, in a way similar to the other example notebooks.

I wondered if at some point somebody could code an example in a Jupyter notebook and add it to the examples/Jupyter folder? This would be very helpful for me and possibly also for others

@newville
Copy link
Member

@lnaglecocco Yeah, "auto-align one mu(E) spectrum to another" (or many spectra to one) is one of the few cases of an algorithm being "in the GUI" and not exposed as a separate function.

On the one hand, this would be fairly easy to move to Python code.

On the other, this is also something that can go spectacularly wrong without much warning and really benefits from visual inspection. All that is being found is an energy shift, which can be set in a number of different ways (including by hand). If you find you "need" an automated energy shift to every spectrum, then there may be something else wrong.

I think that, in general, having more examples in Jupyter would be great.

And, just to be clear, you can align and merge from the Larix GUI, save that session, and read that session (including aligned and merged groups) into Python.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants