Divide
From MantidProject
Contents |
Summary
The Divide algorithm will divide the data values and calculate the corresponding error values of two compatible workspaces.
Properties
| Order | Name | Direction | Type | Default | Description |
|---|---|---|---|---|---|
| 1 | LHSWorkspace | Input | Workspace | Mandatory | The first input workspace to use, this can be considered to be the workspace on the left hand side of the .
|
| 2 | RHSWorkspace | Input | Workspace | Mandatory | The second input workspace to use, this can be considered to be the workspace on the right hand side of the .
|
| 3 | OutputWorkspace | Output | Workspace | Mandatory | The name of the workspace to be created as the output of the algorithm. A workspace of this name will be created and stored in the Analysis Data Service. |
Description
The algorithm divide will divide the data and associated errors from any two compatible workspaces. Workspaces are compatible if:
- The sizes of the two workspaces are compatible (see below)
- If the two workspaces contain Y bins then the values in these must be identical
- the units of the axes match
- the distribution status/counts units match
Compatible Sizes
| Workspaces are compatible if they are identically sized in which case the values of each cell within each histogram are divided individually. The green arrows shows the order in which the data is divided. | |
| They are also compatible if they match the size dimension horizontally, in which case the same values are divided in each histogram in the workspace. | |
| If they match in size vertically then the data values will be divided in each bin of the histogram. |
Finally a workspace containing a single value is compatible to any workspace, in which case the same value will be divided uniformly for every bin in each histogram.
Usage
Python
Divide("w1","w2","output")
C++ Within an Algorithm
The usage of basic workspace mathematical operations has been specially simplified for use within algorithms
//w1 and w2 are workspaces workspace_sptr output = w1 / w2;
Source Code
Header Divide.h
Source Divide.cpp
.
