diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 2f88b948d..df3dd5637 100755 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -32,6 +32,7 @@ set( PYTHON_FILES jungfrau.py mythen3.py registers.py + lookup.py utils.py ) diff --git a/python/scripts/basic.py b/python/scripts/basic.py index 77d844632..8cdd99885 100755 --- a/python/scripts/basic.py +++ b/python/scripts/basic.py @@ -5,11 +5,11 @@ sys.path.append(os.path.join(os.getcwd(), 'bin')) from sls_detector import Detector, Mythen3, Eiger, Jungfrau, DetectorDacs, Dac, Ctb from sls_detector import dacIndex, readoutMode - +from sls_detector.lookup import view, find d = Detector() # e = Eiger() -# c = Ctb() +c = Ctb() # j = Jungfrau() -m = Mythen3() +# m = Mythen3() diff --git a/python/sls_detector/detector.py b/python/sls_detector/detector.py index 02fb81beb..5d1725f10 100755 --- a/python/sls_detector/detector.py +++ b/python/sls_detector/detector.py @@ -13,21 +13,6 @@ import datetime as dt from functools import wraps from collections import namedtuple -# class Register: -# """ -# Helper class to read and write to registers using a -# more Pythonic syntax -# """ -# def __init__(self, detector): -# self._detector = detector - -# def __getitem__(self, key): -# return self._detector.readRegister(key) - -# def __setitem__(self, key, value): -# self._detector.writeRegister(key, value) - - def freeze(cls): cls._frozen = False diff --git a/python/sls_detector/utils.py b/python/sls_detector/utils.py index 5c5835bc9..f59e67c89 100755 --- a/python/sls_detector/utils.py +++ b/python/sls_detector/utils.py @@ -2,10 +2,13 @@ Utility functions that are useful for testing and troubleshooting but not directly used in controlling the detector """ + + from collections import namedtuple import _sls_detector #C++ lib import functools + Geometry = namedtuple('Geometry', ['x', 'y']) def get_set_bits(mask): @@ -65,3 +68,4 @@ def eiger_register_to_time(register): clocks = register >> 3 exponent = register & 0b111 return clocks*10**exponent / 100e6 +