added gotthard2

This commit is contained in:
Erik Frojdh 2020-08-20 16:49:55 +02:00
parent a2ec86006d
commit e782fcce62
7 changed files with 84 additions and 18 deletions

View File

@ -31,6 +31,7 @@ set( PYTHON_FILES
detector.py
eiger.py
errors.py
gotthard2.py
ctb.py
jungfrau.py
mythen3.py

View File

@ -3,13 +3,14 @@ import sys
import numpy as np
sys.path.append(os.path.join(os.getcwd(), 'bin'))
from slsdet import Detector, Mythen3, Eiger, Jungfrau, DetectorDacs, Dac, Ctb
from slsdet import Detector, Mythen3, Eiger, Jungfrau, DetectorDacs, Dac, Ctb, Gotthard2
from slsdet import dacIndex, readoutMode
from slsdet.lookup import view, find
d = Detector()
e = Eiger()
c = Ctb()
g = Gotthard2()
# j = Jungfrau()
# m = Mythen3()

View File

@ -15,7 +15,9 @@ pycmd += ['vrf', 'vtr', 'vrs', 'vtgstv', 'vsvn', 'vtrim',
'vpreamp', 'vref_comp', 'vref_comp_fe vref_ds', 'vref_h_adc',
'vref_l_adc', 'iodelay', 'list', 'vref_ds', 'vis', 'vpl',
'vref_comp_fe', 'vph', 'vout_cm', 'vcp', 'vcn', 'vcmp_ll', 'vcmp_lr'
, 'vcmp_rl', 'vcmp_rr', 'daclist', 'dacvalues', 'vcal', 'vcas']
, 'vcmp_rl', 'vcmp_rr', 'vcal', 'vcas', 'vipre',
'vin_com', 'vin_cm', 'vrshaper', 'vrshaper_n', 'vrpreamp', 'vishaper',
'vicin', 'vcassh', 'vcal_n', 'vcal_p']
missing = []
for c in cmd:

View File

@ -5,6 +5,7 @@ from .dacs import DetectorDacs, Dac
from .detector import Detector
from .jungfrau import Jungfrau
from .mythen3 import Mythen3
from .gotthard2 import Gotthard2
# from .jungfrau_ctb import JungfrauCTB
# from _slsdet import DetectorApi

View File

@ -32,7 +32,7 @@ class Dac(DetectorProperty):
def __repr__(self):
"""String representation for a single dac in all modules"""
dacstr = ''.join([f'{item:5d}' for item in self.get()])
return f'{self.__name__:10s}:{dacstr}'
return f'{self.__name__:15s}:{dacstr}'
class DetectorDacs:

View File

@ -0,0 +1,61 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
This file contains the specialization for the Jungfrau detector
"""
from .detector import Detector, freeze
# from .adcs import Adc, DetectorAdcs
from .dacs import DetectorDacs
import _slsdet
dacIndex = _slsdet.slsDetectorDefs.dacIndex
from .detector_property import DetectorProperty
# @freeze
class Gotthard2Dacs(DetectorDacs):
"""
Gotthard2 specific DACs
"""
_dacs = [('vref_h_adc', dacIndex.VREF_H_ADC, 0, 4000, 2116),
('vb_comp_fe', dacIndex.VB_COMP_FE, 0, 4000, 0),
('vb_comp_adc', dacIndex.VB_COMP_ADC, 0, 4000, 0),
('vcom_cds', dacIndex.VCOM_CDS, 0, 4000, 705),
('vref_rstore', dacIndex.VREF_RSTORE, 0, 4000, 205),
('vb_opa_1st', dacIndex.VB_OPA_1ST, 0, 4000, 0),
('vref_comp_fe', dacIndex.VREF_COMP_FE, 0, 4000, 0),
('vcom_adc1', dacIndex.VCOM_ADC1, 0, 4000, 705),
('vref_prech', dacIndex.VREF_PRECH, 0, 4000, 900),
('vref_l_adc', dacIndex.VREF_L_ADC, 0, 4000, 700),
('vref_cds', dacIndex.VREF_CDS, 0, 4000, 600),
('vb_cs', dacIndex.VB_CS, 0, 4000, 2799),
('vb_opa_fd', dacIndex.VB_OPA_FD, 0, 4000, 0),
('vcom_adc2', dacIndex.VCOM_ADC2, 0, 4000, 704),
]
_dacnames = [_d[0] for _d in _dacs]
@freeze
class Gotthard2(Detector):
"""
Subclassing Detector to set up correct dacs and detector specific
functions.
"""
_detector_dynamic_range = [16]
_settings = ['standard', 'highgain', 'lowgain', 'veryhighgain', 'verylowgain']
"""available settings for Eiger, note almost always standard"""
def __init__(self, id=0):
super().__init__(id)
self._frozen = False
self._dacs = Gotthard2Dacs(self)
@property
def dacs(self):
return self._dacs