\(\renewcommand\AA{\unicode{x212B}}\)

CalculatePeaksHKL v1

../_images/ImageNotFound.png

Enable screenshots using DOCS_SCREENSHOTS in CMake

Summary

Calculates Miller indices for each peak. No rounding or UB optimization.

See Also

AddPeak

Properties

Name

Direction

Type

Default

Description

PeaksWorkspace

InOut

IPeaksWorkspace

Mandatory

Input Peaks Workspace

OverWrite

Input

boolean

False

Overwrite existing miller indices as well as empty ones.

NumIndexed

Output

number

Gets set with the number of indexed peaks.

Description

Uses the UB matrix on the sample to calculate the Miller indices for all peaks in the peaks workspace. Unlike IndexPeaks v1 this algorithm does not perform any mandatory optimization. This algorithm does not round the Miller indices to the nearest integer.

Alternatives

IndexPeaks v1

Usage

Example - Calculate peak HKL values based on UB matrix

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)

# Set the UB to unity
SetUB(peaks, UB=[1,0,0,0,1,0,0,0,1])

# Run the algorithm
indexed = CalculatePeaksHKL(PeaksWorkspace=peaks, OverWrite=True)

print("Number of Indexed Peaks:  {}".format(indexed))

Output:

Number of Indexed Peaks:  1

Categories: AlgorithmIndex | Crystal\Peaks

Source

C++ header: CalculatePeaksHKL.h

C++ source: CalculatePeaksHKL.cpp