Skip to content
Snippets Groups Projects
Commit 363bba72 authored by Jan David Mol's avatar Jan David Mol
Browse files

Merge branch...

Merge branch '2021-04-02T11.03.46-Branched_from_master-Add_get_internal_attribute_history_function' into 'master'

Add a convenience func to retrieve the internal attr. hist.

See merge request !10
parents 504df1e8 b89f94e9
No related branches found
No related tags found
1 merge request!10Add a convenience func to retrieve the internal attr. hist.
#! /usr/bin/env python3
from tango import DeviceProxy
from numpy import array, transpose
def get_internal_attribute_history(device: DeviceProxy, attribute_name: str, depth: int = 10):
try:
history = array(device.attribute_history(attr_name = attribute_name, depth = depth))
except Exception as e:
raise ValueError("Cannot access the internal history of the attribute '{}/{}'.".format(device.name(), attribute_name)) from e
history_values = array([entry.value for entry in history])
values = history_values.transpose()
return values
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment