mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-12 12:57:13 +02:00
python docs
This commit is contained in:
@ -71,10 +71,26 @@ class Detector(CppDetectorApi):
|
|||||||
return "{}(id = {})".format(self.__class__.__name__, self.getShmId())
|
return "{}(id = {})".format(self.__class__.__name__, self.getShmId())
|
||||||
|
|
||||||
def free(self):
|
def free(self):
|
||||||
|
"""Free detector shared memory"""
|
||||||
self.freeSharedMemory()
|
self.freeSharedMemory()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def config(self):
|
def config(self):
|
||||||
|
"""Load configuration file.
|
||||||
|
|
||||||
|
Note
|
||||||
|
-----
|
||||||
|
Frees shared memory before loading configuration file. This function does not support ~ for home.
|
||||||
|
|
||||||
|
|
||||||
|
:getter: Not implemented
|
||||||
|
:setter: Loads config file
|
||||||
|
|
||||||
|
Examples
|
||||||
|
-----------
|
||||||
|
>>> d.config = "/path/to/config/file.config"
|
||||||
|
|
||||||
|
"""
|
||||||
return NotImplementedError("config is set only")
|
return NotImplementedError("config is set only")
|
||||||
|
|
||||||
@config.setter
|
@config.setter
|
||||||
@ -83,6 +99,22 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def parameters(self):
|
def parameters(self):
|
||||||
|
"""Sets detector measurement parameters to those contained in fname. Set up per measurement.
|
||||||
|
|
||||||
|
Note
|
||||||
|
-----
|
||||||
|
Equivalent to config, but does not free shared memory.
|
||||||
|
|
||||||
|
|
||||||
|
:getter: Not implemented
|
||||||
|
:setter: loads parameters file
|
||||||
|
|
||||||
|
Example
|
||||||
|
---------
|
||||||
|
|
||||||
|
>>> d.parameters = 'path/to/file.par'
|
||||||
|
|
||||||
|
"""
|
||||||
return NotImplementedError("parameters is set only")
|
return NotImplementedError("parameters is set only")
|
||||||
|
|
||||||
@parameters.setter
|
@parameters.setter
|
||||||
@ -170,6 +202,9 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def exptime(self):
|
def exptime(self):
|
||||||
|
"""
|
||||||
|
Exposure time, accepts either a value in seconds or datetime.timedelta
|
||||||
|
"""
|
||||||
if self.type == detectorType.MYTHEN3:
|
if self.type == detectorType.MYTHEN3:
|
||||||
res = self.getExptimeForAllGates()
|
res = self.getExptimeForAllGates()
|
||||||
else:
|
else:
|
||||||
@ -203,7 +238,6 @@ class Detector(CppDetectorApi):
|
|||||||
def delayl(self):
|
def delayl(self):
|
||||||
return ut.reduce_time(self.getDelayAfterTriggerLeft())
|
return ut.reduce_time(self.getDelayAfterTriggerLeft())
|
||||||
|
|
||||||
|
|
||||||
# Time
|
# Time
|
||||||
@property
|
@property
|
||||||
def rx_framescaught(self):
|
def rx_framescaught(self):
|
||||||
@ -216,6 +250,7 @@ class Detector(CppDetectorApi):
|
|||||||
@startingfnum.setter
|
@startingfnum.setter
|
||||||
def startingfnum(self, value):
|
def startingfnum(self, value):
|
||||||
self.setStartingFrameNumber(value)
|
self.setStartingFrameNumber(value)
|
||||||
|
|
||||||
# TODO! add txdelay
|
# TODO! add txdelay
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -282,6 +317,7 @@ class Detector(CppDetectorApi):
|
|||||||
@property
|
@property
|
||||||
def rx_lastclient(self):
|
def rx_lastclient(self):
|
||||||
return element_if_equal(self.getRxLastClientIP())
|
return element_if_equal(self.getRxLastClientIP())
|
||||||
|
|
||||||
# FILE
|
# FILE
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -655,6 +691,7 @@ class Detector(CppDetectorApi):
|
|||||||
"""
|
"""
|
||||||
Some Eiger stuff, does this have to be here or can we move it to subclass?
|
Some Eiger stuff, does this have to be here or can we move it to subclass?
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def subexptime(self):
|
def subexptime(self):
|
||||||
res = self.getSubExptime()
|
res = self.getSubExptime()
|
||||||
@ -731,7 +768,6 @@ class Detector(CppDetectorApi):
|
|||||||
res = self.getMeasuredSubFramePeriod()
|
res = self.getMeasuredSubFramePeriod()
|
||||||
return element_if_equal([it.total_seconds() for it in res])
|
return element_if_equal([it.total_seconds() for it in res])
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Jungfrau specific
|
Jungfrau specific
|
||||||
"""
|
"""
|
||||||
@ -801,7 +837,6 @@ class Detector(CppDetectorApi):
|
|||||||
def temp_control(self, value):
|
def temp_control(self, value):
|
||||||
self.setTemperatureControl(value)
|
self.setTemperatureControl(value)
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@element
|
@element
|
||||||
def selinterface(self):
|
def selinterface(self):
|
||||||
@ -818,13 +853,15 @@ class Detector(CppDetectorApi):
|
|||||||
@property
|
@property
|
||||||
@element
|
@element
|
||||||
def veto(self):
|
def veto(self):
|
||||||
|
"""
|
||||||
|
[Gotthard2] Enable or disable veto data streaming from detector. Default is 0.
|
||||||
|
"""
|
||||||
return self.getVeto()
|
return self.getVeto()
|
||||||
|
|
||||||
@veto.setter
|
@veto.setter
|
||||||
def veto(self, value):
|
def veto(self, value):
|
||||||
self.setVeto(value)
|
self.setVeto(value)
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Mythen3 specific
|
Mythen3 specific
|
||||||
"""
|
"""
|
||||||
@ -844,6 +881,9 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def counters(self):
|
def counters(self):
|
||||||
|
"""
|
||||||
|
[Mythen3] List of counters enabled. Each element in list can be 0 - 2 and must be non repetitive.
|
||||||
|
"""
|
||||||
mask = self.getCounterMask()
|
mask = self.getCounterMask()
|
||||||
mask = element_if_equal(mask)
|
mask = element_if_equal(mask)
|
||||||
if type(mask) == int:
|
if type(mask) == int:
|
||||||
|
Reference in New Issue
Block a user