SumNeighbours v1

../_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.

Properties

Name Direction Type Default Description
InputWorkspace Input MatrixWorkspace 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 MatrixWorkspace 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++ source: SumNeighbours.cpp (last modified: 2019-06-05)

C++ header: SumNeighbours.h (last modified: 2018-10-05)