CropWorkspaceForMDNorm v1

../_images/CropWorkspaceForMDNorm-v1_dlg.png

CropWorkspaceForMDNorm dialog.

Summary

Crops an event workspace and store the information about trajectories limits in the run object.

Properties

Name Direction Type Default Description
InputWorkspace Input IEventWorkspace Mandatory Input workspace. It has to be an event workspace with units of energy transfer or momentum
XMin Input number Mandatory Minimum energy transfer or momentum
XMax Input number Mandatory Maximum energy transfer or momentum
OutputWorkspace Output Workspace Mandatory Output workspace

Description

This algorithm is part of the new workflow for normalizing multi-dimensional event workspaces. It is intended to crop the input event workspace, and store the end of detector trajectories in either momentum (diffraction) or energy transfer (inelastic) units.

Example - CropWorkspaceForMDNorm

ws_in = CreateSampleWorkspace(WorkspaceType='Event',
                              Function='Flat background',
                              XUnit='Momentum',
                              XMax=10,
                              BinWidth=0.1)
ws_out = CropWorkspaceForMDNorm(InputWorkspace=ws_in,
                                XMin=1,
                                XMax=6)
print("Number of events in the original workspace {0}".format(ws_in.getNumberEvents()))
print("Number of events in the cropped workspace {0}".format(ws_out.getNumberEvents()))
print("Largest momentum in the output workspace {0}".format(round(ws_out.getSpectrum(1).getTofs().max())))
Number of events in the original workspace 200000
Number of events in the cropped workspace 100000
Largest momentum in the output workspace 6.0

Categories: AlgorithmIndex | Utility\Workspaces | MDAlgorithms\Normalisation

Source

Python: CropWorkspaceForMDNorm.py (last modified: 2019-01-25)