expconf

Experiment configuration related macros

get_meas(self, macro)[source]

Activate measurement group.

It gets the ActiveMntGrp environment variable.

get_meas_conf(self, detail, meas_grp)[source]

Print measurement group configuration in form of a table.

Examples of usage:

>>> get_meas_conf  # get <ActiveMntGrp> simple configuration
>>> get_meas_conf advanced  # get <ActiveMntGrp> complete configuration
>>> get_meas_conf simple mntgrp01  # get mntgrp01 simple configuration
>>> get_meas_conf advanced mntgrp01  # get mntgrp01 complete configuration
set_meas(self, meas_grp, macro)[source]

Activate measurement group.

It sets the ActiveMntGrp environment variable.

set_meas_conf(self, parameter, value, items, meas_grp)[source]

Set measurement group configuration parameter.

Available configuration parameters and values:

  • Enabled: True/1 or False/0

  • Output: True/1 or False/0

  • PlotType: No, Spectrum or Image

  • PlotAxes: idx, mov or a <channel name> e.g. ct01 (for image use “|” as separator of axes e.g. idx|ct01)

  • Timer: <channel name> e.g. ct01

  • Monitor: <channel name> e.g. ct01

  • Synchronizer: software or <trigger/gate name> e.g. tg01

  • Synchronization: 0/Trigger, 1/Gate or 2/Start

  • ValueRefEnabled - True/1 or False/0

  • ValueRefPattern - URI e.g. file:///tmp/img_{index}.tiff

Examples of usage:

>>> # enable all channels in <ActiveMntGrp>
>>> set_meas_conf enabled True
>>> # enable spectrum plotting for ct01 on <ActiveMntGrp>
>>> set_meas_conf plottype spectrum ct01
>>> # set plot x-axis to <moveable> for all channels of <ActiveMntGrp>
>>> set_meas_conf plotaxes mov
>>> # enable spectrum plotting for all mntgrp01
>>> set_meas_conf plottype spectrum [] mntgrp01
class lssnap(*args, **kwargs)[source]

List pre-scan snapshot group.

run()[source]

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

Raises:

RuntimeError

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

Define snapshot group item(s).

Accepts:

  • Pool moveables: motor, pseudo motor

  • Pool experimental channels: counter/timer, 0D, 1D, 2D, pseudo counter

  • Taurus attributes

param_def = [['snap_names', [['name', 'String', None, 'Name of an item to be added to the pre-scan snapshot group']], None, 'Items to be added to the pre-scan snapshot group']]

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(snap_names)[source]

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

Raises:

RuntimeError

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

Undefine snapshot group item(s). Without arguments undefine all.

param_def = [['snap_names', [['name', 'String', None, 'Name of an item to be removed from the pre-scan snapshot group'], {'min': 0}], None, 'Items to be remove from the pre-scan snapshot group']]

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(snap_names)[source]

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

Raises:

RuntimeError