-
Notifications
You must be signed in to change notification settings - Fork 55
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
Single crystal PG powder fix #1521
Conversation
…stal. The reason was that the crystal was propagated to its scattering position within the crystal using the crystalite frame instead of the component frame, which thus can result in a position outside the crystal. The fix is simply to save the velocity in the component frame and reuse that for the PROP_DT call.
…ns for the powder mode instead of just one.
I ran a few tests with Test_Monochromators and Test_SX and all looks good. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the changes are OK, but have pushed a few reverts of modified whitespace. (This in my point of view always clutters what the meaning/implication of the "actual" fix is. :-) )
This issue fix has created bug #1732 |
The PG and powder mode for the Single_crystal component rotates the neutron velocities randomly to simulate the random orientation of crystallites. This change of coordinate system was not reverted when propagating the neutron to the scattering position inside of the crystal, and it could thus happen the ray was moved outside of the crystal.
The code was fixed by storing and using the velocity in the component frame and using that just for the propagation when one of the two modes are used.
The Single_crystal_process in Union was checked for the same problem, it was not relevant in that implementation, but other updates the powder system was moved to the Union equivalent, as it now rotates around three directions instead of just two, which is necessary to make a completely random crystal orientation in the powder.