-
Notifications
You must be signed in to change notification settings - Fork 128
Add algorithm for creating POLREF transmission workspaces #38466
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 algorithm for creating POLREF transmission workspaces #38466
Conversation
The background subtraction algorithm has a ProcessingInstructions property, which is the same name as the property on ReflectometryISISCreateTransmission. This means that error messages can be confusing if we don't explicitly mention that they have come from the background subtraction algorithm.
Use the LoadAndMerge algorithm to load and sum all the runs into a single workspace as part of the first step.
The flood correction performs a divide which can result in the corrected workspace being set as a distribution. This affects the result of the integration that takes place when normalising by monitors during the transmission workspace creation. The flood corrected workspace should not be marked as a distribution, according to the definition that the integration algorithm is using for this, so we need to set the flag back to False.
6a56d63
to
70c1eef
Compare
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.
Thanks for adding this algorithm. I have followed the test instructions and the transmission workspace is created with the intended properties. Additionally, unit tests and system tests are passing. The docs are well formatted and clear to follow.
I have few -minor- suggestions and questions, but otherwise it looks good.
...PythonInterface/plugins/algorithms/WorkflowAlgorithms/ReflectometryISISCreateTransmission.py
Show resolved
Hide resolved
...PythonInterface/plugins/algorithms/WorkflowAlgorithms/ReflectometryISISCreateTransmission.py
Show resolved
Hide resolved
...PythonInterface/plugins/algorithms/WorkflowAlgorithms/ReflectometryISISCreateTransmission.py
Show resolved
Hide resolved
...PythonInterface/plugins/algorithms/WorkflowAlgorithms/ReflectometryISISCreateTransmission.py
Show resolved
Hide resolved
...test/python/plugins/algorithms/WorkflowAlgorithms/ReflectometryISISCreateTransmissionTest.py
Show resolved
Hide resolved
...test/python/plugins/algorithms/WorkflowAlgorithms/ReflectometryISISCreateTransmissionTest.py
Show resolved
Hide resolved
Add link in the comment explaining the workaround for getting workspace group outputs from child algorithms to the issue that has been opened for this on GitHub.
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.
Thanks for taking the time to address my comments.
I approved as the changes won't affect the test output.
Description of work
Summary of work
A new algorithm that implements the pre-processing steps described on the linked issue. See the "Calibration runs" section for a description of what is required. The purpose of the algorithm is to pre-process the magnetic and non-magnetic calibration runs taken on POLREF so that they are ready to pass to the
PolarizationEfficienciesWildes
algorithm.Fixes #35682.
Further detail of work
This PR includes a few workarounds in order to prevent delays to the work. However, ideally more fundamental fixes should be found, so I will open issues for the following:
It seems that you cannot retrieve the output workspace group from an
OutputWorkspace
property when an algorithm is run as a child on a workspace group. As explained in the comment in the code, I have implemented a workaround, but it would be good to try and resolve this at source at some point (Calling child algorithms with workspace groups doesn't populate output workspace property #38473).The
Divide
algorithm sets the YUnit to an empty string and the distribution flag toTrue
if two workspaces with the same units are divided by each other. However the MantidIntegration
algorithm performs the integration differently for distribution data as it assumes that it means the counts in the workspace have been divided by the bin width. The apparent discrepancy between the two definitions of "distribution" can lead to incorrect results when we create the transmission workspace after a flood correction (due to the use of theIntegration
algorithm withinCreateTransmissionWorkspaceAuto
in order to normalize by monitors). In this PR, I have manually set the flood corrected workspace back to a non-distribution as a workaround.To test:
This implements a workflow that the POLREF scientists have already implemented in their own code, so I have validated against their results to check that the new algorithm produces equivalent results.
The reviewer should run the new algorithm and check that the validation is robust. The following script can be used to do that:
The algorithm docs should be built and checked to ensure that they are easy to understand, and there are no spelling and grammar issues.
I have run a build from branch to check that the system test passes on all operating systems, although this was a few weeks ago now so could be repeated by the reviewer if they want to.
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.