This commit is contained in:
Erik Frojdh
2020-01-21 09:07:27 +01:00
parent 4b7edf2e62
commit 5667353f47
4 changed files with 8 additions and 18 deletions

View File

@ -32,6 +32,7 @@ set( PYTHON_FILES
jungfrau.py jungfrau.py
mythen3.py mythen3.py
registers.py registers.py
lookup.py
utils.py utils.py
) )

View File

@ -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 Detector, Mythen3, Eiger, Jungfrau, DetectorDacs, Dac, Ctb
from sls_detector import dacIndex, readoutMode from sls_detector import dacIndex, readoutMode
from sls_detector.lookup import view, find
d = Detector() d = Detector()
# e = Eiger() # e = Eiger()
# c = Ctb() c = Ctb()
# j = Jungfrau() # j = Jungfrau()
m = Mythen3() # m = Mythen3()

View File

@ -13,21 +13,6 @@ import datetime as dt
from functools import wraps from functools import wraps
from collections import namedtuple 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): def freeze(cls):
cls._frozen = False cls._frozen = False

View File

@ -2,10 +2,13 @@
Utility functions that are useful for testing and troubleshooting Utility functions that are useful for testing and troubleshooting
but not directly used in controlling the detector but not directly used in controlling the detector
""" """
from collections import namedtuple from collections import namedtuple
import _sls_detector #C++ lib import _sls_detector #C++ lib
import functools import functools
Geometry = namedtuple('Geometry', ['x', 'y']) Geometry = namedtuple('Geometry', ['x', 'y'])
def get_set_bits(mask): def get_set_bits(mask):
@ -65,3 +68,4 @@ def eiger_register_to_time(register):
clocks = register >> 3 clocks = register >> 3
exponent = register & 0b111 exponent = register & 0b111
return clocks*10**exponent / 100e6 return clocks*10**exponent / 100e6