hkl

Macro library containning diffractometer related macros for the macros server Tango device server as part of the Sardana project.

class addreflection(*args, **kwargs)[source]

Add reflection at the botton of reflections list

param_def = [['H', 'Float', None, 'H value'], ['K', 'Float', None, 'K value'], ['L', 'Float', None, 'L value'], ['affinement', 'Float', -999.0, 'Affinement']]

This property holds the macro parameter description. It consists of a sequence of parameter information objects. A parameter information object is either:

  1. a simple parameter object

  2. a parameter repetition object

A simple parameter object is a sequence of:

  1. a string representing the parameter name

  2. a member of Macro.Type representing the parameter data type

  3. a default value for the parameter or None if there is no default value

  4. a string with the parameter description

Example:

param_def = ( ('value', Type.Float, None, 'a float parameter' ) )

A parameter repetition object is a sequence of:

  1. a string representing the parameter repetition name

  2. a sequence of parameter information objects

  3. a dictionary representing the parameter repetition semantics or None to use the default parameter repetition semantics. Dictionary keys are:

    • min - integer representing minimum number of repetitions or None for no minimum.

    • max - integer representing maximum number of repetitions or None for no maximum.

    Default parameter repetition semantics is { 'min': 1, 'max' : None } (in other words, “at least one repetition” semantics)

Example:

param_def = (
    ( 'motor_list', ( ( 'motor', Type.Motor, None, 'motor name') ), None, 'List of motors')
)
prepare(H, K, L, affinement)[source]

Macro API. Prepare phase. Overwrite as necessary. Default implementation does nothing

run(H, K, L, affinement)[source]

Macro API. Runs the macro. Overwrite MANDATORY! Default implementation raises RuntimeError.

Raises:

RuntimeError

class affine(*args, **kwargs)[source]

Affine current crystal. Fine tunning of lattice parameters and UB matrix based on current crystal reflections. Reflections with affinement set to 0 are not used. A new crystal with the post fix (affine) is created and set as current crystal

prepare()[source]

Macro API. Prepare phase. Overwrite as necessary. Default implementation does nothing

run()[source]

Macro API. Runs the macro. Overwrite MANDATORY! Default implementation raises RuntimeError.

Raises:

RuntimeError

class br(*args, **kwargs)[source]

Move the diffractometer to the reciprocal space coordinates given by H, K and L. If a fourth parameter is given, the combination of angles to be set is the correspondig to the given index. The index of the angles combinations are then changed.

hints = {'allowsHooks': ('pre-move', 'post-move')}

Hints to give a client to perform special tasks. Example: scan macros give hints on the types of hooks they support. A GUI can use this information to allow a scan to have sub-macros executed as hooks.

param_def = [['H', 'String', None, 'H value'], ['K', 'String', None, 'K value'], ['L', 'String', None, 'L value'], ['AnglesIndex', 'Integer', -1, 'Angles index'], ['FlagNotBlocking', 'Integer', 0, 'If 1 not block. Return without finish movement'], ['FlagPrinting', 'Integer', 0, 'If 1 printing. Used by ubr']]

This property holds the macro parameter description. It consists of a sequence of parameter information objects. A parameter information object is either:

  1. a simple parameter object

  2. a parameter repetition object

A simple parameter object is a sequence of:

  1. a string representing the parameter name

  2. a member of Macro.Type representing the parameter data type

  3. a default value for the parameter or None if there is no default value

  4. a string with the parameter description

Example:

param_def = ( ('value', Type.Float, None, 'a float parameter' ) )

A parameter repetition object is a sequence of:

  1. a string representing the parameter repetition name

  2. a sequence of parameter information objects

  3. a dictionary representing the parameter repetition semantics or None to use the default parameter repetition semantics. Dictionary keys are:

    • min - integer representing minimum number of repetitions or None for no minimum.

    • max - integer representing maximum number of repetitions or None for no maximum.

    Default parameter repetition semantics is { 'min': 1, 'max' : None } (in other words, “at least one repetition” semantics)

Example:

param_def = (
    ( 'motor_list', ( ( 'motor', Type.Motor, None, 'motor name') ), None, 'List of motors')
)
prepare(H, K, L, AnglesIndex, FlagNotBlocking, FlagPrinting)[source]

Macro API. Prepare phase. Overwrite as necessary. Default implementation does nothing

run(H, K, L, AnglesIndex, FlagNotBlocking, FlagPrinting)[source]

Macro API. Runs the macro. Overwrite MANDATORY! Default implementation raises RuntimeError.

Raises:

RuntimeError

class ca(*args, **kwargs)[source]

Calculate motor positions for given H K L according to the current operation mode (trajectory 0).

param_def = [['H', 'Float', None, 'H value for the azimutal vector'], ['K', 'Float', None, 'K value for the azimutal vector'], ['L', 'Float', None, 'L value for the azimutal vector']]

This property holds the macro parameter description. It consists of a sequence of parameter information objects. A parameter information object is either:

  1. a simple parameter object

  2. a parameter repetition object

A simple parameter object is a sequence of:

  1. a string representing the parameter name

  2. a member of Macro.Type representing the parameter data type

  3. a default value for the parameter or None if there is no default value

  4. a string with the parameter description

Example:

param_def = ( ('value', Type.Float, None, 'a float parameter' ) )

A parameter repetition object is a sequence of:

  1. a string representing the parameter repetition name

  2. a sequence of parameter information objects

  3. a dictionary representing the parameter repetition semantics or None to use the default parameter repetition semantics. Dictionary keys are:

    • min - integer representing minimum number of repetitions or None for no minimum.

    • max - integer representing maximum number of repetitions or None for no maximum.

    Default parameter repetition semantics is { 'min': 1, 'max' : None } (in other words, “at least one repetition” semantics)

Example:

param_def = (
    ( 'motor_list', ( ( 'motor', Type.Motor, None, 'motor name') ), None, 'List of motors')
)
prepare(H, K, L)[source]

Macro API. Prepare phase. Overwrite as necessary. Default implementation does nothing

run(H, K, L)[source]

Macro API. Runs the macro. Overwrite MANDATORY! Default implementation raises RuntimeError.

Raises:

RuntimeError

class caa(*args, **kwargs)[source]

Calculate motor positions for given H K L according to the current operation mode (all trajectories)

param_def = [['H', 'Float', None, 'H value for the azimutal vector'], ['K', 'Float', None, 'K value for the azimutal vector'], ['L', 'Float', None, 'L value for the azimutal vector']]

This property holds the macro parameter description. It consists of a sequence of parameter information objects. A parameter information object is either:

  1. a simple parameter object

  2. a parameter repetition object

A simple parameter object is a sequence of:

  1. a string representing the parameter name

  2. a member of Macro.Type representing the parameter data type

  3. a default value for the parameter or None if there is no default value

  4. a string with the parameter description

Example:

param_def = ( ('value', Type.Float, None, 'a float parameter' ) )

A parameter repetition object is a sequence of:

  1. a string representing the parameter repetition name

  2. a sequence of parameter information objects

  3. a dictionary representing the parameter repetition semantics or None to use the default parameter repetition semantics. Dictionary keys are:

    • min - integer representing minimum number of repetitions or None for no minimum.

    • max - integer representing maximum number of repetitions or None for no maximum.

    Default parameter repetition semantics is { 'min': 1, 'max' : None } (in other words, “at least one repetition” semantics)

Example:

param_def = (
    ( 'motor_list', ( ( 'motor', Type.Motor, None, 'motor name') ), None, 'List of motors')
)
prepare(H, K, L)[source]

Macro API. Prepare phase. Overwrite as necessary. Default implementation does nothing

run(H, K, L)[source]

Macro API. Runs the macro. Overwrite MANDATORY! Default implementation raises RuntimeError.

Raises:

RuntimeError

class ci(*args, **kwargs)[source]

Calculate hkl for given angle values

param_def = [['mu', 'Float', None, 'Mu value'], ['theta', 'Float', None, 'Theta value'], ['chi', 'Float', None, 'Chi value'], ['phi', 'Float', None, 'Phi value'], ['gamma', 'Float', -999, 'Gamma value'], ['delta', 'Float', -999, 'Delta value'], ['omega_t', 'Float', -999, 'Omega_t value']]

This property holds the macro parameter description. It consists of a sequence of parameter information objects. A parameter information object is either:

  1. a simple parameter object

  2. a parameter repetition object

A simple parameter object is a sequence of:

  1. a string representing the parameter name

  2. a member of Macro.Type representing the parameter data type

  3. a default value for the parameter or None if there is no default value

  4. a string with the parameter description

Example:

param_def = ( ('value', Type.Float, None, 'a float parameter' ) )

A parameter repetition object is a sequence of:

  1. a string representing the parameter repetition name

  2. a sequence of parameter information objects

  3. a dictionary representing the parameter repetition semantics or None to use the default parameter repetition semantics. Dictionary keys are:

    • min - integer representing minimum number of repetitions or None for no minimum.

    • max - integer representing maximum number of repetitions or None for no maximum.

    Default parameter repetition semantics is { 'min': 1, 'max' : None } (in other words, “at least one repetition” semantics)

Example:

param_def = (
    ( 'motor_list', ( ( 'motor', Type.Motor, None, 'motor name') ), None, 'List of motors')
)
prepare(mu, theta, chi, phi, gamma, delta, omega_t)[source]

Macro API. Prepare phase. Overwrite as necessary. Default implementation does nothing

run(mu, theta, chi, phi, gamma, delta, omega_t)[source]

Macro API. Runs the macro. Overwrite MANDATORY! Default implementation raises RuntimeError.

Raises:

RuntimeError

class computeub(*args, **kwargs)[source]

Compute UB matrix with reflections 0 and 1

prepare()[source]

Macro API. Prepare phase. Overwrite as necessary. Default implementation does nothing

run()[source]

Macro API. Runs the macro. Overwrite MANDATORY! Default implementation raises RuntimeError.

Raises:

RuntimeError

class freeze(*args, **kwargs)[source]

Set psi value for psi constant modes

param_def = [['parameter', 'String', None, 'Parameter to freeze'], ['value', 'Float', None, 'Value to be frozen']]

This property holds the macro parameter description. It consists of a sequence of parameter information objects. A parameter information object is either:

  1. a simple parameter object

  2. a parameter repetition object

A simple parameter object is a sequence of:

  1. a string representing the parameter name

  2. a member of Macro.Type representing the parameter data type

  3. a default value for the parameter or None if there is no default value

  4. a string with the parameter description

Example:

param_def = ( ('value', Type.Float, None, 'a float parameter' ) )

A parameter repetition object is a sequence of:

  1. a string representing the parameter repetition name

  2. a sequence of parameter information objects

  3. a dictionary representing the parameter repetition semantics or None to use the default parameter repetition semantics. Dictionary keys are:

    • min - integer representing minimum number of repetitions or None for no minimum.

    • max - integer representing maximum number of repetitions or None for no maximum.

    Default parameter repetition semantics is { 'min': 1, 'max' : None } (in other words, “at least one repetition” semantics)

Example:

param_def = (
    ( 'motor_list', ( ( 'motor', Type.Motor, None, 'motor name') ), None, 'List of motors')
)
prepare(parameter, value)[source]

Macro API. Prepare phase. Overwrite as necessary. Default implementation does nothing

run(parameter, value)[source]

Macro API. Runs the macro. Overwrite MANDATORY! Default implementation raises RuntimeError.

Raises:

RuntimeError

class getmode(*args, **kwargs)[source]

Get operation mode.

prepare()[source]

Macro API. Prepare phase. Overwrite as necessary. Default implementation does nothing

run()[source]

Macro API. Runs the macro. Overwrite MANDATORY! Default implementation raises RuntimeError.

Raises:

RuntimeError

class hklscan(*args, **kwargs)[source]

Scan h k l axes

param_def = [['h_start_pos', 'Float', None, 'Scan h start position'], ['h_final_pos', 'Float', None, 'Scan h final position'], ['k_start_pos', 'Float', None, 'Scan k start position'], ['k_final_pos', 'Float', None, 'Scan k final position'], ['l_start_pos', 'Float', None, 'Scan l start position'], ['l_final_pos', 'Float', None, 'Scan l final position'], ['nr_interv', 'Integer', None, 'Number of scan intervals'], ['integ_time', 'Float', None, 'Integration time']]

This property holds the macro parameter description. It consists of a sequence of parameter information objects. A parameter information object is either:

  1. a simple parameter object

  2. a parameter repetition object

A simple parameter object is a sequence of:

  1. a string representing the parameter name

  2. a member of Macro.Type representing the parameter data type

  3. a default value for the parameter or None if there is no default value

  4. a string with the parameter description

Example:

param_def = ( ('value', Type.Float, None, 'a float parameter' ) )

A parameter repetition object is a sequence of:

  1. a string representing the parameter repetition name

  2. a sequence of parameter information objects

  3. a dictionary representing the parameter repetition semantics or None to use the default parameter repetition semantics. Dictionary keys are:

    • min - integer representing minimum number of repetitions or None for no minimum.

    • max - integer representing maximum number of repetitions or None for no maximum.

    Default parameter repetition semantics is { 'min': 1, 'max' : None } (in other words, “at least one repetition” semantics)

Example:

param_def = (
    ( 'motor_list', ( ( 'motor', Type.Motor, None, 'motor name') ), None, 'List of motors')
)
prepare(h_start_pos, h_final_pos, k_start_pos, k_final_pos, l_start_pos, l_final_pos, nr_interv, integ_time)[source]

Macro API. Prepare phase. Overwrite as necessary. Default implementation does nothing

class hscan(*args, **kwargs)[source]

Scan h axis

param_def = [['start_pos', 'Float', None, 'Scan start position'], ['final_pos', 'Float', None, 'Scan final position'], ['nr_interv', 'Integer', None, 'Number of scan intervals'], ['integ_time', 'Float', None, 'Integration time']]

This property holds the macro parameter description. It consists of a sequence of parameter information objects. A parameter information object is either:

  1. a simple parameter object

  2. a parameter repetition object

A simple parameter object is a sequence of:

  1. a string representing the parameter name

  2. a member of Macro.Type representing the parameter data type

  3. a default value for the parameter or None if there is no default value

  4. a string with the parameter description

Example:

param_def = ( ('value', Type.Float, None, 'a float parameter' ) )

A parameter repetition object is a sequence of:

  1. a string representing the parameter repetition name

  2. a sequence of parameter information objects

  3. a dictionary representing the parameter repetition semantics or None to use the default parameter repetition semantics. Dictionary keys are:

    • min - integer representing minimum number of repetitions or None for no minimum.

    • max - integer representing maximum number of repetitions or None for no maximum.

    Default parameter repetition semantics is { 'min': 1, 'max' : None } (in other words, “at least one repetition” semantics)

Example:

param_def = (
    ( 'motor_list', ( ( 'motor', Type.Motor, None, 'motor name') ), None, 'List of motors')
)
prepare(start_pos, final_pos, nr_interv, integ_time)[source]

Macro API. Prepare phase. Overwrite as necessary. Default implementation does nothing

class kscan(*args, **kwargs)[source]

Scan k axis

param_def = [['start_pos', 'Float', None, 'Scan start position'], ['final_pos', 'Float', None, 'Scan final position'], ['nr_interv', 'Integer', None, 'Number of scan intervals'], ['integ_time', 'Float', None, 'Integration time']]

This property holds the macro parameter description. It consists of a sequence of parameter information objects. A parameter information object is either:

  1. a simple parameter object

  2. a parameter repetition object

A simple parameter object is a sequence of:

  1. a string representing the parameter name

  2. a member of Macro.Type representing the parameter data type

  3. a default value for the parameter or None if there is no default value

  4. a string with the parameter description

Example:

param_def = ( ('value', Type.Float, None, 'a float parameter' ) )

A parameter repetition object is a sequence of:

  1. a string representing the parameter repetition name

  2. a sequence of parameter information objects

  3. a dictionary representing the parameter repetition semantics or None to use the default parameter repetition semantics. Dictionary keys are:

    • min - integer representing minimum number of repetitions or None for no minimum.

    • max - integer representing maximum number of repetitions or None for no maximum.

    Default parameter repetition semantics is { 'min': 1, 'max' : None } (in other words, “at least one repetition” semantics)

Example:

param_def = (
    ( 'motor_list', ( ( 'motor', Type.Motor, None, 'motor name') ), None, 'List of motors')
)
prepare(start_pos, final_pos, nr_interv, integ_time)[source]

Macro API. Prepare phase. Overwrite as necessary. Default implementation does nothing

class latticecal(*args, **kwargs)[source]

Calibrate lattice parameters a, b or c to current 2theta value

param_def = [['parameter', 'String', '', 'Parameter']]

This property holds the macro parameter description. It consists of a sequence of parameter information objects. A parameter information object is either:

  1. a simple parameter object

  2. a parameter repetition object

A simple parameter object is a sequence of:

  1. a string representing the parameter name

  2. a member of Macro.Type representing the parameter data type

  3. a default value for the parameter or None if there is no default value

  4. a string with the parameter description

Example:

param_def = ( ('value', Type.Float, None, 'a float parameter' ) )

A parameter repetition object is a sequence of:

  1. a string representing the parameter repetition name

  2. a sequence of parameter information objects

  3. a dictionary representing the parameter repetition semantics or None to use the default parameter repetition semantics. Dictionary keys are:

    • min - integer representing minimum number of repetitions or None for no minimum.

    • max - integer representing maximum number of repetitions or None for no maximum.

    Default parameter repetition semantics is { 'min': 1, 'max' : None } (in other words, “at least one repetition” semantics)

Example:

param_def = (
    ( 'motor_list', ( ( 'motor', Type.Motor, None, 'motor name') ), None, 'List of motors')
)
prepare(parameter)[source]

Macro API. Prepare phase. Overwrite as necessary. Default implementation does nothing

run(parameter)[source]

Macro API. Runs the macro. Overwrite MANDATORY! Default implementation raises RuntimeError.

Raises:

RuntimeError

class loadcrystal(*args, **kwargs)[source]

Load crystal information from file

prepare()[source]

Macro API. Prepare phase. Overwrite as necessary. Default implementation does nothing

run()[source]

Macro API. Runs the macro. Overwrite MANDATORY! Default implementation raises RuntimeError.

Raises:

RuntimeError

class lscan(*args, **kwargs)[source]

Scan l axis

param_def = [['start_pos', 'Float', None, 'Scan start position'], ['final_pos', 'Float', None, 'Scan final position'], ['nr_interv', 'Integer', None, 'Number of scan intervals'], ['integ_time', 'Float', None, 'Integration time']]

This property holds the macro parameter description. It consists of a sequence of parameter information objects. A parameter information object is either:

  1. a simple parameter object

  2. a parameter repetition object

A simple parameter object is a sequence of:

  1. a string representing the parameter name

  2. a member of Macro.Type representing the parameter data type

  3. a default value for the parameter or None if there is no default value

  4. a string with the parameter description

Example:

param_def = ( ('value', Type.Float, None, 'a float parameter' ) )

A parameter repetition object is a sequence of:

  1. a string representing the parameter repetition name

  2. a sequence of parameter information objects

  3. a dictionary representing the parameter repetition semantics or None to use the default parameter repetition semantics. Dictionary keys are:

    • min - integer representing minimum number of repetitions or None for no minimum.

    • max - integer representing maximum number of repetitions or None for no maximum.

    Default parameter repetition semantics is { 'min': 1, 'max' : None } (in other words, “at least one repetition” semantics)

Example:

param_def = (
    ( 'motor_list', ( ( 'motor', Type.Motor, None, 'motor name') ), None, 'List of motors')
)
prepare(start_pos, final_pos, nr_interv, integ_time)[source]

Macro API. Prepare phase. Overwrite as necessary. Default implementation does nothing

class newcrystal(*args, **kwargs)[source]

Create a new crystal (if it does not exist) and select it.

param_def = [['crystal_name', 'String', '', 'Name of the crystal to add and select']]

This property holds the macro parameter description. It consists of a sequence of parameter information objects. A parameter information object is either:

  1. a simple parameter object

  2. a parameter repetition object

A simple parameter object is a sequence of:

  1. a string representing the parameter name

  2. a member of Macro.Type representing the parameter data type

  3. a default value for the parameter or None if there is no default value

  4. a string with the parameter description

Example:

param_def = ( ('value', Type.Float, None, 'a float parameter' ) )

A parameter repetition object is a sequence of:

  1. a string representing the parameter repetition name

  2. a sequence of parameter information objects

  3. a dictionary representing the parameter repetition semantics or None to use the default parameter repetition semantics. Dictionary keys are:

    • min - integer representing minimum number of repetitions or None for no minimum.

    • max - integer representing maximum number of repetitions or None for no maximum.

    Default parameter repetition semantics is { 'min': 1, 'max' : None } (in other words, “at least one repetition” semantics)

Example:

param_def = (
    ( 'motor_list', ( ( 'motor', Type.Motor, None, 'motor name') ), None, 'List of motors')
)
prepare(crystal_name)[source]

Macro API. Prepare phase. Overwrite as necessary. Default implementation does nothing

run(crystal_name)[source]

Macro API. Runs the macro. Overwrite MANDATORY! Default implementation raises RuntimeError.

Raises:

RuntimeError

class or0(*args, **kwargs)[source]

Set primary orientation reflection.

param_def = [['H', 'Float', None, 'H value'], ['K', 'Float', None, 'K value'], ['L', 'Float', None, 'L value']]

This property holds the macro parameter description. It consists of a sequence of parameter information objects. A parameter information object is either:

  1. a simple parameter object

  2. a parameter repetition object

A simple parameter object is a sequence of:

  1. a string representing the parameter name

  2. a member of Macro.Type representing the parameter data type

  3. a default value for the parameter or None if there is no default value

  4. a string with the parameter description

Example:

param_def = ( ('value', Type.Float, None, 'a float parameter' ) )

A parameter repetition object is a sequence of:

  1. a string representing the parameter repetition name

  2. a sequence of parameter information objects

  3. a dictionary representing the parameter repetition semantics or None to use the default parameter repetition semantics. Dictionary keys are:

    • min - integer representing minimum number of repetitions or None for no minimum.

    • max - integer representing maximum number of repetitions or None for no maximum.

    Default parameter repetition semantics is { 'min': 1, 'max' : None } (in other words, “at least one repetition” semantics)

Example:

param_def = (
    ( 'motor_list', ( ( 'motor', Type.Motor, None, 'motor name') ), None, 'List of motors')
)
prepare(H, K, L)[source]

Macro API. Prepare phase. Overwrite as necessary. Default implementation does nothing

run(H, K, L)[source]

Macro API. Runs the macro. Overwrite MANDATORY! Default implementation raises RuntimeError.

Raises:

RuntimeError

class or1(*args, **kwargs)[source]

Set secondary orientation reflection.

param_def = [['H', 'Float', None, 'H value'], ['K', 'Float', None, 'K value'], ['L', 'Float', None, 'L value']]

This property holds the macro parameter description. It consists of a sequence of parameter information objects. A parameter information object is either:

  1. a simple parameter object

  2. a parameter repetition object

A simple parameter object is a sequence of:

  1. a string representing the parameter name

  2. a member of Macro.Type representing the parameter data type

  3. a default value for the parameter or None if there is no default value

  4. a string with the parameter description

Example:

param_def = ( ('value', Type.Float, None, 'a float parameter' ) )

A parameter repetition object is a sequence of:

  1. a string representing the parameter repetition name

  2. a sequence of parameter information objects

  3. a dictionary representing the parameter repetition semantics or None to use the default parameter repetition semantics. Dictionary keys are:

    • min - integer representing minimum number of repetitions or None for no minimum.

    • max - integer representing maximum number of repetitions or None for no maximum.

    Default parameter repetition semantics is { 'min': 1, 'max' : None } (in other words, “at least one repetition” semantics)

Example:

param_def = (
    ( 'motor_list', ( ( 'motor', Type.Motor, None, 'motor name') ), None, 'List of motors')
)
prepare(H, K, L)[source]

Macro API. Prepare phase. Overwrite as necessary. Default implementation does nothing

run(H, K, L)[source]

Macro API. Runs the macro. Overwrite MANDATORY! Default implementation raises RuntimeError.

Raises:

RuntimeError

class orswap(*args, **kwargs)[source]

Swap values for primary and secondary vectors.

prepare()[source]

Macro API. Prepare phase. Overwrite as necessary. Default implementation does nothing

run()[source]

Macro API. Runs the macro. Overwrite MANDATORY! Default implementation raises RuntimeError.

Raises:

RuntimeError

class pa(*args, **kwargs)[source]

Prints information about the active diffractometer.

prepare()[source]

Macro API. Prepare phase. Overwrite as necessary. Default implementation does nothing

run()[source]

Macro API. Runs the macro. Overwrite MANDATORY! Default implementation raises RuntimeError.

Raises:

RuntimeError

class savecrystal(*args, **kwargs)[source]

Save crystal information to file

prepare()[source]

Macro API. Prepare phase. Overwrite as necessary. Default implementation does nothing

run()[source]

Macro API. Runs the macro. Overwrite MANDATORY! Default implementation raises RuntimeError.

Raises:

RuntimeError

class setaz(*args, **kwargs)[source]

Set hkl values of the psi reference vector

param_def = [['PsiH', 'Float', -999, 'H value of psi reference vector'], ['PsiK', 'Float', -999, 'K value of psi reference vector'], ['PsiL', 'Float', -999, 'L value of psi reference vector']]

This property holds the macro parameter description. It consists of a sequence of parameter information objects. A parameter information object is either:

  1. a simple parameter object

  2. a parameter repetition object

A simple parameter object is a sequence of:

  1. a string representing the parameter name

  2. a member of Macro.Type representing the parameter data type

  3. a default value for the parameter or None if there is no default value

  4. a string with the parameter description

Example:

param_def = ( ('value', Type.Float, None, 'a float parameter' ) )

A parameter repetition object is a sequence of:

  1. a string representing the parameter repetition name

  2. a sequence of parameter information objects

  3. a dictionary representing the parameter repetition semantics or None to use the default parameter repetition semantics. Dictionary keys are:

    • min - integer representing minimum number of repetitions or None for no minimum.

    • max - integer representing maximum number of repetitions or None for no maximum.

    Default parameter repetition semantics is { 'min': 1, 'max' : None } (in other words, “at least one repetition” semantics)

Example:

param_def = (
    ( 'motor_list', ( ( 'motor', Type.Motor, None, 'motor name') ), None, 'List of motors')
)
prepare(PsiH, PsiK, PsiL)[source]

Macro API. Prepare phase. Overwrite as necessary. Default implementation does nothing

run(PsiH, PsiK, PsiL)[source]

Macro API. Runs the macro. Overwrite MANDATORY! Default implementation raises RuntimeError.

Raises:

RuntimeError

class setlat(*args, **kwargs)[source]

Set the crystal lattice parameters a, b, c, alpha, beta and gamma for the currently active diffraction pseudo motor controller.

param_def = [['a', 'Float', -999, "Lattice 'a' parameter"], ['b', 'Float', -999, "Lattice 'b' parameter"], ['c', 'Float', -999, "Lattice 'c' parameter"], ['alpha', 'Float', -999, "Lattice 'alpha' parameter"], ['beta', 'Float', -999, "Lattice 'beta' parameter"], ['gamma', 'Float', -999, "Lattice 'gamma' parameter"]]

This property holds the macro parameter description. It consists of a sequence of parameter information objects. A parameter information object is either:

  1. a simple parameter object

  2. a parameter repetition object

A simple parameter object is a sequence of:

  1. a string representing the parameter name

  2. a member of Macro.Type representing the parameter data type

  3. a default value for the parameter or None if there is no default value

  4. a string with the parameter description

Example:

param_def = ( ('value', Type.Float, None, 'a float parameter' ) )

A parameter repetition object is a sequence of:

  1. a string representing the parameter repetition name

  2. a sequence of parameter information objects

  3. a dictionary representing the parameter repetition semantics or None to use the default parameter repetition semantics. Dictionary keys are:

    • min - integer representing minimum number of repetitions or None for no minimum.

    • max - integer representing maximum number of repetitions or None for no maximum.

    Default parameter repetition semantics is { 'min': 1, 'max' : None } (in other words, “at least one repetition” semantics)

Example:

param_def = (
    ( 'motor_list', ( ( 'motor', Type.Motor, None, 'motor name') ), None, 'List of motors')
)
prepare(a, b, c, alpha, beta, gamma)[source]

Macro API. Prepare phase. Overwrite as necessary. Default implementation does nothing

run(a, b, c, alpha, beta, gamma)[source]

Macro API. Runs the macro. Overwrite MANDATORY! Default implementation raises RuntimeError.

Raises:

RuntimeError

class setmode(*args, **kwargs)[source]

Set operation mode.

param_def = [['new_mode', 'Integer', -1, 'Mode to be set']]

This property holds the macro parameter description. It consists of a sequence of parameter information objects. A parameter information object is either:

  1. a simple parameter object

  2. a parameter repetition object

A simple parameter object is a sequence of:

  1. a string representing the parameter name

  2. a member of Macro.Type representing the parameter data type

  3. a default value for the parameter or None if there is no default value

  4. a string with the parameter description

Example:

param_def = ( ('value', Type.Float, None, 'a float parameter' ) )

A parameter repetition object is a sequence of:

  1. a string representing the parameter repetition name

  2. a sequence of parameter information objects

  3. a dictionary representing the parameter repetition semantics or None to use the default parameter repetition semantics. Dictionary keys are:

    • min - integer representing minimum number of repetitions or None for no minimum.

    • max - integer representing maximum number of repetitions or None for no maximum.

    Default parameter repetition semantics is { 'min': 1, 'max' : None } (in other words, “at least one repetition” semantics)

Example:

param_def = (
    ( 'motor_list', ( ( 'motor', Type.Motor, None, 'motor name') ), None, 'List of motors')
)
prepare(new_mode)[source]

Macro API. Prepare phase. Overwrite as necessary. Default implementation does nothing

run(new_mode)[source]

Macro API. Runs the macro. Overwrite MANDATORY! Default implementation raises RuntimeError.

Raises:

RuntimeError

class setor0(*args, **kwargs)[source]

Set primary orientation reflection choosing hkl and angle values. Run it without any argument to see the order real positions

param_def = [['H', 'Float', -999, 'H value'], ['K', 'Float', -999, 'K value'], ['L', 'Float', -999, 'L value'], ['ang1', 'Float', -999, 'Real position'], ['ang2', 'Float', -999, 'Real position'], ['ang3', 'Float', -999, 'Real position'], ['ang4', 'Float', -999, 'Real position'], ['ang5', 'Float', -999, 'Real position'], ['ang6', 'Float', -999, 'Real position'], ['ang7', 'Float', -999, 'Real position']]

This property holds the macro parameter description. It consists of a sequence of parameter information objects. A parameter information object is either:

  1. a simple parameter object

  2. a parameter repetition object

A simple parameter object is a sequence of:

  1. a string representing the parameter name

  2. a member of Macro.Type representing the parameter data type

  3. a default value for the parameter or None if there is no default value

  4. a string with the parameter description

Example:

param_def = ( ('value', Type.Float, None, 'a float parameter' ) )

A parameter repetition object is a sequence of:

  1. a string representing the parameter repetition name

  2. a sequence of parameter information objects

  3. a dictionary representing the parameter repetition semantics or None to use the default parameter repetition semantics. Dictionary keys are:

    • min - integer representing minimum number of repetitions or None for no minimum.

    • max - integer representing maximum number of repetitions or None for no maximum.

    Default parameter repetition semantics is { 'min': 1, 'max' : None } (in other words, “at least one repetition” semantics)

Example:

param_def = (
    ( 'motor_list', ( ( 'motor', Type.Motor, None, 'motor name') ), None, 'List of motors')
)
prepare(H, K, L, ang1, ang2, ang3, ang4, ang5, ang6, ang7)[source]

Macro API. Prepare phase. Overwrite as necessary. Default implementation does nothing

run(H, K, L, ang1, ang2, ang3, ang4, ang5, ang6, ang7)[source]

Macro API. Runs the macro. Overwrite MANDATORY! Default implementation raises RuntimeError.

Raises:

RuntimeError

class setor1(*args, **kwargs)[source]

Set secondary orientation reflection choosing hkl and angle values. Run it without any argument to see the order real positions

param_def = [['H', 'Float', -999, 'H value'], ['K', 'Float', -999, 'K value'], ['L', 'Float', -999, 'L value'], ['ang1', 'Float', -999, 'Real position'], ['ang2', 'Float', -999, 'Real position'], ['ang3', 'Float', -999, 'Real position'], ['ang4', 'Float', -999, 'Real position'], ['ang5', 'Float', -999, 'Real position'], ['ang6', 'Float', -999, 'Real position'], ['ang7', 'Float', -999, 'Real position']]

This property holds the macro parameter description. It consists of a sequence of parameter information objects. A parameter information object is either:

  1. a simple parameter object

  2. a parameter repetition object

A simple parameter object is a sequence of:

  1. a string representing the parameter name

  2. a member of Macro.Type representing the parameter data type

  3. a default value for the parameter or None if there is no default value

  4. a string with the parameter description

Example:

param_def = ( ('value', Type.Float, None, 'a float parameter' ) )

A parameter repetition object is a sequence of:

  1. a string representing the parameter repetition name

  2. a sequence of parameter information objects

  3. a dictionary representing the parameter repetition semantics or None to use the default parameter repetition semantics. Dictionary keys are:

    • min - integer representing minimum number of repetitions or None for no minimum.

    • max - integer representing maximum number of repetitions or None for no maximum.

    Default parameter repetition semantics is { 'min': 1, 'max' : None } (in other words, “at least one repetition” semantics)

Example:

param_def = (
    ( 'motor_list', ( ( 'motor', Type.Motor, None, 'motor name') ), None, 'List of motors')
)
prepare(H, K, L, ang1, ang2, ang3, ang4, ang5, ang6, ang7)[source]

Macro API. Prepare phase. Overwrite as necessary. Default implementation does nothing

run(H, K, L, ang1, ang2, ang3, ang4, ang5, ang6, ang7)[source]

Macro API. Runs the macro. Overwrite MANDATORY! Default implementation raises RuntimeError.

Raises:

RuntimeError

class setorn(*args, **kwargs)[source]

Set orientation reflection indicated by the index. Run it without any argument to see the order of the angles to be set

param_def = [['ref_id', 'Integer', None, 'reflection index (starting at 0)'], ['H', 'Float', -999, 'H value'], ['K', 'Float', -999, 'K value'], ['L', 'Float', -999, 'L value'], ['ang1', 'Float', -999, 'Real position'], ['ang2', 'Float', -999, 'Real position'], ['ang3', 'Float', -999, 'Real position'], ['ang4', 'Float', -999, 'Real position'], ['ang5', 'Float', -999, 'Real position'], ['ang6', 'Float', -999, 'Real position'], ['ang7', 'Float', -999, 'Real position']]

This property holds the macro parameter description. It consists of a sequence of parameter information objects. A parameter information object is either:

  1. a simple parameter object

  2. a parameter repetition object

A simple parameter object is a sequence of:

  1. a string representing the parameter name

  2. a member of Macro.Type representing the parameter data type

  3. a default value for the parameter or None if there is no default value

  4. a string with the parameter description

Example:

param_def = ( ('value', Type.Float, None, 'a float parameter' ) )

A parameter repetition object is a sequence of:

  1. a string representing the parameter repetition name

  2. a sequence of parameter information objects

  3. a dictionary representing the parameter repetition semantics or None to use the default parameter repetition semantics. Dictionary keys are:

    • min - integer representing minimum number of repetitions or None for no minimum.

    • max - integer representing maximum number of repetitions or None for no maximum.

    Default parameter repetition semantics is { 'min': 1, 'max' : None } (in other words, “at least one repetition” semantics)

Example:

param_def = (
    ( 'motor_list', ( ( 'motor', Type.Motor, None, 'motor name') ), None, 'List of motors')
)
prepare(ref_id, H, K, L, ang1, ang2, ang3, ang4, ang5, ang6, ang7)[source]

Macro API. Prepare phase. Overwrite as necessary. Default implementation does nothing

run(ref_id, H, K, L, ang1, ang2, ang3, ang4, ang5, ang6, ang7)[source]

Macro API. Runs the macro. Overwrite MANDATORY! Default implementation raises RuntimeError.

Raises:

RuntimeError

class th2th(*args, **kwargs)[source]

th2th - scan:

Relative scan around current position in del and th with d_th=2*d_delta

param_def = [['rel_start_pos', 'Float', -999, 'Scan start position'], ['rel_final_pos', 'Float', -999, 'Scan final position'], ['nr_interv', 'Integer', -999, 'Number of scan intervals'], ['integ_time', 'Float', -999, 'Integration time']]

This property holds the macro parameter description. It consists of a sequence of parameter information objects. A parameter information object is either:

  1. a simple parameter object

  2. a parameter repetition object

A simple parameter object is a sequence of:

  1. a string representing the parameter name

  2. a member of Macro.Type representing the parameter data type

  3. a default value for the parameter or None if there is no default value

  4. a string with the parameter description

Example:

param_def = ( ('value', Type.Float, None, 'a float parameter' ) )

A parameter repetition object is a sequence of:

  1. a string representing the parameter repetition name

  2. a sequence of parameter information objects

  3. a dictionary representing the parameter repetition semantics or None to use the default parameter repetition semantics. Dictionary keys are:

    • min - integer representing minimum number of repetitions or None for no minimum.

    • max - integer representing maximum number of repetitions or None for no maximum.

    Default parameter repetition semantics is { 'min': 1, 'max' : None } (in other words, “at least one repetition” semantics)

Example:

param_def = (
    ( 'motor_list', ( ( 'motor', Type.Motor, None, 'motor name') ), None, 'List of motors')
)
run(rel_start_pos, rel_final_pos, nr_interv, integ_time)[source]

Macro API. Runs the macro. Overwrite MANDATORY! Default implementation raises RuntimeError.

Raises:

RuntimeError

class ubr(*args, **kwargs)[source]

Move the diffractometer to the reciprocal space coordinates given by H, K and L und update.

hints = {'allowsHooks': ('pre-move', 'post-move')}

Hints to give a client to perform special tasks. Example: scan macros give hints on the types of hooks they support. A GUI can use this information to allow a scan to have sub-macros executed as hooks.

param_def = [['hh', 'String', 'Not set', 'H position'], ['kk', 'String', 'Not set', 'K position'], ['ll', 'String', 'Not set', 'L position'], ['AnglesIndex', 'Integer', -1, 'Angles index']]

This property holds the macro parameter description. It consists of a sequence of parameter information objects. A parameter information object is either:

  1. a simple parameter object

  2. a parameter repetition object

A simple parameter object is a sequence of:

  1. a string representing the parameter name

  2. a member of Macro.Type representing the parameter data type

  3. a default value for the parameter or None if there is no default value

  4. a string with the parameter description

Example:

param_def = ( ('value', Type.Float, None, 'a float parameter' ) )

A parameter repetition object is a sequence of:

  1. a string representing the parameter repetition name

  2. a sequence of parameter information objects

  3. a dictionary representing the parameter repetition semantics or None to use the default parameter repetition semantics. Dictionary keys are:

    • min - integer representing minimum number of repetitions or None for no minimum.

    • max - integer representing maximum number of repetitions or None for no maximum.

    Default parameter repetition semantics is { 'min': 1, 'max' : None } (in other words, “at least one repetition” semantics)

Example:

param_def = (
    ( 'motor_list', ( ( 'motor', Type.Motor, None, 'motor name') ), None, 'List of motors')
)
prepare(hh, kk, ll, AnglesIndex)[source]

Macro API. Prepare phase. Overwrite as necessary. Default implementation does nothing

run(hh, kk, ll, AnglesIndex)[source]

Macro API. Runs the macro. Overwrite MANDATORY! Default implementation raises RuntimeError.

Raises:

RuntimeError

class wh(*args, **kwargs)[source]

Show principal axes and reciprocal space positions.

Prints the current reciprocal space coordinates (H K L) and the user positions of the principal motors. Depending on the diffractometer geometry, other parameters such as the angles of incidence and reflection (ALPHA and BETA) and the incident wavelength (LAMBDA) may be displayed.

prepare()[source]

Macro API. Prepare phase. Overwrite as necessary. Default implementation does nothing

run()[source]

Macro API. Runs the macro. Overwrite MANDATORY! Default implementation raises RuntimeError.

Raises:

RuntimeError