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

@ -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

View File

@ -19,22 +19,22 @@ class Mythen3Dacs(DetectorDacs):
"""
Jungfrau specific DACs
"""
_dacs = [('vcassh', dacIndex.VCASSH, 0, 4000, 1220),
('vth2', dacIndex.VTH2, 0, 4000, 2800),
('vrshaper', dacIndex.VRSHAPER, 0, 4000, 1280),
('vrshaper_n', dacIndex.VRSHAPER_N, 0, 4000, 2800),
('vipre_out', dacIndex.VIPRE_OUT, 0, 4000, 1220),
('vth3', dacIndex.VTH3, 0, 4000, 2800),
('vth1', dacIndex.VTH1, 0, 4000, 2800),
('vicin', dacIndex.VICIN, 0, 4000, 1708),
_dacs = [('vcassh', dacIndex.VCASSH, 0, 4000, 1220),
('vth2', dacIndex.VTH2, 0, 4000, 2800),
('vrshaper', dacIndex.VRSHAPER, 0, 4000, 1280),
('vrshaper_n', dacIndex.VRSHAPER_N, 0, 4000, 2800),
('vipre_out', dacIndex.VIPRE_OUT, 0, 4000, 1220),
('vth3', dacIndex.VTH3, 0, 4000, 2800),
('vth1', dacIndex.VTH1, 0, 4000, 2800),
('vicin', dacIndex.VICIN, 0, 4000, 1708),
('vcas', dacIndex.VCAS, 0, 4000, 1800),
('vrpreamp', dacIndex.VRPREAMP, 0, 4000, 1100),
('vcal_n', dacIndex.VCAL_N, 0, 4000, 1100),
('vipre', dacIndex.VIPRE, 0, 4000, 2624),
('vishaper', dacIndex.VISHAPER, 0, 4000, 1708),
('vcal_p', dacIndex.VCAL_P, 0, 4000, 1712),
('vtrim', dacIndex.VTRIM, 0, 4000, 2800),
('vdcsh', dacIndex.VDCSH, 0, 4000, 800),
('vrpreamp', dacIndex.VRPREAMP, 0, 4000, 1100),
('vcal_n', dacIndex.VCAL_N, 0, 4000, 1100),
('vipre', dacIndex.VIPRE, 0, 4000, 2624),
('vishaper', dacIndex.VISHAPER, 0, 4000, 1708),
('vcal_p', dacIndex.VCAL_P, 0, 4000, 1712),
('vtrim', dacIndex.VTRIM, 0, 4000, 2800),
('vdcsh', dacIndex.VDCSH, 0, 4000, 800),
]
_dacnames = [_d[0] for _d in _dacs]