Solvers#
A Solver is a Python class that connects hklpy2 with a backend library providing diffractometer capabilities, including:
definition(s) of physical diffractometer geometries
axes (angles and reciprocal space)
operating modes for the axes
calculations that convert:
forward: reciprocal space coordinates into diffractometer angles
inverse: diffractometer angles into reciprocal space coordinates
support blocks include:
calculate the UB matrix
refine the crystal lattice
sample definition (name, lattice parameters, orientation reflections)
A Solver class is written as a plugin for hklpy2 and is connected by an
entry point
using the "hklpy2.solver" group.
Solvers provided with hklpy2:
Name |
Description |
|---|---|
|
Hkl/Soleil backend (Linux 64-bit only). Supports many geometry types. |
|
No-op solver for testing. Provides no useful geometries. |
|
Pure-Python minimal solver: \(\theta, 2\theta\) geometry with \(Q\) pseudo axis. Runs on any OS. |
define subclass of
DiffractometerBase()and create instancecreate instance of
Sample()create instance of
Lattice()create instance of
_WavelengthBase()subclasscreate instance of
SolverBase()subclassset
wavelengthlist available solvers: (
solvers())review saved orientation details
list available Solver
geometrieslist a Solver geometry’s required
pseudo_axis_names,real_axis_names,extra_axis_names,modescreate instance of
Reflection()determine the diffractometer
positionsave or restore orientation details
refine lattice parameters
See also
Solvers Guide for how to list, select, and instantiate solvers.
How to write a new Solver for how to write a new solver plugin.