Skip to content

Conversation

@toastisme
Copy link
Contributor

@toastisme toastisme commented Mar 1, 2022

This adds a time-of-flight beam object (TOFBeam) to dxtbx, to allow for neutron time-of-flight Laue experiments.

TOFBeam derives from Beam, and differs in that it has a sample_to_moderator_distance and does not have an explicit monochromatic wavelength. To satisfy the BeamBase interface it still has set_wavelength and set_s0 methods, which raise exceptions. This is a code smell, but is a trade off to prevent needing to modify the BeamBase interface and having dynamic casting downstream etc. The BeamBase get_wavelength and get_s0 methods are satisfied by allowing a TOFBeam to store a given reflection (only through required values to avoid dependency on DIALS), thereby giving it a wavelength and s0.

To account for multiple beam types a TOFBeamFactory has been added, which conforms to a general beam factory interface outlined in AbstractBeamFactory. BeamBaseFactory has also been added, which chooses between TOFBeamFactory BeamFactory based on input.

@codecov
Copy link

codecov bot commented Mar 2, 2022

Codecov Report

Merging #492 (7e8dbd4) into main (c119306) will increase coverage by 0.16%.
The diff coverage is 67.22%.

@@            Coverage Diff             @@
##             main     #492      +/-   ##
==========================================
+ Coverage   40.91%   41.08%   +0.16%     
==========================================
  Files         176      176              
  Lines       15528    15619      +91     
  Branches     2795     2822      +27     
==========================================
+ Hits         6354     6417      +63     
- Misses       8618     8629      +11     
- Partials      556      573      +17     

@toastisme toastisme requested a review from ndevenish March 3, 2022 16:49
@ndevenish
Copy link
Collaborator

@toastisme going to revisit this context shortly

@ndevenish
Copy link
Collaborator

Will recreate with newer versions of code.

@ndevenish ndevenish closed this Feb 23, 2023
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

Successfully merging this pull request may close these issues.

3 participants