Skip to content
Snippets Groups Projects
Commit 73d66b2b authored by System User's avatar System User
Browse files

Initial commit of environment

parent 8f5a872f
No related branches found
No related tags found
No related merge requests found
# Module OpUtils
# Usefull function for operation
###############################################################################
# FUNCTIONS ON DEVICE PROXY
###############################################################################
def searchattr(prx, attr, ignorecase=True):
"""
Search in a tango device proxy for an attribute name.
PARAMETERS
----------
prx: tango.DeviceProxy
Proxy to the device.
attr: string
String to search for.
ignorecase: bool
Case insensitive.
"""
if ignorecase:
return [a for a in prx.get_attribute_list() if attr.lower() in a.lower()]
else:
return [a for a in prx.get_attribute_list() if attr in a]
###############################################################################
# FUNCTIONS ON TANGO DATABASE
###############################################################################
###############################################################################
# FUNCTIONS ON ARCHIVER
###############################################################################
# IPython prompt initialization for operation
# Turn automagic on
# This gives the possibility to use magic command without '%'.
# i.e. cd, pwd, ...
%automagic on
# Import usefull packages
import PyTango as tango
import numpy as np
import OpUtils as OU
print("Imported: tango, np, OU")
# Create a database object
DB = tango.Database()
print("Object DB created: tango database")
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