Commit 5c7dbb0c by Joseph Ramsay

### Re #20726 Refactored up to FlatPlatePaalmanPingsCorrection

parent 604f9983
 ... ... @@ -208,11 +208,10 @@ Usage #apply the FFT algorithm - note output is point data outworkspace = FFT(InputWorkspace = ws, Transform = 'Backward') #print statements print "DataX(0)[1] equals DataX(0)[99]? : " + str((round(abs(outworkspace.dataX(0)[1]), 3)) == (round(outworkspace.dataX(0)[99], 3))) print "DataX(0)[10] equals DataX(0)[90]? : " + str((round(abs(outworkspace.dataX(0)[10]), 3)) == (round(outworkspace.dataX(0)[90], 3))) print "DataX((0)[50] equals 0? : " + str((round(abs(outworkspace.dataX(0)[50]), 3)) == 0) print "DataY(0)[40] equals DataY(0)[60]? : " + str((round(abs(outworkspace.dataY(0)[40]), 5)) == (round(outworkspace.dataY(0)[60], 5))) print("DataX(0)[1] equals DataX(0)[99]? : " + str((round(abs(outworkspace.dataX(0)[1]), 3)) == (round(outworkspace.dataX(0)[99], 3)))) print("DataX(0)[10] equals DataX(0)[90]? : " + str((round(abs(outworkspace.dataX(0)[10]), 3)) == (round(outworkspace.dataX(0)[90], 3)))) print("DataX((0)[50] equals 0? : " + str((round(abs(outworkspace.dataX(0)[50]), 3)) == 0)) print("DataY(0)[40] equals DataY(0)[60]? : " + str((round(abs(outworkspace.dataY(0)[40]), 5)) == (round(outworkspace.dataY(0)[60], 5)))) Output: ... ...
 ... ... @@ -23,9 +23,9 @@ Usage wsOrder2 = FFTDerivative(wsOriginal,Order=2) wsOrder3 = FFTDerivative(wsOriginal,Order=3) print "bin Orig 1st 2nd 3rd" print("bin Orig 1st 2nd 3rd") for i in range (41,67,5): print "%i %.2f %.2f %.2f %.2f" % (i, wsOriginal.readY(0)[i], wsOrder1.readY(0)[i], wsOrder2.readY(0)[i], wsOrder3.readY(0)[i]) print("{} {:.2f} {:.2f} {:.2f} {:.2f}".format(i, wsOriginal.readY(0)[i], wsOrder1.readY(0)[i], wsOrder2.readY(0)[i], wsOrder3.readY(0)[i])) .. figure:: /images/FFTDerivativeExample.png :align: right ... ... @@ -54,8 +54,8 @@ Output: wsOrder2Test = FFTDerivative(wsOrder1,Order=1) print "The direct 2nd order derivative and the derivative of a derivative should match" print CompareWorkspaces(wsOrder2,wsOrder2Test,CheckAllData=True,Tolerance=1e10)[0] print("The direct 2nd order derivative and the derivative of a derivative should match") print(CompareWorkspaces(wsOrder2,wsOrder2Test,CheckAllData=True,Tolerance=1e10)[0]) Output: ... ...
 ... ... @@ -46,9 +46,9 @@ Usage wsSmooth = FFTSmooth(ws, Params='2', Version=1) print "bin Orig Smoothed" print("bin Orig Smoothed") for i in range (0,100,10): print "%i %.2f %.2f" % (i, ws.readY(0)[i], wsSmooth.readY(0)[i]) print("{} {:.2f} {:.2f}".format(i, ws.readY(0)[i], wsSmooth.readY(0)[i])) .. figure:: /images/FFTSmoothZeroing.png ... ...
 ... ... @@ -68,7 +68,7 @@ Usage try: captureLive() except Exception, exc: print "Error occurred starting live data" print("Error occurred starting live data") finally: thread.join() # this must get hit ... ... @@ -77,7 +77,7 @@ Usage #get the ouput workspace wsOut = mtd["wsOut"] print "The workspace contains %i events" % wsOut.getNumberEvents() print("The workspace contains %i events" % wsOut.getNumberEvents()) Output: ... ...
 ... ... @@ -62,7 +62,7 @@ Usage try: captureLive() except Exception, exc: print "Error occurred starting live data" print("Error occurred starting live data") finally: thread.join() # this must get hit ... ... @@ -71,7 +71,7 @@ Usage #get the ouput workspace wsOut = mtd["wsOut"] print "The workspace contains %i histograms" % wsOut.getNumberHistograms() print("The workspace contains %i histograms" % wsOut.getNumberHistograms()) Output: ... ...
 ... ... @@ -33,8 +33,8 @@ Usage AddSampleLog(ws,"gd_prtn_chrg", "1e6", "Number") wsFiltered = FilterBadPulses(ws) print ("The number of events that remain: %i" % wsFiltered.getNumberEvents()) print ("compared to the number in the unfiltered workspace: %i" % ws.getNumberEvents()) print("The number of events that remain: %i" % wsFiltered.getNumberEvents()) print("compared to the number in the unfiltered workspace: %i" % ws.getNumberEvents()) Output: ... ...
 ... ... @@ -97,11 +97,11 @@ Usage AddTimeSeriesLog(ws, Name="proton_charge", Time="2010-01-01T00:40:00", Value=15) AddTimeSeriesLog(ws, Name="proton_charge", Time="2010-01-01T00:50:00", Value=100) print "The unfiltered workspace %s has %i events and a peak value of %.2f" % (ws, ws.getNumberEvents(),ws.readY(0)[50]) print("The unfiltered workspace {} has {} events and a peak value of {:.2f}".format(ws, ws.getNumberEvents(),ws.readY(0)[50])) wsOut = FilterByLogValue(ws,"proton_charge",MinimumValue=75, MaximumValue=150) print "The filtered workspace %s has %i events and a peak value of %.2f" % (wsOut, wsOut.getNumberEvents(),wsOut.readY(0)[50]) print("The filtered workspace {} has {} events and a peak value of {:.2f}".format(wsOut, wsOut.getNumberEvents(),wsOut.readY(0)[50])) Output: ... ...
 ... ... @@ -53,9 +53,9 @@ Usage AbsoluteStartTime="2010-01-01T00:10:00", AbsoluteStopTime="2010-01-01T00:20:00") print ("The number of events within the relative Filter: %i" % wsFiltered.getNumberEvents()) print ("The number of events within the Aboslute Filter: %i" % wsFilteredAbs.getNumberEvents()) print ("Compared to the number in the unfiltered workspace: %i" % ws.getNumberEvents()) print("The number of events within the relative Filter: %i" % wsFiltered.getNumberEvents()) print("The number of events within the Aboslute Filter: %i" % wsFilteredAbs.getNumberEvents()) print("Compared to the number in the unfiltered workspace: %i" % ws.getNumberEvents()) Output: ... ...
 ... ... @@ -26,9 +26,9 @@ Usage .. testcode:: ExFilterTofByMax ws = CreateSampleWorkspace("Event",BankPixelWidth=1) print "%i events before filtering" % ws.getNumberEvents() print("%i events before filtering" % ws.getNumberEvents()) wsOut = FilterByXValue(ws,XMax=15000) print "%i events after filtering" % wsOut.getNumberEvents() print("%i events after filtering" % wsOut.getNumberEvents()) Output: ... ... @@ -44,9 +44,9 @@ Output: ws = CreateSampleWorkspace("Event",BankPixelWidth=1) ws = ConvertUnits(ws,"Wavelength") print "%i events before filtering" % ws.getNumberEvents() print("%i events before filtering" % ws.getNumberEvents()) wsOut = FilterByXValue(ws,XMin=1,XMax=3) print "%i events after filtering" % wsOut.getNumberEvents() print("%i events after filtering" % wsOut.getNumberEvents()) Output: ... ...
 ... ... @@ -162,7 +162,7 @@ Usage wsnames = wsgroup.getNames() for name in sorted(wsnames): tmpws = mtd[name] print "workspace %s has %d events" % (name, tmpws.getNumberEvents()) print("workspace %s has %d events" % (name, tmpws.getNumberEvents())) Output: ... ... @@ -207,9 +207,9 @@ Output: wsnames = wsgroup.getNames() for name in sorted(wsnames): tmpws = mtd[name] print "workspace %s has %d events" % (name, tmpws.getNumberEvents()) print("workspace %s has %d events" % (name, tmpws.getNumberEvents())) split_log = tmpws.run().getProperty('splitter') print 'event splitter log: entry 0 and entry 1 are {0} and {1}.'.format(split_log.times[0], split_log.times[1]) print('event splitter log: entry 0 and entry 1 are {0} and {1}.'.format(split_log.times[0], split_log.times[1])) Output: ... ... @@ -251,7 +251,7 @@ Output: wsnames = wsgroup.getNames() for name in sorted(wsnames): tmpws = mtd[name] print "workspace %s has %d events" % (name, tmpws.getNumberEvents()) print("workspace %s has %d events" % (name, tmpws.getNumberEvents())) Output: ... ... @@ -290,7 +290,7 @@ Output: wsnames = wsgroup.getNames() for name in sorted(wsnames): tmpws = mtd[name] print "workspace %s has %d events" % (name, tmpws.getNumberEvents()) print("workspace %s has %d events" % (name, tmpws.getNumberEvents())) Output: ... ...
 ... ... @@ -40,26 +40,26 @@ Usage AddTimeSeriesLog(ws, Name="proton_charge", Time="2010-01-01T00:40:00", Value=15) AddTimeSeriesLog(ws, Name="proton_charge", Time="2010-01-01T00:50:00", Value=100) print ("Without a StartTime or EndTime all of the values are included") print("Without a StartTime or EndTime all of the values are included") (filtered_result,stat_result) = FilterLogByTime(ws,LogName="proton_charge") print ("The default statistic is mean: %i" % stat_result) print ("The filtered result is") print (filtered_result) print("The default statistic is mean: %i" % stat_result) print("The filtered result is") print(filtered_result) (filtered_result,stat_result) = FilterLogByTime(ws,LogName="proton_charge", Method="max") print ("The max is: %i" % stat_result) print("The max is: %i" % stat_result) (filtered_result,stat_result) = FilterLogByTime(ws,LogName="proton_charge", Method="min") print ("The min is: %i" % stat_result) print("The min is: %i" % stat_result) (filtered_result,stat_result) = FilterLogByTime(ws,LogName="proton_charge", Method="median") print ("The median is: %i" % stat_result) print print("The median is: %i" % stat_result) print("") print("Adding a start time and optionally an end time allows you to filter the values") (filtered_result,stat_result) = FilterLogByTime(ws,LogName="proton_charge", StartTime=580,EndTime = 1800) print ("The filtered mean is: %i" % stat_result) print ("The filtered result is") print (filtered_result) print("The filtered mean is: %i" % stat_result) print("The filtered result is") print(filtered_result) Output: ... ...
 ... ... @@ -43,17 +43,17 @@ Usage str_data=[0.4,5.0,0.001,0.0,0.0,0.0,0.0,0.0,1.0,1.0] ws.setY(20,np.array(str_data)) print "With no range will find very dead" print("With no range will find very dead") (wsOut,detList) = FindDeadDetectors(ws) print str(detList) print(detList) print "\nwith a lower range will find very dead and drop off" print("\nwith a lower range will find very dead and drop off") (wsOut,detList) = FindDeadDetectors(ws,RangeLower=8e3) print str(detList) print(detList) print "\nwith a lower range and upper range will find all three" print("\nwith a lower range and upper range will find all three") (wsOut,detList) = FindDeadDetectors(ws,RangeLower=8e3, rangeUpper=1.6e4) print str(detList) print(detList) Output: ... ...
 ... ... @@ -53,8 +53,8 @@ Usage no_detectors = FindDetectorsInShape(musr_inst_ws, narrow_cylinder) all_detectors = FindDetectorsInShape(musr_inst_ws, wide_cylinder) print "The narrow cylinder contains %i of the detectors." % len(no_detectors) print "The wide cylinder contains %i of the detectors." % len(all_detectors) print("The narrow cylinder contains %i of the detectors." % len(no_detectors)) print("The wide cylinder contains %i of the detectors." % len(all_detectors)) Output: ... ...