Ticket #9096 (assigned)

Opened 7 years ago

Last modified 5 years ago

SANS Reduction of loaded workspaces

Reported by: Gesner Passos Owned by: Peter Parker
Priority: major Milestone: Backlog
Component: SANS Keywords:
Cc: taylorrj@… Blocked By:
Blocking: #7500 Tester:

Description

This script does not work any more:

import ISISCommandInterface as ici
MASKFILE = FileFinder.getFullPath('MaskSANS2DReductionGUI.txt')
ici.SANS2D()
ici.MaskFile(MASKFILE)
sample_ws = Load('22048')
ici.AssignSample(sample_ws, reload=False)
reduced = ici.WavRangeReduction()

Although, this one works:

import ISISCommandInterface as ici
MASKFILE = FileFinder.getFullPath('MaskSANS2DReductionGUI.txt')
ici.SANS2D()
ici.MaskFile(MASKFILE)
sample_ws = LoadNexus('22048')
ici.AssignSample(sample_ws, reload=False)
reduced = ici.WavRangeReduction()

The reason is that there is a vulnerability in this commit introduced in #8906.

https://github.com/mantidproject/mantid/commit/96f039dace80e93a601d32cfe4ff6fe862a01045

The get_monitor function assumes that if there is no workspace_monitor, than it is a histogram workspace where the monitors precede the detector data.

In this specific case, we have an EventWorkspace but no workspace_monitor. Hence, when SliceEvent gets the monitor, it will get the event workspace. And the slice2histogram will fail.

Before correcting this error, update the SystemTests/AnalysisTests/SANSLoadersTest.py to show this vulnerability, by checking that what is returned from get_monitor has the first detector as monitor.

ws = xxx.get_monitor()
assertTrue(ws.getDetector(0).isMonitor())

This should be true always, whatever be the Sample given to the reducer.

Although it is a vulnerability, it is highly unlikely to be 'exploited' in the current status of our interface, as the users have no way to give workspaces directly to be reduced.

Hence, this ticket must be implemented before #7500.

I'll put Russel in cc as he might be interested as he is about to introduce #8906 to a patch release.

Change History

comment:1 Changed 7 years ago by Owen Arnold

  • Status changed from new to assigned

comment:2 Changed 7 years ago by Russell Taylor

I let #8906 into the patch release on the basis that users won't see the bug, but I'd still encourage you to fix it before the next release.

comment:3 Changed 6 years ago by Peter Parker

  • Milestone changed from Release 3.2 to Backlog

comment:4 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 9939

Note: See TracTickets for help on using tickets.