Module: engine#

Low-level support to Hkl computation engine support for diffractometers

CalcParameter(param, geometry, *args, **kwargs)

Like calc parameter but needs reference to a geometry object.

Engine(calc, engine, engine_list)

HKL calculation engine

Parameter(param[, units, name, inverted])

HKL library parameter object

Solution(engine, list_item, class_)

Solution of the conversion from (hkl) to axes.

class hkl.engine.CalcParameter(param, geometry, *args, **kwargs)[source]#

Like calc parameter but needs reference to a geometry object. Updates to the parameter should be propagated back to the geometry.

fit

True if the parameter can be fit or not

limits

Allowed range of values (low, high).

value

Position of this axis.

Parameters:
  • param (HklParameter)

  • geometry (Geometry object)

property fit#

True if the parameter can be fit or not

property limits#

Allowed range of values (low, high).

property value#

Position of this axis.

class hkl.engine.Engine(calc, engine, engine_list)[source]#

HKL calculation engine

engine

The calculation engine

mode

HKL calculation mode (see also HklCalc.modes)

name

Name of this engine.

parameters

List the names of the additional parameters.

parameters_values

List the values of the additional parameters.

pseudo_axes

[(name, value)].

pseudo_axis_names

List the names of the pseudo axes.

pseudo_positions

List the values of the pseudo positioners.

solutions

Allowed real solutions given the pseudo position.

units

The units used for calculations

update()

Calculate the pseudo axis positions from the real axis positions.

property _units#

The (internal) units used for calculations

property axes_c#

HKL real axis names (held constant during forward() computation).

property axes_r#

HKL real axis names (read-only).

property axes_w#

HKL real axis names (written by forward() computation).

property engine#

The calculation engine

property mode#

HKL calculation mode (see also HklCalc.modes)

property name#

Name of this engine.

property parameters#

List the names of the additional parameters.

property parameters_values#

List the values of the additional parameters.

property pseudo_axes#

[(name, value)].

Type:

List of pseudo axes as tuples

property pseudo_axis_names#

List the names of the pseudo axes.

property pseudo_positions#

List the values of the pseudo positioners.

property solutions#

Allowed real solutions given the pseudo position.

property units#

The units used for calculations

update()[source]#

Calculate the pseudo axis positions from the real axis positions.

class hkl.engine.Parameter(param, units='user', name=None, inverted=False)[source]#

HKL library parameter object

inverted

Is the value inverted internally?

hkl_parameter

The HKL library parameter object

units

Either user or default.

name

Name of this parameter.

value

Value used (in forward() method) if held constant by the mode.

user_units

A string representing the user unit type

default_units

A string representing the default unit type

limits

(low, high)

Example:

Parameter(
        name='None (internally: ux)',
        limits=(min=-180.0, max=180.0),
        value=0.0,
        fit=True,
        inverted=False,
        units='Degree')
property default_units#

A string representing the default unit type

property fit#

True if the parameter can be fit or not

property hkl_parameter#

The HKL library parameter object

property inverted#

Is the value inverted internally?

property limits#

(low, high)

property name#

Name of this parameter.

property units#

Either user or default.

property user_units#

A string representing the user unit type

property value#

Value used (in forward() method) if held constant by the mode.

class hkl.engine.Solution(engine, list_item, class_)[source]#

Solution of the conversion from (hkl) to axes.

axis_names

List real axis names of the solution.

positions

List real axis values of the solution.

select()

Select a solution.

units

property axis_names#

List real axis names of the solution.

property positions#

List real axis values of the solution.

select()[source]#

Select a solution.