Table of Contents
Name | Direction | Type | Default | Description |
---|---|---|---|---|
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. |
Vertex1 | Input | dbl list | Mandatory | A comma separated list of cartesian coordinates for the lower left vertex of the surface. Values to be specified in the CoordinateFrame choosen. |
Vertex2 | Input | dbl list | Mandatory | A comma separated list of cartesian coordinates for the upper left vertex of the surface. Values to be specified in the CoordinateFrame choosen. |
Vertex3 | Input | dbl list | Mandatory | A comma separated list of cartesian coordinates for the upper right vertex of the surface. Values to be specified in the CoordinateFrame choosen. |
Vertex4 | Input | dbl list | Mandatory | A comma separated list of cartesian coordinates for the lower right vertex of the surface. Values to be specified in the CoordinateFrame choosen. |
Determine whether a peak intersects a surface. Similar to PeaksInRegion v1. The vertexes of the surface must be provided. The vertexes must be provided in clockwise ordering starting at the lower left.
Example - Peaks on and off a finite surface
# 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)
# Peak is on the plane
out_of_plane_offset = 0
tbl = PeaksOnSurface(InputWorkspace=peaks, PeakRadius=1.0, CoordinateFrame='HKL',
Vertex1=[1.0, -1.0, out_of_plane_offset], Vertex2=[-1.0,-1.0,out_of_plane_offset],
Vertex3=[-1.0, 1.0,out_of_plane_offset], Vertex4=[1.0, 1.0,out_of_plane_offset])
print("{{'Distance': {Distance}, 'PeakIndex': {PeakIndex}, 'Intersecting': {Intersecting}}}".format(**tbl.row(0)))
# Peak is off the plane, and does not intesect it
out_of_plane_offset = 1.000
tbl = PeaksOnSurface(InputWorkspace=peaks, PeakRadius=0.999, CoordinateFrame='HKL',
Vertex1=[1.0, -1.0, out_of_plane_offset], Vertex2=[-1.0,-1.0,out_of_plane_offset],
Vertex3=[-1.0, 1.0,out_of_plane_offset], Vertex4=[1.0, 1.0,out_of_plane_offset])
print("{{'Distance': {Distance}, 'PeakIndex': {PeakIndex}, 'Intersecting': {Intersecting}}}".format(**tbl.row(0)))
# Peak is off the plane, but does intesect it when radius is made larger
tbl = PeaksOnSurface(InputWorkspace=peaks, PeakRadius=1.000, CoordinateFrame='HKL',
Vertex1=[1.0, -1.0, out_of_plane_offset], Vertex2=[-1.0,-1.0,out_of_plane_offset],
Vertex3=[-1.0, 1.0,out_of_plane_offset], Vertex4=[1.0, 1.0,out_of_plane_offset])
print("{{'Distance': {Distance}, 'PeakIndex': {PeakIndex}, 'Intersecting': {Intersecting}}}".format(**tbl.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: PeaksOnSurface.cpp (last modified: 2016-06-15)
C++ header: PeaksOnSurface.h (last modified: 2016-06-15)