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

How to specify per-shot wavelength #667

Closed
phyy-nx opened this issue May 24, 2019 · 7 comments · Fixed by #717
Closed

How to specify per-shot wavelength #667

phyy-nx opened this issue May 24, 2019 · 7 comments · Fixed by #717
Milestone

Comments

@phyy-nx
Copy link
Contributor

phyy-nx commented May 24, 2019

At XFELs, each shot has a different wavelength. How can we specify this in NeXus? Looking the DIALS code that reads NeXus data, we are assuming that if incident_wavelength is an array, than each entry in that array is a wavelength for a different shot. However, I think we are mis-interpreting incident_wavelength:
http://download.nexusformat.org/doc/html/classes/applications/NXmx.html
"In the case of a polychromatic beam this is an array of the wavelengths with the relative weights in incident_wavelength_weight."

So what's the right way to do this?

Current problems in the documentation:

  1. NXmx/beam is a base class NXbeam, but its documentation does not match the base class NXbeam documentation. Compare:
    http://download.nexusformat.org/doc/html/classes/applications/NXmx.html
    http://download.nexusformat.org/doc/html/classes/base_classes/NXbeam.html
  2. incident_wavelength_spectrum, an NXdata field defined in NXmx in its beam group, has no doc string, and is not included in the base class NXbeam documentation.
  3. The base class NXbeam has a NXdata field with this docstring: "Distribution of beam with respect to relevant variable e.g. wavelength. This is mainly useful for simulations which need to store plottable information at each beamline component." I don't understand what this means, can someone clarify it for me?

I think I could specify per-shot wavelength using the NXdata field of NXbeam or using incident_wavelength_spectrum, but the latter seems wrong since I'm not recording a spectrum.

Thoughts?

@vasole
Copy link
Contributor

vasole commented May 24, 2019 via email

@prjemian
Copy link
Contributor

Follow the example of NXcanSAS. Look at I_axes in http://download.nexusformat.org/doc/html/classes/applications/NXcanSAS.html#nxcansas

@phyy-nx phyy-nx added this to the NXDL 2019.10 milestone Sep 11, 2019
@phyy-nx
Copy link
Contributor Author

phyy-nx commented Jan 21, 2020

Existing keys in NXmx:

incident_wavelength: In the case of a monchromatic beam this is the scalar wavelength. In the case of a polychromatic beam this is an array of the wavelengths with the relative weights in incident_wavelength_weight.
incident_wavelength_weight:
In the case of a polychromatic beam this is an array of the relative weights of the corresponding wavelengths in incident_wavelength.

CodeCamp proposal: Modify these to have extra dimensionality to support per-shot wavelength. 4 use cases (n: number of shots, m: number of wavelengths in a spectrum):

  1. One wavelength only. incident_wavelength is a scalar and incident_wavelength_weight is not set.
  2. One wavelength per shot. incident_wavelength is an array of length n and incident_wavelength_weight is not set.
  3. One spectrum only. incident_wavelength is an array of length m and incident_wavelength_weight is an array of length m.
  4. One spectrum per shot. incident_wavelength is an array of dimension n,m and incident_wavelength_weight is an array of dimension n,m.

Additional proposal: deprecate incident_wavelength_spectrum. This field was part of the original NXmx spec, but has no doc string and it's unclear if it's been used before.

@phyy-nx
Copy link
Contributor Author

phyy-nx commented Jan 22, 2020

From further discussion at CodeCamp 2020, the above proposal is replaced with the incoming pull request that insteads adds extra dimensionality to incident_wavelength, deprecates incident_wavelength_weight and incident_wavelength_spectrum, and adds incident_wavelength_axes to specify the axes names for incident_wavelength.

@yayahjb
Copy link
Contributor

yayahjb commented Jan 22, 2020 via email

@phyy-nx
Copy link
Contributor Author

phyy-nx commented Jan 22, 2020

Thanks Herbert, I un-deprecated them, but I noted incident_wavelength_weight limited to 1D (single spectrum only) and clarified the language around the rest of the spec. #706 is ready for review again.

@phyy-nx
Copy link
Contributor Author

phyy-nx commented Jan 23, 2020

New pull request (better!) in #717.

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