CreatePeaksWorkspace v1

../_images/CreatePeaksWorkspace-v1_dlg.png

CreatePeaksWorkspace dialog.

Summary

Create an empty PeaksWorkspace.

Properties

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.

Description

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.

Usage

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

Source

C++ source: CreatePeaksWorkspace.cpp (last modified: 2017-05-26)

C++ header: CreatePeaksWorkspace.h (last modified: 2016-06-13)