mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-07 10:30:41 +02:00
Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer
This commit is contained in:
commit
c4fde7f7bc
@ -74,15 +74,15 @@ But lets start looking at the at the manual way:
|
|||||||
::
|
::
|
||||||
|
|
||||||
import time
|
import time
|
||||||
from slsdet import Eiger
|
from slsdet import Eiger, runStatus
|
||||||
d = Eiger()
|
d = Eiger()
|
||||||
|
|
||||||
n = 10
|
n = 10
|
||||||
t = 1
|
t = 1
|
||||||
|
|
||||||
d.exposure_time = t
|
d.exptime = t
|
||||||
d.n_frames = n
|
d.frames = n
|
||||||
d.reset_frames_caught()
|
|
||||||
|
|
||||||
#Start the measurement
|
#Start the measurement
|
||||||
t0 = time.time()
|
t0 = time.time()
|
||||||
@ -93,18 +93,16 @@ But lets start looking at the at the manual way:
|
|||||||
time.sleep(t*n)
|
time.sleep(t*n)
|
||||||
|
|
||||||
#check if the detector is ready otherwise wait a bit longer
|
#check if the detector is ready otherwise wait a bit longer
|
||||||
while d.status != 'idle':
|
while d.status != runStatus.IDLE:
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
|
|
||||||
#Stop the receiver after we got the frames
|
#Stop the receiver after we got the frames
|
||||||
#Detector is already idle so we don't need to stop it
|
#Detector is already idle so we don't need to stop it
|
||||||
d.stopReceiver()
|
d.stopReceiver()
|
||||||
|
|
||||||
lost = d.frames_caught - n
|
lost = d.rx_framescaught - n
|
||||||
print(f'{n} frames of {t}s took {time.time()-t0:{.3}}s with {lost} frames lost ')
|
print(f'{n} frames of {t}s took {time.time()-t0:{.3}}s with {lost} frames lost ')
|
||||||
|
|
||||||
#Reset to not interfere with a potential next measurement
|
|
||||||
d.reset_frames_caught()
|
|
||||||
|
|
||||||
Instead launching d.acq() from a different process is a bit easier since the control of receiver and detector
|
Instead launching d.acq() from a different process is a bit easier since the control of receiver and detector
|
||||||
is handled in the acq call. However, you need to join the process used otherwise a lot of zombie processes would
|
is handled in the acq call. However, you need to join the process used otherwise a lot of zombie processes would
|
||||||
|
@ -215,6 +215,8 @@ class Detector(CppDetectorApi):
|
|||||||
|
|
||||||
@exptime.setter
|
@exptime.setter
|
||||||
def exptime(self, t):
|
def exptime(self, t):
|
||||||
|
if isinstance(t, int):
|
||||||
|
t = float(t)
|
||||||
self.setExptime(t)
|
self.setExptime(t)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -704,6 +706,10 @@ class Detector(CppDetectorApi):
|
|||||||
def vthreshold(self):
|
def vthreshold(self):
|
||||||
return element_if_equal(self.getDAC(dacIndex.VTHRESHOLD, False))
|
return element_if_equal(self.getDAC(dacIndex.VTHRESHOLD, False))
|
||||||
|
|
||||||
|
@vthreshold.setter
|
||||||
|
def vthreshold(self, value):
|
||||||
|
self.setDAC(dacIndex.VTHRESHOLD, value, False)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def type(self):
|
def type(self):
|
||||||
return element_if_equal(self.getDetectorType())
|
return element_if_equal(self.getDetectorType())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user