virtual and vetofile

This commit is contained in:
Erik Frojdh
2020-09-03 15:33:12 +02:00
parent 6b7dee2631
commit 22f14cacb0
2 changed files with 63 additions and 1 deletions

View File

@ -1028,12 +1028,31 @@ class Detector(CppDetectorApi):
'detectorserver': self.detectorserverversion,
'receiver': self.rx_version}
@property
def virtual(self):
"""
Setup with n virtual servers running on localhost
starting with port p
Examples
---------
>>> d.virtual = n, p
"""
raise NotImplementedError('Virtual is set only')
@virtual.setter
def virtual(self, args):
n_detectors, starting_port = args
self.setVirtualDetectorServers(n_detectors, starting_port)
@property
def packageversion(self):
return self.getPackageVersion()
@property
def ratecorr(self):
"""
@ -1418,6 +1437,33 @@ class Detector(CppDetectorApi):
self.setVeto(value)
@property
def vetofile(self):
"""
[Gotthard2] Set veto reference for each 128 channels for specific chip.
The file should have 128 rows of gain index and 12 bit value in dec
Examples
---------
d.vetofile = '/path/to/file.txt' #set for all chips
d.vetofile = 3, '/path/to/file.txt' # set for chip 3
"""
raise NotImplementedError('vetofile is set only')
@vetofile.setter
def vetofile(self, args):
if isinstance(args, str):
chip_index = -1
fname = args
elif isinstance(args, (tuple, list)):
chip_index, fname = args
else:
raise ValueError("unknow argument to vetofile")
self.setVetoFile(chip_index, fname)
"""
Mythen3 specific
"""