\(\renewcommand\AA{\unicode{x212B}}\)
SumNeighbours v1¶
![../_images/SumNeighbours-v1_dlg.png](../_images/SumNeighbours-v1_dlg.png)
SumNeighbours dialog.¶
Summary¶
Sum event lists from neighboring pixels in rectangular area detectors - e.g. to reduce the signal-to-noise of individual spectra. Each spectrum in the output workspace is a sum of a block of SumX*SumY pixels. Only works on EventWorkspaces and for instruments with RectangularDetector’s.
See Also¶
Properties¶
Name |
Direction |
Type |
Default |
Description |
---|---|---|---|---|
InputWorkspace |
Input |
Mandatory |
A workspace containing one or more rectangular area detectors. Each spectrum needs to correspond to only one pixelID (e.g. no grouping or previous calls to SumNeighbours). |
|
OutputWorkspace |
Output |
Mandatory |
The name of the workspace to be created as the output of the algorithm. |
|
SumX |
Input |
number |
4 |
The number of X (horizontal) pixels to sum together. This must evenly divide the number of X pixels in a detector. |
SumY |
Input |
number |
4 |
The number of Y (vertical) pixels to sum together. This must evenly divide the number of Y pixels in a detector |
Description¶
The algorithm looks through the Instrument to find all the RectangularDetectors defined. For each detector, the SumX*SumY neighboring event lists are summed together and saved in the output workspace as a single spectrum. Therefore, the output workspace will have 1/(SumX*SumY) * the original number of spectra.
Usage¶
Example:
ws = CreateSampleWorkspace(BankPixelWidth=10,NumBanks=2)
print("ws has %i spectra to begin with" % ws.getNumberHistograms())
wsOut = SumNeighbours(ws,5,5)
print("wsOut has only %i spectra after beimng summed into 5x5 blocks" % wsOut.getNumberHistograms())
Output:
ws has 200 spectra to begin with
wsOut has only 8 spectra after beimng summed into 5x5 blocks
Categories: AlgorithmIndex | Transforms\Grouping
Source¶
C++ header: SumNeighbours.h
C++ source: SumNeighbours.cpp