NXxas refactoring#1352
Conversation
|
Hi @woutdenolf, I came across this PR by chance and noticed that you are working on a base class for describing an electron level. In the context of photoemission spectroscopy, we in FAIRmat have also been working on something very similar: https://github.com/FAIRmat-NFDI/nexus_definitions/blob/fairmat/contributed_definitions/NXelectron_level.nxdl.xml. In fact, some of the base class we developed was originally adapated from another XAS-related PR: #1293. Would you be open to harmonizing the concept that we were developing with your approach here? I think the two approaches are already very similar right now. |
|
@lukaspie Yes since we are doing the same thing we should try to converge. We are currently discussing this very topic: XraySpectroscopy#2. Feel free to get involved. The XAS working group will work in https://github.com/XraySpectroscopy/nexus_definitions. It would be helpful to add comments in that repo. This PR will be a draft and is subject to lots of changes until we are finished. |
|
@woutdenolf great, thanks for the pointers. I will add some comments there. |
This was the first attempt before we created the XAS working group. It will most likely be closed. |
|
@woutdenolf after asking a question to the nexus mailing list and reading: I arrived here :) I have had a look at the proposal you made to the NXxas_new I am particularly interested in the topic raised in #1011 of adding the ability to work with multiple detectors. I see that you've added the entry Do you plan to include the suggestions from @padraic-shafer in https://github.com/padraic-shafer/definitions/blob/1011-multixas/contributed_definitions/NXmultixas.nxdl.xml When is the next planned meeting of the working group? Can I come along? |
|
Currently we only support a single XAS spectrum. I'm very much open to support multi-detector and/or multi-scan. You are very welcome to join the XAS working group. I'll contact you directly. |
| <field name="name"/> | ||
| <field name="probe"> | ||
| <enumeration> | ||
| <item value="x-ray"/> |
There was a problem hiding this comment.
If you want to allow the "electron energy loss" mode, then you should also allow an "electron" probe type.
| </enumeration> | ||
| </field> | ||
| <group type="NXelement" name="element"> | ||
| <doc>Excited element</doc> |
There was a problem hiding this comment.
What if I want to do a scan that includes multiple absorption edges (e.g. Carbon K-edge and K L-edge)? Can I specify multiple elements?
| </item> | ||
| <item value="electron yield"> | ||
| <doc> | ||
| TODO total or partial electron yield |
There was a problem hiding this comment.
Does this include Auger electron yield? Can we include a way to specify the observed electron energy range? Or should that be a detail for NXdetector?
| </dimensions> | ||
| </field> | ||
| </group> | ||
| <group type="NXdetector" name="i0" optional="true"> |
There was a problem hiding this comment.
The i0 should have a corresponding NXmonitor group. There are also many ways of measuring an i0 that is useful to document in the file. For example, is the i0 measured in parallel with the sample absorption (or its proxy), or is it measured in sequence (e.g. before or after the sample), or is it sequential, but interleaved?
There is also question of how "clean" the i0 data is, as in how directly/accurately does the i0 measurement follow the ideal incident flux signal? This issue is particularly significant for C K-edge measurements - one can read my article on the topic to further understand this issue.
|
#1352 (comment) |
Co-authored-by: Wout De Nolf <wout.de_nolf@esrf.eu>
Use enumerations for the absorption edge and emission lines
Co-authored-by: mkuehbach <markus.kuehbach@physik.hu-berlin.de> Co-authored-by: Markus Kühbach <mkuehbach@users.noreply.github.com>
Co-authored-by: Lukas Pielsticker <you@example.com>
* initialize the NXazint contribution * parse MAXIV proposal * Renaming momentum transfer magnitude to scattering vector magnitude * separating out the 2D case and minor refactoring * 2d NXazint example ala Danmax * Update NXazint2d.nxdl.xml Updated based on implementation at DanMAX. Changed to US spelling. Lower case spelling for long names. Long name for 'norn' must be changed! * Update NXazint2d.nxdl.xml Added I_errors field. * Add nEtaEdge in symbols Fixed symbols by adding nEtaEdge * Align 1D and 2D definition Through update of the NXazint1d definition based on the NXazint2d definition * Remove nImg from norm Removing the nImg value from norm and decrease the rank * long name for norm added a descriptive long name for the norm * added long name for norm added a descriptive long name for the norm * Fixed syntax error in line 46 * FIX syntax error in line 155 * Update NXazint2d.nxdl.xml Change units for azimuthal_axis to NX_ANGLE * capitals, monitor, fix mention of eta bins * stupid mistake in monitor dimensions * monitor data * Update NXazint1d.nxdl.xml Changed NX_CHAR types to NX_ANY * Update NXazint2d.nxdl.xml Changed the unit types deom NX_CHAR to NX_ANY * update 2d align with 1d bold for some field names, add normalisation boolean * fix typos in 2d * add links in description * NXazint1d without explicit NXsubgroup and polished * indent cleaning * 1d: \t replaced by 2 spaces * 1d: commas in NXentry description * NXazint2d with NXsubentry removed * NXazint2d: indent and white chars * adding NX_WAVENUMBER alternative for NX_PER_LENGTH * Fix mostly typos in 1D case. Co-authored-by: Peter Chang <peter.chang@diamond.ac.uk> * Fix typos also in 2D case * doc for normalization_applied and adding optional monitor_applied * adding fixed/restricted units in monochromator * moving NXazint(s) to applications definitions * cosmetic changes in NXazzint(s) documentation * NXazint(s) - only changes in the documentation of the corrections: 1) removed comments using undefined notation, some statements made more definitive, adding a Note label * Making the note about normalization strategy more explicit. * making 'reduction' field lowercase * Update applications/NXazint1d.nxdl.xml Co-authored-by: Peter Chang <peter.chang@diamond.ac.uk> * Update applications/NXazint1d.nxdl.xml Co-authored-by: Peter Chang <peter.chang@diamond.ac.uk> * Update applications/NXazint1d.nxdl.xml Co-authored-by: Peter Chang <peter.chang@diamond.ac.uk> * Remuving capitalized names of NXclass instances where not needed. * adding word 'effective' in the long description of norm * restructured documentation of normalization_applied --------- Co-authored-by: Zdenek <zdenek.matej@maxiv.lu.se> Co-authored-by: Paul Bell <paul.bell@maxiv.lu.se> Co-authored-by: mrvj <mads@chem.au.dk> Co-authored-by: Frederik <47137695+fgjorup@users.noreply.github.com> Co-authored-by: Zdeněk Matěj <zmatej@centrum.cz> Co-authored-by: Zdenek <32390711+zdemat@users.noreply.github.com> Co-authored-by: Peter Chang <peter.chang@diamond.ac.uk>
Also, update and fix release note creator script, tweak base class text to not use too long footnote (otherwise PDF output has ugly overlap)
Move tomography definitions to a new imaging category and move scattering definitions to diffraction
|
The two options for the updated application definition described above and in Telco 20260211 are implemented below. 30/04/2026 The first proposal was retained.
Rendered documentation: https://nexus-definitions.readthedocs.io/en/xas-using-inheritance/classes/contributed_definitions/NXxas.html
Rendered documentation: https://nexus-definitions.readthedocs.io/en/xas-using-modes/classes/applications/NXxas.html |
|
@mretegan strongly opposed to having separate NXpey, Nxtey - etc. NXxas is sufficient. We are communicating normalized mu(E), and indicating how it was collected. The subclasses could be fine, but they have proven to be a distraction. |
@newville I personally prefer the separate NX classes and I think there are good arguments for it. Over all, the fact that can be reused in other application definitions, like NXXmcd, independent of NXXas. I think the best would be to have a meeting for discussing this. |
|
@maurov in general, it is OK to have subclasses. Are these meant to be complete? People measure XAS-like data in lots of different ways that develop and change. The NXxas definition should communicate normalized mu(E). Yes, different modes may need different kinds of corrections or have different interpretations (surface-sensitivity, energy resolution, magnetic moment). Still, most of these can be communicated as normalized mu(E), and so be useful in comparison to some other normalized mu(E) data. Just calling them XAS and listing a named mode would be fine, at least for the overwhelming majority of data. With 4 or 10 "XAS modes", now you have a problem that people will forever be unsure whether NXxeol can be compared to NXpey. Adoption of NXxas was always going to be difficult. NeXuS has very real problems of coming from a tiny, self-selected group that claims the expertise to be a standards body. The current NXxas definition is utterly useless and demonstrates that core weakness of NeXuS. A revised definition for NXxas has to overcome all this baggage and demonstrate value in the result and in the process. The longer it takes, the more it appears to come from a small group of people, the more it appears to come from one facility, the harder it is to convince people. Months were spent on how to spell the names of emission lines, and adding the complexity of subclasses, and yet there is currently no usable definition. I think that "perfect" has defeated "good". |
|
@newville, I can't comment on the substance of your criticisms because I'm not an XAS expert and have not been involved in the NXxas discussions, but I have to push back on your characterization of the NeXus standard body. The current NIAC has members from twenty facilities, all of whom have been approved by their management to represent them. They are dedicated to advancing the standard, even if they cannot claim to have expertise in every single neutron and x-ray scattering technique. However, they are committed to supporting those who do. If the NXxas effort has stalled for some reason, then I encourage you to attend the next NIAC teleconference explaining what you believe the problems are. I think you will find the committee very receptive to constructive criticism. Creating consensus around standards such as NeXus is hard, but the payoffs of having metadata-rich data formats are worth it at a time when we are being mandated to provide shareable data repositories. Please encourage your colleagues to get involved. Things won't improve without people committing their own time and effort. |
* Update NXxas and add child classes * Build docs * Add .readthedocs.yaml * Remove optional iref from NXxas_trans * Add a NXcollection for generic raw data * Move NXxas and related subclasses to contributed_definitions * Substitute NXelement with the existing NXatom * Rename element to absorber * Re-add reference detector for transmission * Remove optional NXcollection group from NXxas definition * Update Read the Docs configuration to use Ubuntu 24.04 and Python 3.14 * Restrict sphinx version to smaller than 8.2.0 * Add NXatom group to absorption edge and emission line * Replace the `calculated` boolean with `spectrum_type` * Update NXxas_trans definition to include 'iref' in intensity field description * Add NXemission_lines * Remove unused symbols `nTransitions` and `nChan` from NXxas definition * Add grating-type spectrometer to NXxas_pfy * Clarify description of absorption edge in NXxas definition * Make 'energy' field optional and rename 'group' to 'atom' in NXabsorption_edge and NXemission_line * Refactor 'spectrum_type' field to 'experimental' boolean * Allow for the two absorption edge notation * Update NXabsorption_edge documentation * Add emission_energy_window to NXxas_pfy and improve doc * Rename the field to `is_experimental` * Add beamline coordinate system and transformations to NXxas_pfy * Clarify the I_f and I_0 definitions * Make the coordinate sytem optional * Update intensity field description * Fix CI caused by sphinx_toolbox (nexusformat#1628) Restrict sphinx version to be less than 9 as noted in sphinx-toolbox/sphinx-toolbox#201 * updated event_index and event_id description (nexusformat#1404) * updated event_index and event_id description Co-authored-by: Kyle Ma <maq1@ornl.gov> * Add choice element rendering in documentation (nexusformat#1613) This PR adds support for rendering <choice> elements in the HTML documentation and ensures that all elements (fields, groups, choices, links) are rendered in their original XML document order. Closes nexusformat#1439 * Rename 'if' group to 'ifluor' * Rename back to element * Update the emission and Auger lines * Make the name required * Add NXnote to NXxas_herfd * Update 'depends_on' references * Add transformations field to sample * Requier the transformations field in the beamline_coordinate_system * Fix depends_on link * Update the documentation and make partial the crystal analyzers * Add NXcollection group for raw data * Make the monochromator group recommended * Ensure full reprocessing is possible in NXxas_trans * Bring changes from add-nxemission-line-class branch * Add support for stacked spectra in NXxas and NXxas_trans definitions * Add reference subentry for independent spectra in NXxas_trans definition * Add make clean command to Read the Docs * Update the emission line group in NXxas_pfy * Use NXelement * Remove optional time field from NXxas definition --------- Co-authored-by: Peter Chang <peter.chang@diamond.ac.uk> Co-authored-by: Kyle Qianli Ma <41385391+KyleQianliMa@users.noreply.github.com> Co-authored-by: Kyle Ma <maq1@ornl.gov>
WIP: everything will be moved to contributed_definitions once this is up for review.
Contributing: PR to the main branch of https://github.com/XraySpectroscopy/nexus_definitions (merge commits will be removed regularly).
Rendering: https://hdf5.gitlab-pages.esrf.fr/nexus/nxxas/classes/applications/NXxas_new.html
Example files: https://pynxxas.readthedocs.io/
NXDL questions: