Table of Contents
Name | Direction | Type | Default | Description |
---|---|---|---|---|
InstrumentWorkspace | Input | Workspace | 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 | Mandatory | 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.
If the input workspace is a MDWorkspace then the instrument from the first experiment info is used.
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: AlgorithmIndex | Crystal\Peaks | Utility\Workspaces
C++ source: CreatePeaksWorkspace.cpp (last modified: 2019-06-04)
C++ header: CreatePeaksWorkspace.h (last modified: 2018-10-05)