SPEC commands in hklpy2#

Make it easier for users (especially SPEC users) to learn and remember the tools in Bluesky’s hklpy2 package.

Quick Reference Table

SPEC

hklpy2

description

set_diffractometer()

Select the default diffractometer.

pa

pa()

Report (full) diffractometer settings. (pa: print all)

wh

wh()

Report (brief) diffractometer settings. (wh: where)

setmode

diffractometer.core.mode = "psi_constant

Set the diffractometer mode for the forward() computation.

diffractometer.core.modes

List all available diffractometer modes.

add_sample()

Define a new crystal sample.

setlat

lattice()

Update current sample lattice.

diffractometer.sample = "vibranium"

Pick a known sample to be the current selection.

diffractometer.samples

List all defined crystal samples.

or0

setor()

Define a crystal reflection and its motor positions.

or1

setor()

Define a crystal reflection and its motor positions.

or_swap

or_swap()

Exchange primary & secondary orientation reflections.

br h k l

diffractometer.move(h, k, l)

(command line) Move motors of diffractometer to the given \(h, k, l\).

br h k l

yield from bps.mv(diffractometer, (h, k, l))

(bluesky plan) Move motors of diffractometer to the given \(h, k, l\).

ca h k l

cahkl()

Prints calculated motor settings for the given \(h, k, l\).

reflex

refine_lattice()

Refinement of lattice parameters from list of 3 or more reflections

reflex_beg

not necessary

Initializes the reflections file

reflex_end

not necessary

Closes the reflections file

diffractometer.core.constraints

Show the current set of constraints.

cuts

diffractometer.core.constraints["chi"].cut_point = 0

Set the angle branch-cut (wrap point) for an axis; maps computed angles into the range from c up to (but not including) c + 360.

freeze

presets

Hold an axis constant during the diffractometer forward() computation.

unfreeze

presets

Remove a preset constant value for an axis.

calc_UB()

Compute the UB matrix with two reflections.

setaz h k l

extras

Set the azimuthal reference vector to the given \(h, k, l\).

setsector

diffractometer.core.constraints

Select a sector.

cz

OrthonormalZone

Calculate zone axis from two vectors.

mz

move_zone()

Move to a position in the zone.

pl

define_axis()

Set the scattering plane.

sz

OrthonormalZone

Set zone axis directly.