Table of Contents
Name | Direction | Type | Default | Description |
---|---|---|---|---|
InputWorkspace | Input | MatrixWorkspace | Mandatory | An input workspace. |
OutputWorkspace | Output | MatrixWorkspace | Mandatory | An output workspace. |
Axis1Binning | Input | dbl list | Mandatory | A comma separated list of first bin boundary, width, last bin boundary. Optionally this can be followed by a comma and more widths and last boundary pairs. Negative width values indicate logarithmic binning. |
Axis2Binning | Input | dbl list | Mandatory | A comma separated list of first bin boundary, width, last bin boundary. Optionally this can be followed by a comma and more widths and last boundary pairs. Negative width values indicate logarithmic binning. |
UseFractionalArea | Input | boolean | False | Flag to turn on the using the fractional area tracking RebinnedOutput workspace .Default is false. |
Transpose | Input | boolean | False | Run the Transpose algorithm on the resulting matrix. |
The bin parameters are used to form an output grid. A positive makes constant width bins, whilst negative ones create logarithmic binning using the formula . The overlap of the polygons formed from the old and new grids is tested to compute the required signal weight for the each of the new bins on the workspace, like in Rebin v1, and the errors are summed in quadrature, as:
where is the ratio of the overlap area of the new and old bin over the area of the old bin.
If the input workspace is not of type: RebinnedOutput, and the UseFractionalArea option is set to True, the algorithm will assume that the input fraction is unity. This is correct if this workspace has not been previously rebinned, but will give incorrect error (standard deviation) estimates if it has been rebinned.
The algorithms currently requires the second axis on the workspace to be a numerical axis so ConvertSpectrumAxis v2 may need to run first.
Example - A simple example using the fractional area
ws = CreateSampleWorkspace()
#Convert the Spectrum Axis to theta
wsc = ConvertSpectrumAxis(ws,"theta")
rb = Rebin2D(wsc,[0,100,20000],[0,0.01,1.2],UseFractionalArea=True)
print("Bins in the X axis: {}".format(rb.blocksize()))
print("Bins in the Y axis: {}".format(rb.getNumberHistograms()))
Output:
Bins in the X axis: 200
Bins in the Y axis: 120
Example - Transposing the Result
ws = CreateSampleWorkspace()
#Convert the Spectrum Axis to theta
wsc = ConvertSpectrumAxis(ws,"theta")
rb = Rebin2D(wsc,[0,100,20000],[0,0.01,1.2],Transpose=True)
print("Bins in the X axis: {}".format(rb.blocksize()))
print("Bins in the Y axis: {}".format(rb.getNumberHistograms()))
Output:
Bins in the X axis: 120
Bins in the Y axis: 200
Categories: AlgorithmIndex | Transforms\Rebin
C++ source: Rebin2D.cpp (last modified: 2019-07-17)
C++ header: Rebin2D.h (last modified: 2019-02-11)