Minus
From MantidProject
Contents |
Summary
The Minus algorithm will subtract the data values and calculate the corresponding error values for two compatible workspaces.
Properties
| Order | Name | Direction | Type | Default | Description |
|---|---|---|---|---|---|
| 1 | LHSWorkspace | Input | Workspace | Mandatory | The workspace to be subtracted from, this can be considered to be the workspace on the left hand side of the -. |
| 2 | RHSWorkspace | Input | Workspace | Mandatory | The workspace to be subtracted, 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 minus will subtract 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 subtracted individually. The green arrows shows the order in which the data is subtracted. | |
| They are also compatible if they match the size dimension horizontally, in which case the same values are subtracted from each histogram in the workspace. | |
| If they match in size vertically then the data values will be subtracted from 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 subtracted uniformly from every bin in each histogram.
Usage
Python
Minus("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 output = w1 - w2;
Source Code
Header Minus.h
Source Minus.cpp
