doocspie.doocspie
This subpackages provides the modules for the basic functions for higher level I/O operations.
io
Module with functions for higher level I/O within DOOCS.
This module provides the functions for higher level I/O operations with the DOOCS control system.
- doocspie.doocspie.io.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.doocspie.io.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:
- Raises:
DoocspieException – Context-dependent exception related to DOOCS, pydoocs or doocspie itself.
- doocspie.doocspie.io.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.doocspie.io.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:
- 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.
readout
Module with readout class for higher level output from DOOCS.
This module provides the readout class for higher level output from the DOOCS control system.
- class doocspie.doocspie.readout.Readout(pydoocs_output, timestamp_event, miscellaneous_event)
Readout class for higher level output from DOOCS.
This class provides the readout for higher level output from the DOOCS control system.
- __init__(pydoocs_output, timestamp_event, miscellaneous_event)
Constructor of the readout class.
This constructor initializes the instance using the pydoocs output and a miscellaneous event.
- Parameters:
pydoocs_output (dict) – The output data provided by pydoocs.
timestamp_event (bool) – The state to determine using the timestamp as an alternative event.
miscellaneous_event (str) – The miscellaneous event to be used as an alternative event.
- __str__()
Special method to return a properly formatted string representation of the readout.
- __len__()
Special method to return the length of the data (in case of array-like types).
- __eq__(other)
Special method to check for equality by using the ‘==’ operator.
- property data
The returned DOOCS data.
- Type:
property dependent
- property type
The DOOCS data type of the returned data.
- Type:
str
- property timestamp
The timestamp linked to the returned data.
- Type:
float
- property event
The event number linked to the returned data.
- Type:
int
meta
Module with metaclass for metadata provided by DOOCS.
This module provides the metaclass for metadata provided by the DOOCS control system.
- class doocspie.doocspie.meta.Meta(miscellaneous)
Metaclass for metadata provided by DOOCS.
This class provides the metadata provided by the DOOCS control system.
- __init__(miscellaneous)
Constructor of the metaclass.
This constructor initializes the instance using the miscellaneous data from pydoocs.
- Parameters:
miscellaneous (dict) – The miscellaneous data provided by pydoocs.
- __setattr__(name, value)
Special method to make the meta properties read-only.
- __str__()
Special method to return a properly formatted string representation of the metadata.
- __len__()
Special method to return the number of properties.
- __eq__(other)
Special method to check for equality by using the ‘==’ operator.
doocspie_exception
Module with exception class for higher level I/O within DOOCS.
This module provides the custom exception class for higher level I/O operations with DOOCS.
- class doocspie.doocspie.doocspie_exception.DoocspieException(exception, address=None)
Exception class for higher level I/O within DOOCS.
This class provides the custom exception for higher level I/O operations with DOOCS.
- __init__(exception, address=None)
Constructor of the custom exception class.
This constructor initializes the instance using the causing low-level exception and an optional address.
- Parameters:
exception (any Exception) – The causing low-level exception.
address (str, optional) – The exception causing address.
- property code
The error code of the exception. This is only relevant for DOOCS related exceptions.
- Type:
int
- property message
The message of the exception.
- Type:
str
- property address
The exception causing address.
- Type:
str
history
Module with history class for higher level history output from DOOCS.
This module provides the history class for higher level history output from DOOCS.
- class doocspie.doocspie.history.History(pydoocs_output)
History class for higher level history output from DOOCS.
This class provides the higher level history output from the DOOCS control system.
- __init__(pydoocs_output)
Constructor of the history class.
This constructor initializes the instance using the pydoocs output for DOOCS histories.
- Parameters:
pydoocs_output (dict) – The output data for DOOCS history properties provided by pydoocs.
- __str__()
Special method to return a properly formatted string representation of the history.
- __len__()
Special method to return the length of the history.
- property times
The datetimes of the returned history.
- Type:
numpy.ndarray
- property values
The data values of the returned history.
- Type:
numpy.ndarray
- property states
The state information of the returned history.
- Type:
numpy.ndarray