Quickstart#

Get started with a diffractometer object. For example, use the diffractometer creator() function to build a 6-circle diffractometer (E6C geometry). Use simulated motor axes.

1>>> import hklpy2
2>>> sixc = hklpy2.creator(name="sixc", geometry="E6C", solver="hkl_soleil")

Make it the default diffractometer and show its current settings:

1>>> from hklpy2.user import *
2>>> set_diffractometer(sixc)

Show its current settings (the brief report):

1>>> wh()  # wh: "WHere"
2h=0, k=0, l=0
3wavelength=1.0
4mu=0, omega=0, chi=0, phi=0, gamma=0, delta=0

Show the full report:

 1 >>> pa()  # pa: "Print All"
 2diffractometer='sixc'
 3HklSolver(name='hkl_soleil', version='5.1.2', geometry='E6C', engine_name='hkl', mode='bissector_vertical')
 4Sample(name='sample', lattice=Lattice(a=1, system='cubic'))
 5Orienting reflections: []
 6U=[[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]]
 7UB=[[6.28318530718, -0.0, -0.0], [0.0, 6.28318530718, -0.0], [0.0, 0.0, 6.28318530718]]
 8constraint: -180.0 <= mu <= 180.0
 9constraint: -180.0 <= omega <= 180.0
10constraint: -180.0 <= chi <= 180.0
11constraint: -180.0 <= phi <= 180.0
12constraint: -180.0 <= gamma <= 180.0
13constraint: -180.0 <= delta <= 180.0
14h=0, k=0, l=0
15wavelength=1.0
16mu=0, omega=0, chi=0, phi=0, gamma=0, delta=0

Calculate the angles for \(hkl=(1\ \bar{1}\ 0)\), using cahkl():

1>>> cahkl(1, -1, 0)
2Hklpy2DiffractometerRealPos(mu=0, omega=-45.000000066239, chi=44.999999876575, phi=-89.999999917768, gamma=0, delta=-90.000000132477)
3>>> wh()
4h=0, k=0, l=0
5wavelength=1.0
6mu=0, omega=0, chi=0, phi=0, gamma=0, delta=0

Note this was only a calculation. The motors did not move. Do that now.

1>>> sixc.move(1, -1, 0)
2MoveStatus(done=True, pos=sixc, elapsed=0.0, success=True, settle_time=0.0)
3>>> wh()
4h=1.0, k=-1.0, l=0
5wavelength=1.0
6mu=0, omega=-45.0, chi=45.0, phi=-90.0, gamma=0, delta=-90.0