CropWorkspace

From MantidProject

Jump to: navigation, search

Contents

Summary

Extracts a 'block' from a workspace and places it in a new workspace.

Properties

Order Name Direction Type Default Description
1 InputWorkspace Input Workspace2D Mandatory The name of the input workspace.
2 OutputWorkspace Output Workspace2D Mandatory The name of the output workspace.
3 XMin Input double First X value in the spectrum The X value to start the cropped workspace at.
4 XMax Input double Last X value in the spectrum The X value to end the cropped workspace at.
5 StartWorkspaceIndex Input integer 0 The workspace index number to start the cropped workspace from.
6 EndWorkspaceIndex Input integer Workspace max The workspace index number to end the cropped workspace at.

Description

Extracts a 'block' from a workspace and places it in a new workspace (or, to look at it another way, lops bins or spectra off a workspace).

CropWorkspace works on workspaces with common X arrays/bin boundaries or on so-called ragged workspaces. If the input workspace must has common bin boundaries/X values then cropping in X will lead to an output workspace with fewer bins than the input one. If the boundaries are not common then the output workspace will have the same number of bins as the input one, but with data values outside the X range given set to zero.

If an X value given for XMin/XMax does not match a bin boundary (within a small tolerance to account for rounding errors), then the closest bin boundary within the range will be used. Note that if none of the optional properties are given, then the output workspace will be a copy of the input one.

Source Code

Header CropWorkspace.h

Source CropWorkspace.cpp

Personal tools
Create a book