Table of Contents
Name | Direction | Type | Default | Description |
---|---|---|---|---|
PeaksWorkspace | InOut | PeaksWorkspace | Mandatory | A peaks workspace. |
RunWorkspace | Input | MatrixWorkspace | Mandatory | An input workspace containing the run information. |
TOF | Input | number | 0 | Peak position in time of flight. |
DetectorID | Input | number | 0 | ID of a detector at the peak centre. |
Height | Input | number | 0 | Height of the peak. |
BinCount | Input | number | 0 | Bin count. |
Adds a peak to a PeaksWorkspace.
Example - Add a peak to a PeaksWorkspace.
ws = CreateSampleWorkspace("Histogram","Multiple Peaks")
# Find the peaks in a 2D workspace.
peaks_ws = FindSXPeaks(ws)
print("The number of peaks before adding a peak is: {}".format(peaks_ws.getNumberPeaks()))
# Add a peak to the peaks workspace.
AddPeak(PeaksWorkspace=peaks_ws,RunWorkspace=ws,DetectorID=101,TOF=3819,Height=10.3,BinCount=2)
print("The number of peaks after adding a peak is: {}".format(peaks_ws.getNumberPeaks()))
Output:
The number of peaks before adding a peak is: 174
The number of peaks after adding a peak is: 175
Categories: AlgorithmIndex | Crystal\Peaks
C++ source: AddPeak.cpp (last modified: 2019-06-04)
C++ header: AddPeak.h (last modified: 2018-10-05)