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

OptimizeLatticeForCellType v1

Summary

Optimize lattice parameters for cell type.

See Also

FindUBUsingFFT, FindUBUsingIndexedPeaks, FindUBUsingLatticeParameters

Properties

Name

Direction

Type

Default

Description

PeaksWorkspace

InOut

IPeaksWorkspace

Mandatory

An input PeaksWorkspace with an instrument.

CellType

Input

string

Cubic

Select the cell type. Allowed values: [‘Cubic’, ‘Tetragonal’, ‘Orthorhombic’, ‘Hexagonal’, ‘Rhombohedral’, ‘Monoclinic’, ‘Triclinic’]

Apply

Input

boolean

False

Re-index the peaks

PerRun

Input

boolean

False

Make per run orientation matrices

Tolerance

Input

number

0.12

Indexing Tolerance

EdgePixels

Input

number

0

Remove peaks that are at pixels this close to edge.

OutputChi2

Output

number

Returns the goodness of the fit

OutputDirectory

Input

string

.

The directory where the per run peaks files and orientation matrices will be written.

Description

This does a least squares fit between indexed peaks and Q values for a set of runs producing an overall leastSquare orientation matrix.

Get estimates of the standard deviations of the parameters, by approximating chisq by a quadratic polynomial through three points and finding the change in the parameter that would cause a change of 1 in chisq. (See Bevington, 2nd ed., pg 147, eqn: 8.13 ) In this version, we calculate a sequence of approximations for each parameter, with delta ranging over 10 orders of magnitude and keep the value in the sequence with the smallest relative change.

Usage

Example:

ws=LoadIsawPeaks("TOPAZ_3007.peaks")
FindUBUsingFFT(ws,MinD=8.0,MaxD=13.0)
print("Before Optimization:")
print(ws.sample().getOrientedLattice().getUB())
OptimizeLatticeForCellType(ws,CellType="Monoclinic")
print("\nAfter Optimization:")
print(ws.sample().getOrientedLattice().getUB())

Output:

Before Optimization:
[[ 0.01223576  0.00480107  0.08604016]
 [-0.11654506  0.00178069 -0.00458823]
 [-0.02737294 -0.08973552 -0.02525994]]

After Optimization:
[[-0.04519948  0.04084577 -0.01259083]
 [ 0.00160373 -0.00322317  0.11582993]
 [ 0.05743318  0.03223531  0.02753568]]

Categories: AlgorithmIndex | Crystal\Cell

Source

C++ header: OptimizeLatticeForCellType.h

C++ source: OptimizeLatticeForCellType.cpp