PeaksOnSurface v1

../_images/PeaksOnSurface-v1_dlg.png

PeaksOnSurface dialog.

Summary

Find peaks intersecting a single surface region.

Properties

Name Direction Type Default Description
InputWorkspace Input PeaksWorkspace 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.

Description

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.

Usage

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: AlgorithmIndex | Crystal\Peaks

Source

C++ source: PeaksOnSurface.cpp (last modified: 2019-06-05)

C++ header: PeaksOnSurface.h (last modified: 2018-10-05)