Ticket #10044 (closed: worksforme)

Opened 6 years ago

Last modified 5 years ago

Strange over filtering in GenerateEventsFilter

Reported by: Owen Arnold Owned by: Wenduo Zhou
Priority: blocker Milestone: Release 3.3
Component: Framework Keywords:
Cc: Blocked By:
Blocking: Tester: Owen Arnold

Description

I'm struggling to explain why the number of events filtered + number of events unfiltered is not equal to the number of events in the original. Then I came up with this test case which uses a fake log, and should filter everything. BUT the number of events in the filtered workspace is a lot less than those in the original workspace.

Hopefully I'm wrong about this, but if not then there are events disappearing for no reason that I can see.

mtd.importAll()

ws = WISH00029057 # Any of the resent wish event workspaces would be fine.
print "Events in original", ws.getNumberEvents() 
start_time=ws.getRun().startTime()
end_time=ws.getRun().endTime() 
duration =  (end_time - start_time).seconds() 
logname= 'fake_log'
try:
        # delete the log if it already exists
        DeleteLog(ws, logname)
except RuntimeError:
        pass
# Make a fake log that extends for the full duration

for i in range(0, duration):
        t = start_time + int(i*1e9)
        AddTimeSeriesLog(ws,logname, Time=str(t).rstrip(), Value=i+1)
        
generator, info = GenerateEventsFilter(InputWorkspace=ws, FastLog=True, LogName=logname, MinimumLogValue=0.0, FilterLogValueByChangingDirection='Both')
FilterEvents(InputWorkspace=WISH00029057, SplitterWorkspace=generator, OutputWorkspaceBaseName='filtering', InformationWorkspace=info, CorrectionToSample='Elastic', FilterByPulseTime=False)
filtered_ws = mtd['filtering_0']
print "Events in filtered ws", filtered_ws.getNumberEvents()

prints

Events in original 928940
Events in filtered ws 886831

Change History

comment:1 Changed 6 years ago by Owen Arnold

  • Status changed from new to assigned

comment:2 Changed 6 years ago by Owen Arnold

This could be related to #10022. Not completely sure about that.

comment:3 Changed 6 years ago by Wenduo Zhou

  • Status changed from assigned to verify
  • Resolution set to worksforme

There are more than 10K spectra that do not have detectors. Therefore, those spectra will be ignored by FilterEvents(). The number of events in those spectra will be shown in log. And it is exactly the difference between the number of events in original workspace and filtered workspace.

comment:4 Changed 6 years ago by Owen Arnold

  • Status changed from verify to verifying
  • Tester set to Owen Arnold

comment:5 Changed 6 years ago by Owen Arnold

Agreed. I loaded the new WISH IDF via #9980 and no events were lost.

There is however a strange situation which I don't understand. Modifying the duration in the script above does not change the number of events produced? Even when making the duration very small indeed, I never seem to be able to filter events?

comment:6 Changed 6 years ago by Owen Arnold

  • Status changed from verifying to closed

comment:7 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 10886

Note: See TracTickets for help on using tickets.