\(\renewcommand\AA{\unicode{x212B}}\)

SignalOverError v1

../_images/ImageNotFound.png

Enable screenshots using DOCS_SCREENSHOTS in CMake

Summary

Replace Y by Y/E for a MatrixWorkspace

Properties

Name

Direction

Type

Default

Description

InputWorkspace

Input

MatrixWorkspace

Mandatory

The name of the input workspace

OutputWorkspace

Output

MatrixWorkspace

Mandatory

The name to use for the output workspace (can be the same as the input one).

Description

Take a MatrixWorkspace as input, and replaces the Y values by Y/E (signal divided by error)

Usage

Example: Taking the derivative of logs

ws = CreateSampleWorkspace("Event")
wsOut = SignalOverError(ws)

print("Values from every 10th bin")
print("bin\tY\tE\tY_New")
for i in range (0,ws.blocksize(),10):
    print("{}\t{:.2f}\t{:.2f}\t{:.2f}".format(i,ws.readY(0)[i],ws.readE(0)[i],wsOut.readY(0)[i]))

Output:

Values from every 10th bin
bin     Y       E       Y_New
0       7.00   2.65    2.65
10      7.00   2.65    2.65
20      7.00   2.65    2.65
30      7.00   2.65    2.65
40      7.00   2.65    2.65
50      257.00 16.03   16.03
60      7.00   2.65    2.65
70      7.00   2.65    2.65
80      7.00   2.65    2.65
90      7.00   2.65    2.65

Categories: AlgorithmIndex | Arithmetic\Errors

Source

C++ header: SignalOverError.h

C++ source: SignalOverError.cpp