Skip to content
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

Fix wrong detector selection when loading high angle bank user files in ISIS SANS #18926

Merged
merged 3 commits into from Feb 21, 2017

Conversation

AntonPiccardoSelg
Copy link
Contributor

@AntonPiccardoSelg AntonPiccardoSelg commented Feb 20, 2017

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:

  1. LAB
  2. HAB
  3. BOTH
  4. MERGED

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
  1. Open the ISIS SANS GUI
  2. Select LOQ as your instrument
  3. Load the user file: USER_LOQ_165B_M3_XinXpress_4mm_Changer_MAIN.txt
  4. Close the ISIS SANS GUI
  5. Open the ISIS SANS GUI
  • Confirm that your specified user file has been loaded
  1. Switch to the Reduction Settings tab
    • Confirm that the selected detector reads main-detector-bank.
    • Confirm that main-detector-bank is the first entry in the drop down list.
  2. Switch back to the Run Numbers tab and add LOQ99335 as the sample scatter run.
  3. Press Load Data and once the file has loaded press 1D Reduce
  4. Perform the same reduction in MantidV3.9, ie load the user file, set the sample scatter value, load it and start the reduction
  5. Compare the results of the reduction (99335main_1D_2.2_10.0). See images below(log-log-plot):

Mantid 3.9:
image

With Fix:
image

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
  1. Open the ISIS SANS GUI
  2. Select LOQ as your instrument
  3. Load the user file: USER_LOQ_165B_M3_XinXpress_4mm_Changer_HAB.txt
  4. Close the ISIS SANS GUI
  5. Open the ISIS SANS GUI
    • Confirm that your specified user file has been loaded
  6. Switch to the Reduction Settings tab
    • Confirm that the selected detector reads HAB.
    • Confirm that HAB is the second entry in the drop down list.
  7. Switch back to the Run Numbers tab and add LOQ99335 as the sample scatter run.
  8. Press Load Data and once the file has loaded press 1D Reduce
  9. Perform the same reduction in MantidV3.9, ie load the user file, set the sample scatter value, load it and start the reduction, note that the output's name will be 99335main_1D_2.2_10.0 which is part of the issue in M3.9 (you would normally expect it to be 99335hab_1D_2.2_10.0).
  10. Compare the results of the reduction (99335hab_1D_2.2_10.0). See images below(log-log-plot):

Mantid 3.9:
image

With Fix:
image

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
  1. Open the ISIS SANS GUI
  2. Select SANS2DTUBES as your instrument
  3. Load the user file: USER_SANS2D_154E_2p4_4m_M3_Xpress_8mm_SampleChanger_REAR.txt
  4. Close the ISIS SANS GUI
  5. Open the ISIS SANS GUI
    • Confirm that your specified user file has been loaded
  6. Switch to the Reduction Settings tab
    • Confirm that the selected detector reads rear-detector.
    • Confirm that rear-detector is the first entry in the drop down list.
  7. Switch back to the Run Numbers tab and add SANS2D00034484 as the sample scatter run.
  8. Press Load Data and once the file has loaded press 1D Reduce
  9. Perform the same reduction in MantidV3.9, ie load the user file, set the sample scatter value, load it and start the reduction.
  10. Compare the results of the reduction (34484rear_1D_1.75_16.5). See images below(log-log-plot):

Mantid 3.9:
image

With Fix:
image

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
  1. Open the ISIS SANS GUI
  2. Select SANS2DTUBES as your instrument
  3. Load the user file: USER_SANS2D_154E_2p4_4m_M3_Xpress_8mm_SampleChanger_FRONT.txt
  4. Close the ISIS SANS GUI
  5. Open the ISIS SANS GUI
    • Confirm that your specified user file has been loaded
  6. Switch to the Reduction Settings tab
    • Confirm that the selected detector reads front-detector.
    • Confirm that front-detector` is the second entry in the drop down list.
  7. Switch back to the Run Numbers tab and add SANS2D00034484 as the sample scatter run.
  8. Press Load Data and once the file has loaded press 1D Reduce
  9. Perform the same reduction in MantidV3.9, ie load the user file, set the sample scatter value, load it and start the reduction (the name of the workspace will be 34484rear_1D_1.75_16.5 which is part of the problem)
  10. Compare the results of the reduction (34484front_1D_1.75_16.5). See images below(log-log-plot):

Mantid 3.9:
image

With Fix:
image

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 to Det\Front in an existing user file, but I didn't change L\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
  1. Open the ISIS SANS GUI
  2. Select LARMOR as your instrument
  3. Load the user file: USER_Pappas_RB1569004_163C_3DMag_12x12_r12194.txt
  4. Close the ISIS SANS GUI
  5. Open the ISIS SANS GUI
    • Confirm that your specified user file has been loaded
  6. Switch to the Reduction Settings tab
    • Confirm that the selected detector reads DetectorBench.
    • Confirm that DetectorBench is the first entry in the drop down list.
  7. Switch back to the Run Numbers tab and add LARMOR00012311 as the sample scatter run.
  8. Press Load Data and once the file has loaded press 1D Reduce
  9. Perform the same reduction in MantidV3.9, ie load the user file, set the sample scatter value, load it and start the reduction
  10. Compare the results of the reduction (12311rear_1D_0.9_12.5). See images below(log-log-plot):

Mantid 3.9:
image

With Fix:
image

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
  • Is the code of an acceptable quality?
  • Does the code conform to the coding standards? Is it well structured with small focussed classes/methods/functions?
  • Are there unit/system tests in place? Are the unit tests small and test the a class in isolation?
  • If there are changes in the release notes then do they describe the changes appropriately?
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.

@AntonPiccardoSelg AntonPiccardoSelg added SANS Issues and pull requests related to SANS Bug Issues and pull requests that are regressions or would be considered a bug by users (e.g. crashing) Patch Candidate Urgent issues that must be included in a patch following a release High Priority An issue or pull request that if not addressed is severe enough to postponse a release. labels Feb 20, 2017
@AntonPiccardoSelg AntonPiccardoSelg added this to the Release 3.10 milestone Feb 20, 2017
@lottiegreenwood
Copy link

works as described in testing :shipit:

@martyngigg martyngigg self-assigned this Feb 21, 2017
@martyngigg martyngigg merged commit ccbef1e into master Feb 21, 2017
@martyngigg martyngigg deleted the 18924_detector_selection_isis_sans branch February 21, 2017 17:14
martyngigg added a commit that referenced this pull request Feb 23, 2017
Refs #18924 Add fix for detector selection

(cherry picked from commit a7a9ee7)

Refs #18924 Formatting

(cherry picked from commit 393ac4b)

Add to patch release notes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues and pull requests that are regressions or would be considered a bug by users (e.g. crashing) High Priority An issue or pull request that if not addressed is severe enough to postponse a release. Patch Candidate Urgent issues that must be included in a patch following a release SANS Issues and pull requests related to SANS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Detector Selection is inconsistent in ISIS SANS GUI
3 participants