doocspie

DOOCS Python Interface for Experiments.

This module provides the basic functions for I/O operations with the DOOCS control system as well as subpackages for recurrent tasks when performing experiments and evaluating data with Python within the context of DOOCS.

doocspie.ls(address)

List the members of the given 4-layer address scheme ‘facility/device/location/property’.

Parameters:

address (str) – The address part, optionally including the * wildcard, to query the members from.

Returns:

The queried members of the 4-layer DOOCS address scheme.

Return type:

tuple

Raises:

DoocspieException – DOOCS related exception for non-exiting address parts to query from.

doocspie.get(address, event=None, ignore_event_mismatch=False, timestamp_event=False, meta_event=None, start=None, elements=None)

Get the readout for a given DOOCS address with optional parameters (see ‘Args’ below).

Parameters:
  • address (str) – The property address of the server to get the readout from.

  • event (int, optional) – Optional event to get the data from.

  • ignore_event_mismatch (bool, optional) – Optional state for ignoring event mismatches.

  • timestamp_event (bool, optional) – Optional state to determine using the timestamp as an alternative event.

  • meta_event (str, optional) – Optional Meta property to replace the default event with.

  • start (int, optional) – Optional start position for reading out array-like types.

  • elements (int, optional) – Optional number of elements to read out for array-like types.

Returns:

An instance of the readout object with its properties ‘data’, ‘type’, ‘timestamp’, ‘event’ and ‘meta’.

Return type:

Readout

Raises:

DoocspieException – Context-dependent exception related to DOOCS, pydoocs or doocspie itself.

doocspie.set(address, value, allow_resizing=False)

Set the content of DOOCS server properties with the given value and with optional resizing.

Parameters:
  • address (str) – The property address of the server to set the value to.

  • value (property dependent) – The value to set the server property to.

  • allow_resizing (bool, optional) – The optional state for allowing resizing of array-like DOOCS types.

Returns:

None

Raises:

DoocspieException – DOOCS or pydoocs related exception for server errors or wrong input.

doocspie.get_history(address, begin=None, end=None)

Get the history of a given DOOCS history address with optional ‘begin’ and ‘end’ datetimes.

Parameters:
  • address (str) – The history property address of the server to get the history readout from.

  • begin (datetime, optional) – The optional beginning datetime for the history to get data from.

  • end (datetime, optional) – The optional ending datetime for the history to get data from.

Returns:

An instance of the history object with properties ‘times’, ‘values’ and ‘states’.

Return type:

History

Raises:
  • ValueError – Exception for wrong DOOCS history address.

  • TypeError – Exception for wrong ‘begin’ and ‘end’ types.

  • DoocspieException – Context-dependent exception related to DOOCS, pydoocs or doocspie itself.

doocspie.__version__

The doocspie version number.

doocspie.__pydoocs_version__

The version number of pydoocs, which represents the core of doocspie.

doocspie.__doocs_libno__

The version number of DOOCS, which is the underlying control system.