\(\renewcommand\AA{\unicode{x212B}}\)
RemovePromptPulse v1¶
Summary¶
Remove the prompt pulse for a time of flight measurement.
Properties¶
Name |
Direction |
Type |
Default |
Description |
---|---|---|---|---|
InputWorkspace |
Input |
Mandatory |
An input workspace. |
|
OutputWorkspace |
Output |
Mandatory |
An output workspace. |
|
Width |
Input |
number |
Optional |
The width of the time of flight (in microseconds) to remove from the data. |
Frequency |
Input |
number |
Optional |
The frequency of the source (in Hz) used to calculate the minimum time of flight to filter. |
TMin |
Input |
number |
Optional |
Minimum time of flight. Execution will be faster if this is specified, but the value will be determined from the workspace if not. |
TMax |
Input |
number |
Optional |
Minimum time of flight. Execution will be faster if this is specified, but the value will be determined from the workspace if not. |
Description¶
Remove the prompt pulse tor a time of flight measurement.
Specifying the Tmin
and Tmax
parameters can speed up performance of this algorithm with EventWorkspace.
These two parameters will only limit the possible locations of prompt pulses and are not used to crop the data to a range.
Usage¶
#Create a workspace
from numpy import *
x=arange(0,100000,10)
y=0*x+1
w=CreateWorkspace(x,y[1:],UnitX="TOF")
#apply algorithm
w1=RemovePromptPulse(w,Width=5000,Frequency=50)
#The prompt pulses at 50Hz are at 0, 2e4, 4e4, 6e4,8e4 microseconds
#do some checks
x=w1.dataX(0)
y=w1.dataY(0)
print("Y( {} ) = {:.1f}".format(x[100], y[100]))
print("Y( {} ) = {:.1f}".format(x[1000], y[1000]))
print("Y( {} ) = {:.1f}".format(x[4100], y[4100]))
print("Y( {} ) = {:.1f}".format(x[5000], y[5000]))
Output:
Y( 1000.0 ) = 0.0
Y( 10000.0 ) = 1.0
Y( 41000.0 ) = 0.0
Y( 50000.0 ) = 1.0
The spectra should look like
Categories: AlgorithmIndex | CorrectionFunctions\BackgroundCorrections
Source¶
C++ header: RemovePromptPulse.h
C++ source: RemovePromptPulse.cpp