-
Notifications
You must be signed in to change notification settings - Fork 56
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
Per shot wavelength, second try #717
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-Specify how to do monochromatic shot-to-shot variation -Specify how to do polychromatic shot-to-shot variation -Include shot-to-shot variation in wacelength spread
- Remove TODO - detector element -> detector module. - Typos - Extend flux and total_flux to allow shot-to-shot variation - Remove non-required items from NXSource and reference that they can be found in the base class documentation Thanks @benajamin, @yayahjb, @PeterC-DLS, @prjemian for the review. Yay code camp!
This fixes #696 |
phyy-nx
added a commit
to cctbx/dxtbx
that referenced
this pull request
Apr 3, 2020
SpectrumBeam has these methods: set_spectrum(flex.double energies, flex.double weights) get_spectrum_energies() get_spectrum_weights() get_weighted_wavelength() Two flex arrays, energies (eV) and weights (dimensionless), represent the spectrum as a scatter plot. This follows the conventions set up in nexusformat/definitions#717. The new function get_weighted_wavelength uses a simple weighted mean to determine a wavelength. It is ok if the SpectrumBeam has a wavelength != get_weighted_wavelength. This represents a calibrated wavelength determined from processing the spectrum. is_similar_to tests get_weighted_wavelength between the two beams. Includes tests.
phyy-nx
added a commit
to cctbx/dxtbx
that referenced
this pull request
Apr 3, 2020
Uses the unofficial key incident_wavelength_calculated, but otherwise implements nexusformat/definitions#717.
phyy-nx
added a commit
to cctbx/cctbx_project
that referenced
this pull request
Apr 3, 2020
Uses the convention of nexusformat/definitions#717 with the addition of a yet-unofficial field, incident_wavelength_calculated, to store the calculated wavelength SwissFEL provides. This wavelength comes from a smoothed, fitted processing of the spectra. As it can be considered derived information, so is in a separate dataset.
phyy-nx
added a commit
to cctbx/dxtbx
that referenced
this pull request
Apr 3, 2020
Uses the unofficial key incident_wavelength_calculated, but otherwise implements nexusformat/definitions#717.
phyy-nx
added a commit
to cctbx/dxtbx
that referenced
this pull request
Apr 8, 2020
Adds these methods: set_spectrum(flex.double energies, flex.double weights) get_spectrum_energies() get_spectrum_weights() get_weighted_wavelength() Two flex arrays, energies (eV) and weights (dimensionless), represent the spectrum as a scatter plot. This follows the conventions set up in nexusformat/definitions#717. The new function get_weighted_wavelength uses a simple weighted mean to determine a wavelength. It is ok if the beam has a wavelength != get_weighted_wavelength. This represents a calibrated wavelength determined from processing the spectrum. is_similar_to tests get_weighted_wavelength between the two beams, if a spectrum is present. Includes tests.
phyy-nx
added a commit
to cctbx/dxtbx
that referenced
this pull request
Apr 9, 2020
Adds these methods: set_spectrum(flex.double energies, flex.double weights) get_spectrum_energies() get_spectrum_weights() get_weighted_wavelength() Two flex arrays, energies (eV) and weights (dimensionless), represent the spectrum as a scatter plot. This follows the conventions set up in nexusformat/definitions#717. The new function get_weighted_wavelength uses a simple weighted mean to determine a wavelength. It is ok if the beam has a wavelength != get_weighted_wavelength. This represents a calibrated wavelength determined from processing the spectrum. is_similar_to tests get_weighted_wavelength between the two beams, if a spectrum is present. Includes tests.
phyy-nx
added a commit
to cctbx/dxtbx
that referenced
this pull request
Apr 9, 2020
Uses the unofficial key incident_wavelength_calculated, but otherwise implements nexusformat/definitions#717
phyy-nx
added a commit
to cctbx/dxtbx
that referenced
this pull request
Apr 9, 2020
Adds these methods: set_spectrum(flex.double energies, flex.double weights) get_spectrum_energies() get_spectrum_weights() get_weighted_wavelength() Two flex arrays, energies (eV) and weights (dimensionless), represent the spectrum as a scatter plot. This follows the conventions set up in nexusformat/definitions#717. The new function get_weighted_wavelength uses a simple weighted mean to determine a wavelength. It is ok if the beam has a wavelength != get_weighted_wavelength. This represents a calibrated wavelength determined from processing the spectrum. is_similar_to tests get_weighted_wavelength between the two beams, if a spectrum is present. Includes tests.
phyy-nx
added a commit
to cctbx/cctbx_project
that referenced
this pull request
Apr 14, 2020
Uses the convention of nexusformat/definitions#717 with the addition of a yet-unofficial field, incident_wavelength_calculated, to store the calculated wavelength SwissFEL provides. This wavelength comes from a smoothed, fitted processing of the spectra. As it can be considered derived information, so is in a separate dataset.
phyy-nx
added a commit
to cctbx/cctbx_project
that referenced
this pull request
Apr 15, 2020
Uses the convention of nexusformat/definitions#717 with the addition of a yet-unofficial field, incident_wavelength_calculated, to store the calculated wavelength SwissFEL provides. This wavelength comes from a smoothed, fitted processing of the spectra. As it can be considered derived information, so is in a separate dataset.
phyy-nx
added a commit
to cctbx/dxtbx
that referenced
this pull request
May 4, 2020
Adds these methods: set_spectrum(flex.double energies, flex.double weights) get_spectrum_energies() get_spectrum_weights() get_weighted_wavelength() Two flex arrays, energies (eV) and weights (dimensionless), represent the spectrum as a scatter plot. This follows the conventions set up in nexusformat/definitions#717. The new function get_weighted_wavelength uses a simple weighted mean to determine a wavelength. It is ok if the beam has a wavelength != get_weighted_wavelength. This represents a calibrated wavelength determined from processing the spectrum. is_similar_to tests get_weighted_wavelength between the two beams, if a spectrum is present. Includes tests.
phyy-nx
added a commit
to cctbx/cctbx_project
that referenced
this pull request
May 5, 2020
Uses the convention of nexusformat/definitions#717 with the addition of a yet-unofficial field, incident_wavelength_calculated, to store the calculated wavelength SwissFEL provides. This wavelength comes from a smoothed, fitted processing of the spectra. As it can be considered derived information, so is in a separate dataset.
phyy-nx
added a commit
to cctbx/dxtbx
that referenced
this pull request
May 5, 2020
Uses the unofficial key incident_wavelength_calculated, but otherwise implements nexusformat/definitions#717
phyy-nx
added a commit
to cctbx/cctbx_project
that referenced
this pull request
May 12, 2020
Uses the convention of nexusformat/definitions#717 with the addition of a yet-unofficial field, incident_wavelength_calculated, to store the calculated wavelength SwissFEL provides. This wavelength comes from a smoothed, fitted processing of the spectra. As it can be considered derived information, so is in a separate dataset.
phyy-nx
added a commit
to cctbx/dxtbx
that referenced
this pull request
May 19, 2020
Uses the unofficial key incident_wavelength_calculated, but otherwise implements nexusformat/definitions#717
phyy-nx
added a commit
to cctbx/dxtbx
that referenced
this pull request
May 21, 2020
Uses the unofficial key incident_wavelength_calculated, but otherwise implements nexusformat/definitions#717
phyy-nx
added a commit
to cctbx/dxtbx
that referenced
this pull request
May 28, 2020
Adds these methods: set_spectrum(flex.double energies, flex.double weights) get_spectrum_energies() get_spectrum_weights() get_weighted_wavelength() Two flex arrays, energies (eV) and weights (dimensionless), represent the spectrum as a scatter plot. This follows the conventions set up in nexusformat/definitions#717. The new function get_weighted_wavelength uses a simple weighted mean to determine a wavelength. It is ok if the beam has a wavelength != get_weighted_wavelength. This represents a calibrated wavelength determined from processing the spectrum. is_similar_to tests get_weighted_wavelength between the two beams, if a spectrum is present. Includes tests.
phyy-nx
added a commit
to cctbx/dxtbx
that referenced
this pull request
May 28, 2020
Uses the unofficial key incident_wavelength_calculated, but otherwise implements nexusformat/definitions#717
phyy-nx
added a commit
to cctbx/dxtbx
that referenced
this pull request
May 29, 2020
Adds these methods: set_spectrum(flex.double energies, flex.double weights) get_spectrum_energies() get_spectrum_weights() get_weighted_wavelength() Two flex arrays, energies (eV) and weights (dimensionless), represent the spectrum as a scatter plot. This follows the conventions set up in nexusformat/definitions#717. The new function get_weighted_wavelength uses a simple weighted mean to determine a wavelength. It is ok if the beam has a wavelength != get_weighted_wavelength. This represents a calibrated wavelength determined from processing the spectrum. is_similar_to tests get_weighted_wavelength between the two beams, if a spectrum is present. Includes tests.
phyy-nx
added a commit
to cctbx/dxtbx
that referenced
this pull request
May 29, 2020
Uses the unofficial key incident_wavelength_calculated, but otherwise implements nexusformat/definitions#717
phyy-nx
added a commit
to cctbx/dxtbx
that referenced
this pull request
Jul 27, 2020
Details: - Add Spectrum C++ object that implements methods get_energies (eV), get_weights (unitless), and get_weighted_wavelenth (angstroms). Spectrum can only be set from constructor. - Add get_spectrum method to Format and FormatMultiImage - Add get_spectrum method to ImageSet. Does not cache it like it does for detector, beam, etc. - Implement get_spectrum in NeXus. Specifically implements nexusformat/definitions#717, using optional variants to specify a calibrated wavelength and a spectrum.
This was referenced Jul 27, 2020
phyy-nx
added a commit
to cctbx/dxtbx
that referenced
this pull request
Jul 29, 2020
* Add Spectrum as a read-only class obtainable from an imageset Details: - Add Spectrum C++ object that implements methods get_energies_eV (eV), get_weights (unitless), and get_weighted_wavelenth (angstroms). Spectrum can only be set from constructor. - Add get_spectrum method to Format and FormatMultiImage - Add get_spectrum method to ImageSet. Does not cache it like it does for detector, beam, etc. - Implement get_spectrum in NeXus. Specifically implements nexusformat/definitions#717, using optional variants to specify a calibrated wavelength and a spectrum. - Add test for c++ spectrum object - Add bandwidth calculation. Computes: emin_ev = 1% on CDF and emax_ev = 99% on CDF so 98% or more of the spectrum is within the range. Added a test for this, which has a computed approximation to a real SwissFEL spectrum (so could be useful in other tests) - Add weighted energy variance. Recover the weighted variance around the weighted mean. Add test which makes a clean Gaussian and recovers the same parameters. Co-authored-by: Graeme Winter <graeme.winter@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Extend incident_wavelength to allow per-shot variation
Also, py2 bug in nxdl2rst.py.
Fixes #667