Table of Contents
Name | Direction | Type | Default | Description |
---|---|---|---|---|
CheckPeakExtents | Input | boolean | False | Include any peak in the region that has a shape extent extending into that region. |
InputWorkspace | Input | IPeaksWorkspace | Mandatory | An input peaks workspace. |
CoordinateFrame | Input | string | Mandatory | What coordinate system to use for intersection criteria? DetectorSpace: Real-space coordinates. Q (lab frame): Wave-vector change of the lattice in the lab frame. Q (sample frame): Momentum in the sample frame. HKL. Allowed values: [‘Detector space’, ‘Q (lab frame)’, ‘Q (sample frame)’, ‘HKL’] |
PeakRadius | Input | number | 0 | Effective peak radius in CoordinateFrame |
OutputWorkspace | Output | TableWorkspace | Mandatory | An output table workspace. Two columns. Peak index into input workspace, and boolean, where true is for positive intersection. |
Extents | Input | dbl list | -50,50 | A comma separated list of min, max for each dimension, specifying the extents of each dimension. Optional, default +-50 in each dimension. |
Determines which peaks intersect a defined box region in either QLab, QSample or HKL space. Similar to PeaksOnSurface v1.
Example - Peaks inside and outside of a defined region
# Load an MDEventWorkspace (QLab) containing some SC diffration peaks
mdew = Load("TOPAZ_3680_5_sec_MDEW.nxs")
# Find some peaks. These are all unindexed so will have HKL = [0,0,0]
peaks = FindPeaksMD(InputWorkspace=mdew, MaxPeaks=1)
# Find peaks in region when the Peak sits in the centre of a box
in_box_table = PeaksInRegion(peaks, CoordinateFrame='HKL', PeakRadius=0.1, Extents=[-1.0,1.0,-1.0,1.0,-1.0,1.0], CheckPeakExtents=True)
print("{{'Distance': {Distance}, 'PeakIndex': {PeakIndex}, 'Intersecting': {Intersecting}}}".format(**in_box_table.row(0)))
# Find peaks in region when the peak is just outside the box (by radius)
just_outside_box_table = PeaksInRegion(peaks, CoordinateFrame='HKL', PeakRadius=0.999, Extents=[1.0,2.0,-1.0,1.0,-1.0,1.0], CheckPeakExtents=True)
print("{{'Distance': {Distance}, 'PeakIndex': {PeakIndex}, 'Intersecting': {Intersecting}}}".format(**just_outside_box_table.row(0)))
# Find peaks in region when the peak is just inside the box (by radius)
just_intersecting_box_table = PeaksInRegion(peaks, CoordinateFrame='HKL', PeakRadius=1.00, Extents=[1.0,2.0,-1.0,1.0,-1.0,1.0], CheckPeakExtents=True)
print("{{'Distance': {Distance}, 'PeakIndex': {PeakIndex}, 'Intersecting': {Intersecting}}}".format(**just_intersecting_box_table.row(0)))
Output:
{'Distance': 0.0, 'PeakIndex': 0, 'Intersecting': True}
{'Distance': -1.0, 'PeakIndex': 0, 'Intersecting': False}
{'Distance': -1.0, 'PeakIndex': 0, 'Intersecting': True}
Categories: Algorithms | Crystal\Peaks
C++ source: PeaksInRegion.cpp (last modified: 2016-06-15)
C++ header: PeaksInRegion.h (last modified: 2016-06-15)