HKL Utils

Auxilary HKL functions.

sampleChange([sample_key])

Change selected sample in hklpy.

sampleList()

List all samples currently defined in hklpy; specify current one.

list_reflections([all_samples])

Lists all reflections in defined in hklpy.

or_swap()

Swaps the two orientation reflections in hklpy.

setor0(*args)

Sets the primary orientation in hklpy.

setor1([delta, th, chi, phi, gamma, mu, h, k, l])

Sets the primary secondary in hklpy.

set_orienting()

Change the primary secondary orienting reflections to existing reflecitons in reflection list in hklpy.

list_orienting([all_samples])

Prints the two reflections used in the UB matrix.

or0([h, k, l])

Sets the primary orientation in hklpy using the current motor positions.

or1([h, k, l])

Sets the secondary orientation in hklpy using the current motor positions.

compute_UB()

Calculates the UB matrix.

calc_UB(r1, r2[, wavelength, output])

Compute the UB matrix with two reflections.

setmode([mode])

Set the mode of the currently selected diffractometer.

ca(h, k, l)

Calculate the motors position of a reflection.

br(h, k, l)

Move the motors to a reciprocal space point.

uan([delta, th])

Moves the delta and theta motors.

wh()

Retrieve information on the current reciprocal space position.

setlat([a, b, c, alpha, beta, gamma])

Set the lattice constants.

polartools.hkl_utils.br(h, k, l)[source]

Move the motors to a reciprocal space point.

Parameters:
h, k, lfloat

H, K, and L values.

Returns:
Generator for the bluesky Run Engine.
polartools.hkl_utils.ca(h, k, l)[source]

Calculate the motors position of a reflection.

Parameters:
h, k, lfloat

H, K, and L values.

polartools.hkl_utils.calc_UB(r1, r2, wavelength=None, output=False)[source]

Compute the UB matrix with two reflections.

Parameters:
r1, r2hklpy reflections

Orienting reflections from hklpy.

wavelengthfloat, optional

This is not used…

outputboolean

Toggle to decide whether to print the UB matrix.

polartools.hkl_utils.compute_UB()[source]

Calculates the UB matrix.

This fixes one issue with the hklpy calc_UB in that using wh() right after will not work, it needs to run one calculation first.

Parameters:
h, k, lfloat, optional

Values of H, K, L positions for current reflection. If None, it will ask for it.

polartools.hkl_utils.list_orienting(all_samples=False)[source]

Prints the two reflections used in the UB matrix.

WARNING: This function will only work with six circles. This will be fixed in future releases.

Parameters:
all_samplesboolean, optional

If True, it will print the reflections of all samples, if False, only of the current one.

polartools.hkl_utils.list_reflections(all_samples=False)[source]

Lists all reflections in defined in hklpy.

WARNING: This function will only work with six circles. This will be fixed in future releases.

Parameters:
all_samplesboolean, optional

If True, it will list the reflections for all samples, if False, only the current sample. Defaults to False.

polartools.hkl_utils.or0(h=None, k=None, l=None)[source]

Sets the primary orientation in hklpy using the current motor positions.

WARNING: This function will only work with six circles. This will be fixed in future releases.

Parameters:
h, k, lfloat, optional

Values of H, K, L positions for current reflection. If None, it will ask for it.

polartools.hkl_utils.or1(h=None, k=None, l=None)[source]

Sets the secondary orientation in hklpy using the current motor positions.

WARNING: This function will only work with six circles. This will be fixed in future releases.

Parameters:
h, k, lfloat, optional

Values of H, K, L positions for current reflection. If None, it will ask for it.

polartools.hkl_utils.or_swap()[source]

Swaps the two orientation reflections in hklpy.

polartools.hkl_utils.sampleChange(sample_key=None)[source]

Change selected sample in hklpy.

Parameters:
sample_keystring, optional

Name of the sample as set in hklpy. If None it will ask for which sample.

polartools.hkl_utils.sampleList()[source]

List all samples currently defined in hklpy; specify current one.

polartools.hkl_utils.set_orienting()[source]

Change the primary secondary orienting reflections to existing reflecitons in reflection list in hklpy.

WARNING: This function will only work with six circles. This will be fixed in future releases.

polartools.hkl_utils.setlat(a=None, b=None, c=None, alpha=None, beta=None, gamma=None)[source]

Set the lattice constants.

Parameters:
a, b, c, alpha, beta, gammafloat, optional

Lattice constants. If None, it will ask for input.

polartools.hkl_utils.setmode(mode=None)[source]

Set the mode of the currently selected diffractometer.

WARNING: This function will only work with six circles. This will be fixed in future releases.

Parameters:
modestring, optional

Mode to be selected. If None, it will ask.

polartools.hkl_utils.setor0(*args)[source]

Sets the primary orientation in hklpy.

WARNING: This function will only work with six circles. This will be fixed in future releases.

Parameters:
delta, th, chi, phi, gamma, mufloat, optional

Values of motor positions for current reflection. If None, it will ask for it.

h, k, lfloat, optional

Values of H, K, L positions for current reflection. If None, it will ask for it.

polartools.hkl_utils.setor1(delta=None, th=None, chi=None, phi=None, gamma=None, mu=None, h=None, k=None, l=None)[source]

Sets the primary secondary in hklpy.

WARNING: This function will only work with six circles. This will be fixed in future releases.

Parameters:
delta, th, chi, phi, gamma, mufloat, optional

Values of motor positions for current reflection. If None, it will ask for it.

h, k, lfloat, optional

Values of H, K, L positions for current reflection. If None, it will ask for it.

polartools.hkl_utils.uan(delta=None, th=None)[source]

Moves the delta and theta motors.

WARNING: This function will only work with six circles. This will be fixed in future releases.

Parameters:
delta, th: float, optional??

Delta and th motor angles to be moved to.

Returns:
Generator for the bluesky Run Engine.
polartools.hkl_utils.wh()[source]

Retrieve information on the current reciprocal space position.

WARNING: This function will only work with six circles. This will be fixed in future releases.