mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-05-02 10:50:05 +02:00
added examples
This commit is contained in:
parent
8ef6f32be6
commit
1f811dfabd
30
python/examples/exposure_time.py
Normal file
30
python/examples/exposure_time.py
Normal file
@ -0,0 +1,30 @@
|
||||
"""
|
||||
Example showing how to set and get exposure 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
|
13
python/examples/reading_temperature.py
Normal file
13
python/examples/reading_temperature.py
Normal file
@ -0,0 +1,13 @@
|
||||
from slsdet import Detector, Eiger, dacIndex
|
||||
|
||||
|
||||
|
||||
#Using the general detector class and calling with an index
|
||||
d = Detector()
|
||||
fpga_temp = d.getTemperature(dacIndex.TEMPERATURE_FPGA)
|
||||
print(f'fpga_temp: {fpga_temp}\n')
|
||||
|
||||
#Using the specialized detector class
|
||||
e = Eiger()
|
||||
print("All temperatures for Eiger\n")
|
||||
print(e.temp)
|
Loading…
x
Reference in New Issue
Block a user