Diffractometer#

Diffractometers are built as a subclass of DiffractometerBase(), adding a variety of positioners as ophyd Components. In an instance of that subclass, user sets backend_solver by calling solver_factory(). In this call, the user specifies the solver, the geometry, and defines which Components (of the diffractometer) are to be used as pseudos and reals. The backend implements forward(), inverse(), and all related support, for only the pseudos and reals that are identified.

Parts of DiffractometerBase#

A DiffractometerBase object has several parts:

The DiffractometerBase() class should be a thin interface. Most real diffractometer capability should be provided in the Core() class (or one of its attributes, such as solver and sample)

Core-related methods and properties

forward(pseudos[, wavelength])

Compute real-space coordinates from pseudos (hkl -> angles).

inverse(reals[, wavelength])

Compute pseudo-space coordinates from reals (angles -> hkl).

position

Pseudo motor position namedtuple

pseudo_axis_names

Names of all the pseudo axes, in order of appearance.

real_axis_names

Names of all the real axes, in order of appearance.

wh([digits, full])

Concise report of the current diffractometer positions.

Sample-related methods and properties

add_reflection(pseudos[, reals, wavelength, ...])

Add a new reflection with this geometry to the selected sample.

add_sample(name, a[, b, c, alpha, beta, ...])

Add a new sample.

sample

Current sample object.

samples

Dictionary of samples.

Related methods and properties from other classes

assign_axes(pseudos, reals)

Designate attributes for use by the PseudoPositioner class.

extra_axis_names

Ordered list of any extra axis names (such as x, y, z).

lattice

Sample crystal lattice.

refine_lattice()

Refine the lattice parameters from 3 or more reflections.

refine_lattice(*reflections)

Return the sample lattice computed from 3 or more reflections.

reflections

Ordered dictionary of orientation reflections.

set_solver(name, geometry, **kwargs)

Create an instance of the backend Solver library and geometry.

U

Return the matrix, U, crystal orientation on the diffractometer.

UB

Return the crystal orientation matrix, UB.

See also

How to Work with a Diffractometer for step-by-step instructions on defining a diffractometer object and using it with the bluesky RunEngine.