forked from dials/dxtbx
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
Add time-of-flight beam #492
Closed
Closed
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
…y. Added type hints to BeamFactory.
…ecific to an X-ray experiment.
Codecov Report
@@ 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 going to revisit this context shortly |
Will recreate with newer versions of code. |
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.
This adds a time-of-flight beam object (
TOFBeam
) to dxtbx, to allow for neutron time-of-flight Laue experiments.TOFBeam
derives fromBeam
, and differs in that it has asample_to_moderator_distance
and does not have an explicit monochromatic wavelength. To satisfy theBeamBase
interface it still hasset_wavelength
andset_s0
methods, which raise exceptions. This is a code smell, but is a trade off to prevent needing to modify theBeamBase
interface and having dynamic casting downstream etc. TheBeamBase
get_wavelength
andget_s0
methods are satisfied by allowing aTOFBeam
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 inAbstractBeamFactory
.BeamBaseFactory
has also been added, which chooses betweenTOFBeamFactory
BeamFactory
based on input.