Table of Contents
Adds fake multi-dimensional event data to an existing MDEventWorkspace, for use in testing. You can create a blank MDEventWorkspace with CreateMDWorkspace.
Name | Direction | Type | Default | Description |
---|---|---|---|---|
InputWorkspace | InOut | MDEventWorkspace | Mandatory | An input workspace, that will get DataObjects added to it |
UniformParams | Input | dbl list | Add a uniform, randomized distribution of events. 1 parameter: number_of_events; they will be distributed across the size of the workspace. Depending on the sign of this parameter, the events are either distributed randomly around the box (Case 1, positive) or placed on the regular grid through the box (Case 2, negative) Treatment of Multiple parameters: depends on the Case Case 1: number_of_events, min,max (for each dimension); distribute the events inside the range given. Case 2: Additional parameters describe initial location and steps of the regular grid in each dimension | |
PeakParams | Input | dbl list | Add a peak with a normal distribution around a central point. Parameters: number_of_events, x, y, z, ..., radius. | |
RandomSeed | Input | number | 0 | Seed int for the random number generator. |
RandomizeSignal | Input | boolean | False | If true, the events’ signal and error values will be randomized around 1.0+-0.5. |
For testing MDEventWorkspaces, this algorithm either creates a uniform, random distribution of events, or generates regular events placed in boxes, or fills peaks around given points with a given number of events.
This algorithm can be run on a pre-existing MDEventWorkspace or a newly created one. All of the examples below will be done with newly created ones using CreateMDWorkspace.
2D Uniform Event Distribution Example
ws = CreateMDWorkspace(Dimensions='2', EventType='MDEvent', Extents='-10,10,-10,10',
Names='Q_lab_x,Q_lab_y', Units='A,B')
FakeMDEventData(ws, UniformParams="1000000")
print("Number of events = {}".format(ws.getNEvents()))
Output:
Number of events = 1000000
The output looks like the following in the SliceViewer:
3D Peaks Example
Creates 3 peaks in (H,K,L) at (0,0,0), (1,1,0) and (1,1,1).
ws = CreateMDWorkspace(Dimensions='3', Extents='-3,3,-3,3,-3,3', Names='h,k,l',
Units='rlu,rlu,rlu', SplitInto='4')
FakeMDEventData(ws, PeakParams='10000,1,1,1,0.1', RandomSeed='63759', RandomizeSignal='1')
FakeMDEventData(ws, PeakParams='100000,0,0,0,0.1', RandomSeed='63759', RandomizeSignal='1')
FakeMDEventData(ws, PeakParams='40000,1,1,0,0.1', RandomSeed='63759', RandomizeSignal='1')
print("Number of events = {}".format(ws.getNEvents()))
Output:
Number of events = 150000
The output looks like the following in the SliceViewer:
Running BinMD on the resulting workspace, the output looks like the following in the VSI:
4D Peaks Example
Creates a peak at (H,K,L) of (0,0,0) around T=5K.
ws = CreateMDWorkspace(Dimensions='4', Extents='-1,1,-1,1,-1,1,0,10', Names='H,K,L,T', Units='rlu,rlu,rlu,K',
SplitInto='2', SplitThreshold='50')
FakeMDEventData(ws, PeakParams='1e+06,0,0,0,5,0.2', RandomSeed='3873875')
print("Number of events = {}".format(ws.getNEvents()))
Output:
Number of events = 1000000
The output looks like the following in the SliceViewer when the T slider is moved to ~5K:
Running BinMD on the resulting workspace to create a 3D workspace with L integrated, the output looks like the following in the VSI:
Categories: Algorithms | MDAlgorithms\Creation
C++ source: FakeMDEventData.cpp (last modified: 2016-02-22)
C++ header: FakeMDEventData.h (last modified: 2016-02-12)