hkl_soleil (HklSolver)#
Caution
work-in-progress
Backend: Hkl ("hkl_soleil"
)
Caution
The hkl_soleil
Solver is not available
for Windows or Mac OS. The underlying Hkl/Soleil support
library is only provided
for Linux 64-bit OS at this time.
Example:
>>> import hklpy2
>>> SolverClass = hklpy2.get_solver("hkl_soleil")
>>> libhkl_solver = SolverClass(geometry="E4CV")
>>> solver
HklSolver(name='hkl_soleil', version='v5.0.0.3434', geometry='E4CV', engine='hkl', mode='bissector')
|
|
- class hklpy2.backends.hkl_soleil.HklSolver(geometry: str, *, engine: str = 'hkl', mode: str = '', **kwargs)[source]#
Bases:
SolverBase
"hkl_soleil"
(Linux x86_64 only) Hkl/Soleil.Wraps the Hkl/Soleil library, written by Frédéric-Emmanuel PICCA (Soleil), with support for many common diffractometer geometries.
Parameters
geometry: (str) Name of geometry.
engine: (str) Name of computation engine. (default:
"hkl"
)mode: (str) Name of operating mode. (default: current mode)
pseudos: ([PseudoPositioner]) List of pseudo positioners. (default:
[]
)reals: ([PositionerBase]) List of real positioners. (default:
[]
)
Note
The lists of
pseudos
andreals
are the corresponding axes of the diffractometer, in the order expected by the Solver geometry. The diffractometer can use names that are different from the names expected by the engine here. TheOperator
class will convert between the two sets of names.Python Methods
addReflection
(reflection)Add coordinates of a diffraction condition (a reflection).
calculate_UB
(r1, r2)Calculate the UB (orientation) matrix with two reflections.
forward
(pseudos)Compute list of solutions(reals) from pseudos (hkl -> [angles]).
Ordered list of the geometry names.
inverse
(reals)Compute tuple of pseudos from reals (angles -> hkl).
refineLattice
(reflections)Refine the lattice parameters from a list of reflections.
Remove all reflections.
Python Properties
HKL real axis names.
HKL real axis names (read-only).
HKL real axis names.
Selected computational engine for this geometry.
Name of selected computational engine for this geometry.
List of the computational engines available in this geometry.
Ordered list of any extra parameter names (such as x, y, z).
Ordered dictionary of any extra parameters.
Name of selected diffractometer geometry.
Crystal lattice parameters.
Name of the current geometry operating mode.
List of the geometry operating modes.
Ordered list of the pseudo axis names (such as h, k, l).
Ordered list of the real axis names (such as th, tth).
Crystalline sample.
Orientation matrix (3x3).
Monochromatic wavelength.
- property U: list[list[float]]#
Relative orientation of crystal on diffractometer.
Rotation matrix, (3x3).
- addReflection(reflection: Reflection) None [source]#
Add coordinates of a diffraction condition (a reflection).
- calculate_UB(r1: Reflection, r2: Reflection) list[list[float]] [source]#
Calculate the UB (orientation) matrix with two reflections.
The method of Busing & Levy, Acta Cryst 22 (1967) 457.
- property engine: gi.repository.Hkl.Engine#
Selected computational engine for this geometry.
- property extra_axis_names: list[str]#
Ordered list of any extra parameter names (such as x, y, z).
Depends on selected geometry, engine, and mode.
- property extras: dict#
Ordered dictionary of any extra parameters.
Depends on selected geometry, engine, and mode.
- forward(pseudos: dict) list[dict[str, float]] [source]#
Compute list of solutions(reals) from pseudos (hkl -> [angles]).
- classmethod geometries() list[str] [source]#
Ordered list of the geometry names.
EXAMPLES:
>>> from hklpy2 import get_solver >>> Solver = get_solver("no_op") >>> Solver.geometries() [] >>> solver = Solver("TH TTH Q") >>> solver.geometries() []
- property geometry: str#
Name of selected diffractometer geometry.
Cannot be changed once solver is created. Instead, make a new solver for each geometry.
- inverse(reals: dict[str, float]) dict[str, float] [source]#
Compute tuple of pseudos from reals (angles -> hkl).
- property lattice: gi.repository.Hkl.Lattice#
Crystal lattice parameters. (Not used by this Solver.)
- name = 'hkl_soleil'#
Name of this Solver.
- refineLattice(reflections: list[Reflection]) Lattice [source]#
Refine the lattice parameters from a list of reflections.
hkl_soleil uses a simplex method.
- property sample: gi.repository.Hkl.Sample#
Crystalline sample. libhkl’s sample object.
- hklpy2.backends.hkl_soleil.hkl_euler_matrix(euler_x, euler_y, euler_z)[source]#
Convert into matrix form.