Table of Contents
Name | Direction | Type | Default | Description |
---|---|---|---|---|
InstrumentWorkspace | Input | MatrixWorkspace | An optional input workspace containing the default instrument for peaks in this workspace. | |
NumberOfPeaks | Input | number | 1 | Number of dummy peaks to initially create. |
OutputWorkspace | Output | PeaksWorkspace | An output workspace. |
Create an empty PeaksWorkspace. Use LoadIsawPeaks v1 or FindPeaksMD v1 to create a peaks workspace with peaks.
This workspace can serve as a starting point for modifying the PeaksWorkspace, using the GUI or python scripting, for example.
Example: An empty table, not tied to an instrument
ws = CreatePeaksWorkspace()
print("Created a {} with {} rows".format(ws.id(), ws.rowCount()))
Output:
Created a PeaksWorkspace with 0 rows
Example: With a few peaks in place
sampleWs = CreateSampleWorkspace()
ws = CreatePeaksWorkspace(InstrumentWorkspace=sampleWs,NumberOfPeaks=3)
print("Created a {} with {} rows".format(ws.id(), ws.rowCount()))
Output:
Created a PeaksWorkspace with 3 rows
Categories: Algorithms | Crystal\Peaks | Utility\Workspaces
C++ source: CreatePeaksWorkspace.cpp (last modified: 2017-05-26)
C++ header: CreatePeaksWorkspace.h (last modified: 2016-06-13)