diff --git a/tests/cis_tests/proto_remove_events.py b/tests/cis_tests/proto_remove_events.py index 798485bd7..99d46e6d3 100644 --- a/tests/cis_tests/proto_remove_events.py +++ b/tests/cis_tests/proto_remove_events.py @@ -113,12 +113,12 @@ blanks[peakList.groupID] = [(0, peakList.peaks[0].minimum)] for i in range(len(peakList.peaks) - 1): blanks[peakList.groupID].append((peakList.peaks[i].maximum, peakList.peaks[i+1].minimum)) - blanks.append(peakList.peaks[-1].maximum, 10.0) + blanks[peakList.groupID].append((peakList.peaks[-1].maximum, 10.0)) groupDetectorIDs = access_pointer(GroupedDetectorIDs(focusWorkspace)) ConvertUnits( InputWorkspace=inputWorkspace, - OutputWorkpace=ref, + OutputWorkspace=ref, Target="dSpacing", ) @@ -136,13 +136,6 @@ ) # - -RemoveEventBackground( - InputWorkspace=inputWorkspace, - GroupingWorkspace=focusWorkspace, - OutputWorkspace=ref, - DetectorPeaks = create_pointer(detectorPeaks), -) ConvertUnits( InputWorkspace=ref, OutputWorkspace=ref, @@ -167,7 +160,6 @@ Xmax=10, ) - ### REMOVE EVENT BACKGROUND BY SMOOTHING ## ConvertUnits( @@ -186,11 +178,19 @@ DetectorPeaks = create_pointer(detectorPeaks), SmoothingParameter=0.5, ) -Minus( +ws = Divide( LHSWorkspace=total, RHSWorkspace=background, OutputWorkspace=peaks, ) +ws.setDistribution(False) +ReplaceSpecialValues( + InputWorkspace=peaks, + OutputWorkspace=peaks, + SmallNumberThreshold=0, + SmallNumberValue=0, + UseAbsolute=False, +) CrossCorrelate( InputWorkspace=peaks, OutputWorkspace="smoothing", @@ -203,4 +203,21 @@ OutputWorkspace="smoothing_offset", Xmin=-10, Xmax=10, -) \ No newline at end of file +) + +### PLOT PEAK RESULTS ################################# +fig, ax = plt.subplots(subplot_kw={'projection':'mantid'}) +ax.plot(mtd[total], wkspIndex=0, label="Total Data", normalize_by_bin_width=True) +ax.plot(mtd[ref], wkspIndex=0, label="Event Blanking", normalize_by_bin_width=True) +ax.plot(mtd[peaks], wkspIndex=0, label="Smoothing Subtraction", normalize_by_bin_width=True) +ax.legend() +fig.show() + + +### PLOT CC RESULTS ################################# +fig, ax = plt.subplots(subplot_kw={'projection':'mantid'}) +ax.plot(mtd["no_removal"], wkspIndex=0, label="Total Data", normalize_by_bin_width=True) +ax.plot(mtd["event_blank"], wkspIndex=0, label="Event Blanking", normalize_by_bin_width=True) +ax.plot(mtd["smoothing"], wkspIndex=0, label="Smoothing Subtraction", normalize_by_bin_width=True) +ax.legend() +fig.show() \ No newline at end of file