Commit 0b15e2da authored by Zhou, Wenduo's avatar Zhou, Wenduo
Browse files

Refs #12535. Added 1 more doc test and updated release note.

parent bbb7dcc6
......@@ -150,6 +150,49 @@ Output:
workspace tempsplitws_5 has 5133 events
workspace tempsplitws_unfiltered has 50603 events
**Example - Filtering event by a user-generated TableWorkspace**
.. testcode:: FilterEventNoCorrection
ws = Load(Filename='CNCS_7860_event.nxs')
# create TableWorkspace
split_table_ws = CreateEmptyTableWorkspace()
split_table_ws.addColumn('float', 'start')
split_table_ws.addColumn('float', 'stop')
split_table_ws.addColumn('str', 'target')
split_table_ws.addRow([0., 100., 'a'])
split_table_ws.addRow([200., 300., 'b'])
split_table_ws.addRow([400., 600., 'c'])
split_table_ws.addRow([600., 650., 'b'])
# filter evnets
FilterEvents(InputWorkspace=ws, SplitterWorkspace=split_table_ws,
OutputWorkspaceBaseName='tempsplitws3', GroupWorkspaces=True,
FilterByPulseTime = False, OutputWorkspaceIndexedFrom1 = False,
CorrectionToSample = "None", SpectrumWithoutDetector = "Skip", SplitSampleLogs = False,
# Print result
wsgroup = mtd["tempsplitws3"]
wsnames = wsgroup.getNames()
for name in sorted(wsnames):
tmpws = mtd[name]
print "workspace %s has %d events" % (name, tmpws.getNumberEvents())
split_log ='splitter')
print 'event splitter log: entry 0 and entry 1 are {0:.4f} and {1:.4f}.'.format(split_log.times[0], split_log.times[1])
.. testoutput:: FilterEventNoCorrection
workspace tempsplitws3_a has 124 events
workspace tempsplitws3_b has 16915 events
workspace tempsplitws3_c has 10009 events
workspace tempsplitws3_unfiltered has 50603 events
**Example - Filtering event by pulse time**
......@@ -18,6 +18,9 @@ Improved
- :ref`RawFileInfo <algm-RawFileInfo-v1>` now provides sample information.
- :ref`SetInstrumentParameter <algm-SetInstrumentParameter-v1>` now supports also boolean parameters, and better validates the inputs.
- :ref`FilterEvents <algm-FilterEvents-v1>` now accepts a general TableWorkspace as the splitters workspace. The TableWorkspace must have at least 3 columns. The first 3 columns are for relative starting time, relative stopping time and target workspace tag for splitters, respectively.
- :ref`FilterEvents <algm-FilterEvents-v1>` now generates a sample log named *splitter* of each output workspace (i.e., splitted workspace) to represent the event filter that is applied to it.
- :ref`FilterEvents <algm-FilterEvents-v1>` now splits all the sample logs if the input splitters are given by MatrixWorkspace or a general TableWorkspace.
Bug Fixes
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment