IPeaksWorkspace

This a python binding to the C++ class Mantid::API::IPeaksWorkspace.

bases: mantid.api.ITableWorkspace, mantid.api.ExperimentInfo

class mantid.api.IPeaksWorkspace
__init__()

Raises an exception This class cannot be instantiated from Python

addColumn((ITableWorkspace)self, (str)type, (str)name) → bool :
Add a named column with the given type. Recognized types are: int,float,double,bool,str,V3D,long64
addColumn( (ITableWorkspace)self, (str)type, (str)name, (int)plottype) -> bool :
Add a named column with the given datatype (int,float,double,bool,str,V3D,long64) and plottype (0 = None, 1 = X, 2 = Y, 3 = Z, 4 = xErr, 5 = yErr, 6 = Label).
addPeak((IPeaksWorkspace)self, (IPeak)peak) → None :

Add a peak to the workspace

addRow((ITableWorkspace)self, (object)row_items_seq) → None :
Appends a row with the values from the given sequence. It it assumed that the items are in the correct order for the defined columns
addRow( (ITableWorkspace)self, (dict)row_items_dict) -> None :
Appends a row with the values from the dictionary
cell((ITableWorkspace)self, (object)value, (int)row_or_column) → object :

Return the given cell. If the first argument is a number then it is interpreted as a row otherwise it is interpreted as a column name

clone(*InputWorkspace, **Version=1)

Copies an existing workspace into a new one.

Property descriptions:

InputWorkspace(Input:req) Workspace Name of the input workspace. Must be a MatrixWorkspace (2D or EventWorkspace), a PeaksWorkspace or a MDEventWorkspace.

OutputWorkspace(Output:req) Workspace Name of the newly created cloned workspace.

column((ITableWorkspace)self, (object)column) → object :

Return all values of a specific column as a list

columnCount((ITableWorkspace)self) → int :

Returns the number of columns in the workspace

convertUnits(*InputWorkspace, Target, EMode=None, EFixed=None, AlignBins=None, ConvertFromPointData=None, **Version=1)

Performs a unit change on the X values of a workspace

Property descriptions:

InputWorkspace(Input:req) MatrixWorkspace Name of the input workspace

OutputWorkspace(Output:req) MatrixWorkspace Name of the output workspace, can be the same as the input

Target(Input:req) string The name of the units to convert to (must be one of those registered in the Unit Factory)[Degrees, DeltaE, DeltaE_inFrequency, DeltaE_inWavenumber, dSpacing, dSpacingPerpendicular, Empty, Energy, Energy_inWavenumber, Label, Momentum, MomentumTransfer, QSquared, SpinEchoLength, SpinEchoTime, Time, TOF, Wavelength]

EMode(Input) string The energy mode (default: elastic)[Elastic, Direct, Indirect]

EFixed(Input) number Value of fixed energy in meV : EI (EMode=Direct) or EF (EMode=Indirect) . Must be set if the target unit requires it (e.g. DeltaE)

AlignBins(Input) boolean If true (default is false), rebins after conversion to ensure that all spectra in the output workspace have identical bin boundaries. This option is not recommended (see http://www.mantidproject.org/ConvertUnits).

ConvertFromPointData(Input) boolean When checked, if the Input Workspace contains Points the algorithm ConvertToHistogram will be run to convert the Points to Bins. The Output Workspace will contains Bins.

createPeak((IPeaksWorkspace)self, (object)data) → IPeak :
Create a Peak and return it from its coordinates in the QLab frame
createPeak( (IPeaksWorkspace)self, (object)data, (float)detector_distance) -> IPeak :
Create a Peak and return it from its coordinates in the QLab frame, detector-sample distance explicitly provided
createPeakHKL((IPeaksWorkspace)self, (object)data) → IPeak :

Create a Peak and return it from its coordinates in the HKL frame

delete(*Workspace, **Version=1)

Removes a workspace from memory.

Property descriptions:

Workspace(Input:req) Workspace Name of the workspace to delete.

detectorInfo((ExperimentInfo)self) → DetectorInfo :

Return a const reference to the DetectorInfo object.

getColumnNames((ITableWorkspace)self) → numpy.ndarray :

Return a list of the column names

getComment((Workspace)self) → str :

Returns the comment field on the workspace

getEFixed((ExperimentInfo)self, (int)detId) → float
getEMode((ExperimentInfo)self) → DeltaEModeType :

Returns the energy mode.

getHistory((Workspace)self) → WorkspaceHistory :

Return read-only access to the workspace history

getInstrument((ExperimentInfo)self) → Instrument :

Returns the instrument for this run.

getInstrumentFilename((str)instrument[, (str)date='']) → str :

Returns IDF

getMemorySize((Workspace)self) → int :

Returns the memory footprint of the workspace in KB

getName((Workspace)self) → str :

Returns the name of the workspace. This could be an empty string

getNumberPeaks((IPeaksWorkspace)self) → int :

Returns the number of peaks within the workspace

getPeak((IPeaksWorkspace)self, (int)peak_num) → IPeak :

Returns a peak at the given index

getPlotType((ITableWorkspace)self, (object)column) → int :

Get the plot type of given column as an integer. Accepts column name or index. Possible return values: (0 = None, 1 = X, 2 = Y, 3 = Z, 4 = xErr, 5 = yErr, 6 = Label).

getRun((IPeaksWorkspace)self) → Run :

Return the Run object for this workspace

getRunNumber((ExperimentInfo)self) → int :

Returns the run identifier for this run.

getTitle((Workspace)self) → str :

Returns the title of the workspace

hasIntegratedPeaks((IPeaksWorkspace)self) → bool :

Determine if the peaks have been integrated

id((DataItem)self) → str :

The string ID of the class

isDirty((Workspace)self[, (int)n]) → bool :

True if the workspace has run more than n algorithms (Default=1)

keys((ITableWorkspace)self) → numpy.ndarray :

Return a list of the column names

maskDetectors(*Workspace, SpectraList=None, DetectorList=None, WorkspaceIndexList=None, MaskedWorkspace=None, ForceInstrumentMasking=None, StartWorkspaceIndex=None, EndWorkspaceIndex=None, ComponentList=None, **Version=1)

An algorithm to mask a detector, or set of detectors, as not to be used. The workspace spectra associated with those detectors are zeroed.

Property descriptions:

Workspace(InOut:req) Workspace The name of the input and output workspace on which to perform the algorithm.

SpectraList(Input) int list An ArrayProperty containing a list of spectra to mask

DetectorList(Input) int list An ArrayProperty containing a list of detector ID’s to mask

WorkspaceIndexList(Input) unsigned int list An ArrayProperty containing the workspace indices to mask

MaskedWorkspace(Input) MatrixWorkspace If given but not as a SpecialWorkspace2D, the masking from this workspace will be copied. If given as a SpecialWorkspace2D, the masking is read from its Y values.[]

ForceInstrumentMasking(Input) boolean Works when ‘MaskedWorkspace’ is provided and forces to use spectra-detector mapping even in case when number of spectra in ‘Workspace’ and ‘MaskedWorkspace’ are equal

StartWorkspaceIndex(Input) number If other masks fields are provided, it’s the first index of the target workspace to be allowed to be masked from by these masks, if not, its the first index of the target workspace to mask. Default value is 0 if other masking is present or ignored if not.

EndWorkspaceIndex(Input) number If other masks are provided, it’s the last index of the target workspace allowed to be masked to by these masks, if not, its the last index of the target workspace to mask. Default is number of histograms in target workspace if other masks are present or ignored if not.

ComponentList(Input) str list An ArrayProperty containing a list of component names to mask

mutableRun((ExperimentInfo)self) → Run :

Return a modifiable Run object.

mutableSample((ExperimentInfo)self) → Sample :

Return a modifiable Sample object.

name((DataItem)self) → str :

The name of the object

peakInfoNumber((IPeaksWorkspace)self, (V3D)qlab_frame, (bool)lab_coordinate) → int :

Peak info number at Q vector for this workspace

removeColumn((ITableWorkspace)self, (str)name) → None :

Remove the named column

removePeak((IPeaksWorkspace)self, (int)peak_num) → None :

Remove a peak from the workspace

row((ITableWorkspace)self, (int)row) → object :

Return all values of a specific row as a dict

rowCount((ITableWorkspace)self) → int :

Returns the number of rows within the workspace

run((ExperimentInfo)self) → Run :

Return the Run object. This cannot be modified, use mutableRun to modify.

sample((ExperimentInfo)self) → Sample :

Return the Sample object. This cannot be modified, use mutableSample to modify.

setCell((ITableWorkspace)self, (object)row_or_column, (int)column_or_row, (object)value) → None :

Sets the value of a given cell. If the first argument is a number then it is interpreted as a row otherwise it is interpreted as a column name

setComment((Workspace)self, (str)comment) → None :

Set the comment field of the workspace

setEFixed((ExperimentInfo)self, (int)detId, (float)value) → None
setPlotType((ITableWorkspace)self, (object)column, (int)ptype) → None :

Set the plot type of given column. Accepts column name or index. Possible type values: (0 = None, 1 = X, 2 = Y, 3 = Z, 4 = xErr, 5 = yErr, 6 = Label).

setRowCount((ITableWorkspace)self, (int)count) → None :

Resize the table to contain count rows

setTitle((Workspace)self, (str)title) → None :

Set the title of the workspace

threadSafe((DataItem)self) → bool :

Returns true if the object can be accessed safely from multiple threads