mantid icon indicating copy to clipboard operation
mantid copied to clipboard

Add check for time slices that fall entirely within a beam off period for merged reduction with fitting

Open rbauststfc opened this issue 9 months ago • 0 comments

A Sans2D user was unable to time slice their data beyond a certain point because the beam was off for an extended period during the middle of a run. The user was merging the front and rear detectors on Sans2d and allowing the scale (see General tab -> Merged Settings -> Scale) to fit rather than be fixed. The fit couldn't take place for slices that fell within the beam off period during the run as there was no data. The following error message was produced:

Error in execution of algorithm CropWorkspace: Some invalid Properties found: XMax: XMax must be greater than XMin XMin: XMin must be less than XMax Error in execution of algorithm SANSFitShiftScale: Some invalid Properties found: XMax: XMax must be greater than XMin XMin: XMin must be less than XMax at line 81 in '/opt/mantidworkbench6.9/plugins/python/algorithms/WorkflowAlgorithms/SANSFitShiftScale.py' caused by line 152 in '/opt/mantidworkbench6.9/plugins/python/algorithms/WorkflowAlgorithms/SANSFitShiftScale.py' caused by line 260 in '/opt/mantidworkbench6.9/plugins/python/algorithms/WorkflowAlgorithms/SANSFitShiftScale.py' caused by line 288 in '/opt/mantidworkbench6.9/plugins/python/algorithms/WorkflowAlgorithms/SANSFitShiftScale.py' Error in execution of algorithm SANSStitch: Some invalid Properties found: XMax: XMax must be greater than XMin XMin: XMin must be less than XMax at line 81 in '/opt/mantidworkbench6.9/plugins/python/algorithms/WorkflowAlgorithms/SANSFitShiftScale.py' caused by line 152 in '/opt/mantidworkbench6.9/plugins/python/algorithms/WorkflowAlgorithms/SANSFitShiftScale.py' caused by line 260 in '/opt/mantidworkbench6.9/plugins/python/algorithms/WorkflowAlgorithms/SANSFitShiftScale.py' caused by line 288 in '/opt/mantidworkbench6.9/plugins/python/algorithms/WorkflowAlgorithms/SANSFitShiftScale.py' at line 344 in '/opt/mantidworkbench6.9/plugins/python/algorithms/WorkflowAlgorithms/SANSStitch.py' caused by line 240 in '/opt/mantidworkbench6.9/plugins/python/algorithms/WorkflowAlgorithms/SANSStitch.py' Error in execution of algorithm SANSSingleReduction: Some invalid Properties found: XMax: XMax must be greater than XMin XMin: XMin must be less than XMax at line 81 in '/opt/mantidworkbench6.9/plugins/python/algorithms/WorkflowAlgorithms/SANSFitShiftScale.py' caused by line 152 in '/opt/mantidworkbench6.9/plugins/python/algorithms/WorkflowAlgorithms/SANSFitShiftScale.py' caused by line 260 in '/opt/mantidworkbench6.9/plugins/python/algorithms/WorkflowAlgorithms/SANSFitShiftScale.py' caused by line 288 in '/opt/mantidworkbench6.9/plugins/python/algorithms/WorkflowAlgorithms/SANSFitShiftScale.py' at line 344 in '/opt/mantidworkbench6.9/plugins/python/algorithms/WorkflowAlgorithms/SANSStitch.py' caused by line 240 in '/opt/mantidworkbench6.9/plugins/python/algorithms/WorkflowAlgorithms/SANSStitch.py' at line 131 in '/opt/mantidworkbench6.9/plugins/python/algorithms/WorkflowAlgorithms/SANS/SANSSingleReduction.py' caused by line 155 in '/opt/mantidworkbench6.9/plugins/python/algorithms/WorkflowAlgorithms/SANS/SANSSingleReductionBase.py' caused by line 303 in '/opt/mantidworkbench6.9/scripts/SANS/sans/algorithm_detail/single_execution.py' caused by line 131 in '/opt/mantidworkbench6.9/scripts/SANS/sans/algorithm_detail/merge_reductions.py'

The following can be used to reproduce the error:

User File: user_sans2d_235F_4m_2p4_12mm_M4_..._Merged_Changer.TOML (available from ISIS archive) Sample scatter: 84632 Sample transmission: 84632 Sample direct: 84610 Can scatter: 84615 Can transmission: 84615 Can direct: 84610

Time slicing: 19000-20000

This time slice will be empty and so will produce the error.

The data could be reduced by holding the scale at an appropriate value or, to keep the fit, by slicing up to when the beam went off and then starting a fresh time slicing sequence from when the beam came back. Both solutions are OK but require users to be able to identify that the beam went off, which can be tricky. It would be better if we could provide a clearer error message to make it easier for a user to understand what the issue is and how to avoid it. Mantid can check the dae_beam_current sample log, so we should be able to determine if the beam was off for the duration of a particular slice. This isn't a show stopper issue, just a bit of an irritant.

Note that the time slicing given above is to reproduce the error quickly. In real use the error was encountered with this time slicing: 1:300:3000,3001:1800:36000. In this case the user had processed quite a few slices before encountering the error, which takes quite a bit of time. It would be worth investigating if we can add some validation much earlier in the process to pick this up.

rbauststfc avatar May 24 '24 15:05 rbauststfc