forked from mxcube/HardwareObjects
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RontecMCA.py
76 lines (56 loc) · 1.89 KB
/
RontecMCA.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
from HardwareRepository.BaseHardwareObjects import HardwareObject
from AbstractMCA import *
from bliss.controllers.rontec import Rontec
class RontecMCA(AbstractMCA, HardwareObject):
def __init__(self, name):
AbstractMCA.__init__(self)
HardwareObject.__init__(self, name)
self.mca = None
self.calib_cf = []
def init(self):
self.mca = Rontec(self.getProperty("SLdevice"))
calib_cf = self.getProperty("calib_cf")
for i in calib_cf.split(","):
self.calib_cf.append(float(i))
@task
def read_raw_data(self, chmin=0, chmax=4095, save_data=False):
return self.mca.read_raw_data(chmin, chmax, save_data)
@task
def read_roi_data(self,save_data=False):
return self.mca.read_roi_data(save_data)
@task
def read_data(self, chmin=0, chmax=4095, calib=False, save_data=False):
return self.mca.read_data(chmin, chmax, calib, save_data)
@task
def set_calibration(self, fname=None, calib_cf=[0,1,0]):
return self.mca.set_calibration(fname, calib_cf)
@task
def get_calibration(self):
return self.mca.get_calibration()
@task
def set_roi(self, emin, emax, **kwargs):
self.mca.set_roi(emin, emax, **kwargs)
@task
def get_roi(self, **kwargs):
return self.mca.get_roi(**kwargs)
@task
def clear_roi(self, **kwargs):
self.mca.clear_roi(**kwargs)
@task
def get_times(self):
return self.mca.get_times()
@task
def get_presets(self, **kwargs):
return self.mca.get_presets(**kwargs)
@task
def set_presets(self, **kwargs):
self.mca.set_presets(**kwargs)
@task
def start_acq (self, cnt_time=None):
self.mca.start_acq(cnt_time)
@task
def stop_acq (self):
self.mca.stop_acq()
@task
def clear_spectrum (self):
self.mca.clear_spectrum ()