example and updated python bindings

This commit is contained in:
Erik Frojdh
2020-08-20 12:19:35 +02:00
parent a7cc2b38d8
commit 8ef6f32be6
2 changed files with 113 additions and 12 deletions

View File

@ -134,4 +134,35 @@ hang around until the main process exits.
time.sleep(0.1)
#Join the process
p.join()
p.join()
------------------------------
Setting and getting times
------------------------------
::
import datetime as dt
from slsdet import Detector
d = Detector()
# The simplest way is to set the exposure time in
# seconds by using the exptime property
# This sets the exposure time for all modules
d.exptime = 0.5
# exptime also accepts a python datetime.timedelta
# which can be used to set the time in almost any unit
t = dt.timedelta(milliseconds = 2.3)
d.exptime = t
# or combination of units
t = dt.timedelta(minutes = 3, seconds = 1.23)
d.exptime = t
#exptime however always returns the time in seconds
>>> d.exptime
181.23