Fix wrong detector selection when loading high angle bank user files in ISIS SANS #18926
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.
Fixes #18924.
The ISIS SANS GUI had some inconsistent behaviour regarding the detector selection. The code assumed an ordering of detector selection drop-down list of:
which was broken by the a Python method which returns [LAB, HAB] or [HAB, LAB] depending on the current detector selection. The code then associated the first entry of the Python-returned list with index 0 in the drop down list and so on. This is wrong and seems to have been there for years. We added a more explicit name check.
To test:
We want to compare the output of this fix with the output of an installed Mantid3.9 version, so you will need that installed on your computer.
LOQ
Please find the relevant data here: smb://olympic/babylon5/Scratch/Anton/DetectorSelection/LOQ
Make sure that the data is in your path.
Test
main-detector-bank
main-detector-bank
.main-detector-bank
is the first entry in the drop down list.LOQ99335
as the sample scatter run.Load Data
and once the file has loaded press1D Reduce
99335main_1D_2.2_10.0
). See images below(log-log-plot):Mantid 3.9:
With Fix:
Verify that your output looks the same and that the results from Mantid with and without the fix are the same.
11. Close the ISIS SANS Reduction GUI
Test
HAB
HAB
.HAB
is the second entry in the drop down list.LOQ99335
as the sample scatter run.Load Data
and once the file has loaded press1D Reduce
99335main_1D_2.2_10.0
which is part of the issue in M3.9 (you would normally expect it to be99335hab_1D_2.2_10.0
).99335hab_1D_2.2_10.0
). See images below(log-log-plot):Mantid 3.9:
With Fix:
Verify that your output looks the same and that the results from Mantid with and without the fix are different, especially the q range is different. With the fix the q range is 0.1125 to 1.4 as specified by the line
L/Q .1125 1.4 0.0125/lin
in the user file.11. Close the ISIS SANS Reduction GUI
SANS2D
Please find the relevant data here: smb://olympic/babylon5/Scratch/Anton/DetectorSelection/SANS2D
Make sure that the data is in your path.
Test
rear-detector
rear-detector
.rear-detector
is the first entry in the drop down list.SANS2D00034484
as the sample scatter run.Load Data
and once the file has loaded press1D Reduce
34484rear_1D_1.75_16.5
). See images below(log-log-plot):Mantid 3.9:
With Fix:
Verify that your output looks the same and that the results from Mantid with and without the fix are the same.
11. Close the ISIS SANS Reduction GUI
Test
front-detector
front-detector
.SANS2D00034484
as the sample scatter run.Load Data
and once the file has loaded press1D Reduce
34484rear_1D_1.75_16.5
which is part of the problem)34484front_1D_1.75_16.5
). See images below(log-log-plot):Mantid 3.9:
With Fix:
Verify that your output looks the same and that the result from Mantid with and without the fix is not the same. Note that the q range is not selected well here, since all I did was change
Det\Rear
toDet\Front
in an existing user file, but I didn't changeL\Q
, hence the result does not make sense but it demonstrates the difference between M3.9 and the version with the fix.11. Close the ISIS SANS Reduction GUI
LARMOR
Please find the relevant data here: smb://olympic/babylon5/Scratch/Anton/DetectorSelection/LARMOR
Make sure that the data is in your path.
LARMOR has only one detector, it should not have been affected by the bug previously, nevertheless
we make sure that everything is ok at this point.
Test
DetectorBench
DetectorBench
.DetectorBench
is the first entry in the drop down list.LARMOR00012311
as the sample scatter run.Load Data
and once the file has loaded press1D Reduce
12311rear_1D_0.9_12.5
). See images below(log-log-plot):Mantid 3.9:
With Fix:
Verify that your output looks the same and that the results from Mantid with and without the fix are the same. Nothing should have changed here.
11. Close the ISIS SANS Reduction GUI
Release Notes
Please see here
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.