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 multiple scattering correction to OSIRIS script #35927
Conversation
I got the following error:
|
@MialLewis feel free to approve this once you are happy with it |
@RichardWaiteSTFC if I remove the |
Probably, so without the sample details it cannot actually perform the attenuation corrections - even though you have set |
I cannot see any reference to absorption in the history. So thats good. How would I change the script to run the correction? If I add the
|
Ah I see, I think you need to call
|
the script already has that
It does seem to be calculating something with 100 scattering points. How do I know it did the correction? |
Was testing with @AnthonyLim23 - he found this error thrown when focusing with
It looks like an issue with this bit of code mantid/scripts/Diffraction/isis_powder/routines/focus.py Lines 182 to 191 in 28d9c3c
There needs to be a check here (or higher up) that the sample is set if when absorb is True
Also the attenuation looks pretty high because the number densities are very high! Remember that sample number density is in units number of formula units per cubic angstrom. So for example Al is an FCC crystal so has 4 atoms in a cubic unit cell with length a=4.04 Ang so the number density is 4/(4.04^3) = 0.0607 ish. Check the numbers, but you see it's a few orders of magnitude less than the numbers in your script! |
Thanks, I wasn't aware of that. Some parts of the script were written by Spencer. What do you think? @SpencerHowells |
@MohamedAlmaki In your test instructions, for Al you have number_density=2.71 You should have mass_density=2.71 I assume that the same applies for the sample. |
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.
Looks good to me
Sorry bit late to this, but why is the check on the sample being defined only done on OSIRIS? |
It has been agreed to open an issue for the check as it is not a regression issue. issue raised here #36017 |
Description of work
This PR adds multiple scattering corrections to the OSIRIS Diffraction script.
Purpose of work
The aim of the work is to improve the current script's functionality.
Summary of work
Multiple scattering has been added to the OSIRIS script.
Further detail of work
DiscusMultipleScatteringCorrection
has been added to the OSIRIS script. To enable it you need to set themultiple_scattering
parameter toTrue
. In addition, algorithm parametersNeutronPathsSingle
andNeutronPathsMultiple
has been added to the script. An example of how to use the multiple scattering scatteringTo test:
Make sure the following script works fine:
Contact me for configuration files. Also, make sure you update the directories in the script with paths in your local machine.
Fixes #35430.
Reviewer
Please comment on the points listed below (full description).
Your comments will be used as part of the gatekeeper process, so please comment clearly on what you have checked during your review. If changes are made to the PR during the review process then your final comment will be the most important for gatekeepers. In this comment you should make it clear why any earlier review is still valid, or confirm that all requested changes have been addressed.
Code Review
Functional Tests
Does everything look good? Mark the review as Approve. A member of
@mantidproject/gatekeepers
will take care of it.Gatekeeper
If you need to request changes to a PR then please add a comment and set the review status to "Request changes". This will stop the PR from showing up in the list for other gatekeepers.