Ticket #8052 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

SANS support event mode data reduction

Reported by: Gesner Passos Owned by: Gesner Passos
Priority: major Milestone: Release 3.0
Component: SANS Keywords:
Cc: Blocked By: #7643, #8054
Blocking: #6928, #8059 Tester: Martyn Gigg

Description

This script should produce the same result as the same one changing LoadEventNexus to LoadNexus (current one).

import ISISCommandInterface as ici
run = '19682'
ev = LoadEventNexus(run)
ici.SANS2D()
ici.MaskFile('/apps/mantid/systemtests/Data/SANS2D/MASKSANS2D.091A')
ici.AssignSample(ev,reload=False)
ici.Gravity(True)
wav1 = 2.0
wav2 = wav1 + 2.0
reduced = ici.WavRangeReduction()
event_reduced = RenameWorkspace(reduced)

Attachments

sans_input.csv (132 bytes) - added by Gesner Passos 7 years ago.

Change History

comment:1 Changed 7 years ago by Gesner Passos

  • Status changed from new to inprogress

comment:2 Changed 7 years ago by Gesner Passos

  • Blocked By 8054 added

Changed 7 years ago by Gesner Passos

comment:3 Changed 7 years ago by Gesner Passos

To test, check that this script:

import ISISCommandInterface as ici
w15161_sans_nxs = LoadEventNexus('15161')
w15161_trans_nxs = LoadNexus('15161')
w15157_trans_nxs = LoadNexus('15157')
w15158_sans_nxs = LoadEventNexus('15158')
w15158_trans_nxs = LoadNexus('15158')

ici.SANS2D()
ici.MaskFile('systemtests/Data/SANS2D/MASKSANS2D.091A')

ici.AssignSample(w15161_sans_nxs , reload=False)
ici.AssignCan(w15158_sans_nxs, reload=False)
ici.TransmissionSample(w15161_trans_nxs, w15157_trans_nxs, reload=False)
w15157_trans_nxs = LoadNexus('15157')
ici.TransmissionCan(w15158_trans_nxs, w15157_trans_nxs, reload=False)
ici.TransFit(mode='Off', lambdamin=None, lambdamax=None, selector='BOTH')
wav1 = 2.0
wav2 = wav1 + 2.0
reduced = ici.WavRangeReduction()
event_reduced = RenameWorkspace(reduced)
print event_reduced

Produces the same result as:

  • Opening ISIS interface
  • Loading Mask: systemtests/Data/SANS2D/MASKSANS2D.091A
  • Loading batch file as attached. (sans_input.csv)
  • Executing Reduce1D
Last edited 7 years ago by Gesner Passos (previous) (diff)

comment:4 Changed 7 years ago by Gesner Passos

  • Blocking 8059 added

comment:5 Changed 7 years ago by Gesner Passos

Add more functions to SANSUtility

General functions that will be used for other modules, to deal with event worksapces.

re #8052

Changeset: 02ce92361ad91b49d72eaadb69cb21f292d707ad

comment:6 Changed 7 years ago by Gesner Passos

Add support for allowing receving event workspace for SANS reduction

re #8052

Changeset: 828f5974871a18f1f308c1b86c8887adbc60c17a

comment:7 Changed 7 years ago by Gesner Passos

Merge branch 'feature/8052_event_mode_sans' into develop

Conflicts:

Code/Mantid/scripts/SANS/isis_reduction_steps.py

re #8052

Changeset: 5caa4f216c3c7c45cf6f42fb39444e2be1c44af2

comment:8 Changed 7 years ago by Gesner Passos

  • Blocked By 7643 added

comment:9 Changed 7 years ago by Gesner Passos

  • Status changed from inprogress to verify
  • Resolution set to fixed

I'm putting it fixed today, because it was waiting for #7643 to be tested. But, it has been in the develop branch since 02/10/2013.

comment:10 Changed 7 years ago by Peter Parker

  • Status changed from verify to verifying
  • Tester set to Peter Parker

comment:11 Changed 7 years ago by Peter Parker

  • Status changed from verifying to reopened
  • Resolution fixed deleted

The script runs fine, but the SANS ISIS interface runs into difficulty:

CreateWorkspace started
CreateWorkspace successful, Duration 0.00 seconds
LoadInstrument started
LoadInstrument successful, Duration 0.09 seconds
Unrecognized line in user file the line READ, ignoring
L/SP lines are ignored
Unrecognized line in user file the line READ, ignoring
L/SP lines are ignored
LoadRaw started
Error in execution of algorithm LoadLog:
The log file provided is invalid as it has more than three columns.
Unable to successfully run LoadLog Child Algorithm
Unable to successfully run LoadLog Child Algorithm
Cannot process ICPevent log. Period 1 assumed for all data.
LoadRaw successful, Duration 0.18 seconds
LoadSampleDetailsFromRaw started
LoadSampleDetailsFromRaw successful, Duration 0.00 seconds
MoveInstrumentComponent started
MoveInstrumentComponent successful, Duration 0.00 seconds
MoveInstrumentComponent started
MoveInstrumentComponent successful, Duration 0.00 seconds
MoveInstrumentComponent started
MoveInstrumentComponent successful, Duration 0.00 seconds
LoadRaw started
Error in execution of algorithm LoadLog:
The log file provided is invalid as it has more than three columns.
Unable to successfully run LoadLog Child Algorithm
Unable to successfully run LoadLog Child Algorithm
Cannot process ICPevent log. Period 1 assumed for all data.
LoadRaw successful, Duration 0.14 seconds
LoadSampleDetailsFromRaw started
LoadSampleDetailsFromRaw successful, Duration 0.00 seconds
LoadRaw started
Error in execution of algorithm LoadLog:
The log file provided is invalid as it has more than three columns.
Unable to successfully run LoadLog Child Algorithm
Unable to successfully run LoadLog Child Algorithm
Cannot process ICPevent log. Period 1 assumed for all data.
LoadRaw successful, Duration 0.13 seconds
LoadSampleDetailsFromRaw started
LoadSampleDetailsFromRaw successful, Duration 0.00 seconds
LoadInstrument started
LoadInstrument successful, Duration 0.00 seconds
LoadInstrument started
LoadInstrument successful, Duration 0.00 seconds
LoadRaw started
Error in execution of algorithm LoadLog:
The log file provided is invalid as it has more than three columns.
Unable to successfully run LoadLog Child Algorithm
Unable to successfully run LoadLog Child Algorithm
Cannot process ICPevent log. Period 1 assumed for all data.
LoadRaw successful, Duration 0.12 seconds
LoadSampleDetailsFromRaw started
LoadSampleDetailsFromRaw successful, Duration 0.00 seconds
MoveInstrumentComponent started
MoveInstrumentComponent successful, Duration 0.00 seconds
MoveInstrumentComponent started
MoveInstrumentComponent successful, Duration 0.00 seconds
MoveInstrumentComponent started
MoveInstrumentComponent successful, Duration 0.00 seconds
LoadRaw started
Error in execution of algorithm LoadLog:
The log file provided is invalid as it has more than three columns.
Unable to successfully run LoadLog Child Algorithm
Unable to successfully run LoadLog Child Algorithm
Cannot process ICPevent log. Period 1 assumed for all data.
LoadRaw successful, Duration 0.12 seconds
LoadSampleDetailsFromRaw started
LoadSampleDetailsFromRaw successful, Duration 0.00 seconds
LoadRaw started
Error in execution of algorithm LoadLog:
The log file provided is invalid as it has more than three columns.
Unable to successfully run LoadLog Child Algorithm
Unable to successfully run LoadLog Child Algorithm
Cannot process ICPevent log. Period 1 assumed for all data.
LoadRaw successful, Duration 0.11 seconds
LoadSampleDetailsFromRaw started
LoadSampleDetailsFromRaw successful, Duration 0.00 seconds
LoadInstrument started
LoadInstrument successful, Duration 0.00 seconds
LoadInstrument started
LoadInstrument successful, Duration 0.00 seconds
CropWorkspace started
EndWorkspaceIndex out of range!
Error in execution of algorithm CropWorkspace:
EndWorkspaceIndex out of range!
Cannot load file :Can not find spectra for main-detector-bank in the workspace 15161_sans_raw [3,16386]
Exception:(<type 'exceptions.IndexError'>, IndexError('EndWorkspaceIndex out of range!',), <traceback object at 0x000000000A274088>)
DeleteWorkspace started
DeleteWorkspace successful, Duration 0.00 seconds
DeleteWorkspace started
DeleteWorkspace successful, Duration 0.00 seconds
DeleteWorkspace started
DeleteWorkspace successful, Duration 0.00 seconds
DeleteWorkspace started
DeleteWorkspace successful, Duration 0.00 seconds
DeleteWorkspace started
DeleteWorkspace successful, Duration 0.00 seconds
ValueError: Can not find spectra for main-detector-bank in the workspace 15161_sans_raw [3,16386]
Exception:(<type 'exceptions.IndexError'>, IndexError('EndWorkspaceIndex out of range!',), <traceback object at 0x000000000A274088>)
  at line 27 in '<Interface>'
  caused by line 155 in 'C:/Development/Source/Mantid/Code/Mantid/scripts/SANS\SANSBatchMode.py'
  caused by line 406 in 'C:/Development/Source/Mantid/Code/Mantid/scripts/SANS\ISISCommandInterface.py'
  caused by line 624 in 'C:/Development/Source/Mantid/Code/Mantid/scripts/SANS\ISISCommandInterface.py'
  caused by line 280 in 'C:/Development/Source/Mantid/Code/Mantid/scripts/SANS\isis_reducer.py'
  caused by line 1061 in 'C:/Development/Source/Mantid/Code/Mantid/scripts/SANS\isis_reduction_steps.py'
  caused by line 328 in 'C:/Development/Source/Mantid/Code/Mantid/scripts/SANS\isis_instrument.py'

comment:12 Changed 7 years ago by Gesner Passos

  • Status changed from reopened to verify
  • Resolution set to fixed

I forgot to mention something. The Current SANS reduction uses the Singleton pattern. It is not supposed to use like this (having the graphical interface and the scripts) in interchanged running. Hence, this is not a real test case. The goal is to ensure that the reduction with the event data is compatible with the current one based in the histogram data. After this ticket, I will work on #6928 to allow having the event reduction from gui.

So, in order to be able to test the system, you may need to add the following line after the import statement:

reload(ici)

And, always click in Reload the User File when trying the Graphical Interface. This ensure that the system is in the position to be able to run the reduction correctly.

comment:13 Changed 7 years ago by Martyn Gigg

  • Status changed from verify to verifying
  • Tester changed from Peter Parker to Martyn Gigg

comment:14 Changed 7 years ago by Martyn Gigg

I ran with both event & histogram. There is a very slight difference that is understood and comes down to the difference between events & histogram representations. The salient features remain and are the same as they should in both.

comment:15 Changed 7 years ago by Martyn Gigg

Merge remote-tracking branch 'origin/feature/8052_event_mode_sans'

Conflicts:

Code/Mantid/scripts/SANS/isis_reduction_steps.py

Refs #8052

Changeset: f092ef5a8839d537688765c55663d0c69f615964

comment:16 Changed 7 years ago by Martyn Gigg

  • Status changed from verifying to closed

Merge remote-tracking branch 'origin/feature/8052_event_mode_sans'

Conflicts:

Code/Mantid/scripts/SANS/isis_reduction_steps.py

Refs #8052

Full changeset: f092ef5a8839d537688765c55663d0c69f615964

comment:17 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 8897

Note: See TracTickets for help on using tickets.