\(\renewcommand\AA{\unicode{x212B}}\)
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++ header: CreatePeaksWorkspace.h (last modified: 2020-03-20)
C++ source: CreatePeaksWorkspace.cpp (last modified: 2020-04-07)