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 CorrectionType property to SpecularReflectionPositionCorrect #18890
Add CorrectionType property to SpecularReflectionPositionCorrect #18890
Conversation
There is a new property, 'CorrectionType', which specifies whether detectors should be shifted vertically or rotated around the sample position.
Functionality looks good. I've also tried with other reflectometry instruments:
The output is:
|
I just have a minor comment about the new property name: while I think In addition, I see in the interface that the property is in the group |
@@ -21,7 +21,7 @@ detectors of interest. Only the detectors of interest will be corrected, the res | |||
will remain in the original position. Note that when :literal:`ProcessingInstructions` is not set, its value | |||
is inferred from other properties, depending on the value of :literal:`AnalysisMode`: |
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.
Can we add a brief sentence when we mention algorithm SpecularReflectionPositionCorrect
saying that detectors will be corrected according to the new property? The reason I suggest this is because I know most of the times scientists only look at the documentation of ReflectometryReductionOneAuto
.
point-detector | ||
Original position: [25.6,0,0.0444961] | ||
Vertical shift: [25.6,0,0.0444753] | ||
Rotated: [25.6,0,0.0444753] |
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.
Does this mean that in this case and for this angle, there's no difference between moving detectors vertically and rotating them?
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 think the difference is just so tiny it doesn't show up, but I'll check...
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.
Here's the output to 10dp:
point-detector
Original: 25.6000000000,0.0000000000,0.0444960632
Vertical: 25.6000000000,0.0000000000,0.0444753266
Rotated: 25.6000003547,0.0000000000,0.0444753326
So, there is a difference but it's tiny. I can add a note to the docs to make that clear - it's probably useful to explain that sometimes the difference will be negligible.
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 checking this, I just wanted to make sure that there was an explanation for this.
While testing this I noticed a bug in the algorithm, which is unrelated to the changes in this PR. I was trying to run this script:
which is obviously wrong because |
I see the same crash with the invalid detector name, so I've created #18905 for that issue. |
I think I've made all of the changes suggested if you could take another look @raquelalvarezbanos, thanks. |
Thanks @gemmaguest , the new property works as expected, so this is ready to be merged, but some conflicts with master need to be resolved. |
when all tests pass. |
This PR adds a new property,
CorrectionType
, toSpecularReflectionPositionCorrect
. This specifies whether detector positions should be corrected by a vertical shift (default) or by a rotation around the sample position. The new property is also exposed inReflectometryReductionOneAuto
and the GUI.To test:
The following script demonstrates the usage of the new property. As per the expected output, the detector positions are slightly different depending on whether the correction was a vertical shift or a rotation.
Expected output:
Fixes #18722 .
Added to the release notes.
Reviewer
Please comment on the following (full description):
Code Review
Functional Tests
Do changes function as described? Add comments below that describe the tests performed?
How do the changes handle unexpected situations, e.g. bad input?
Has the relevant documentation been added/updated?
Is user-facing documentation written in a user-friendly manner?
Has developer documentation been updated if required?
Does everything look good? Comment with the ship it emoji but don't merge. A member of
@mantidproject/gatekeepers
will take care of it.