Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cfel-sc-public
Kamzik3
Commits
72065d9f
Commit
72065d9f
authored
May 18, 2022
by
Jerome Carnis
🦊
Browse files
deviceEigerP11.py: fix parameter names in exposed methods
parent
656317ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
kamzik3/devices/deviceEigerP11.py
View file @
72065d9f
...
...
@@ -130,13 +130,13 @@ class DeviceTangoEigerDetector(DeviceTango):
self
.
set_attribute
([
"EigerStream"
,
"ImageAppendix"
,
VALUE
],
path
)
@
expose_method
({
"Name"
:
"FilePrefix"
,
"Exposure"
:
"FrameTime"
,
"Frames"
:
"Nimages"
})
def
acquire_frame
(
self
,
Name
,
e
xposure
,
f
rames
):
frames
=
int
(
self
.
to_device_unit
(
"Nimages"
,
f
rames
).
m
)
def
acquire_frame
(
self
,
Name
,
E
xposure
,
F
rames
):
nb_
frames
=
int
(
self
.
to_device_unit
(
"Nimages"
,
F
rames
).
m
)
self
.
_config_interface
(
saving_directory
=
"shotDir"
,
prefix
=
Name
,
nb_frames
=
frames
saving_directory
=
"shotDir"
,
prefix
=
Name
,
nb_frames
=
nb_
frames
)
exposure
=
float
(
self
.
to_device_unit
(
"FrameTime"
,
e
xposure
).
m
)
exposure
=
float
(
self
.
to_device_unit
(
"FrameTime"
,
E
xposure
).
m
)
# According to Jan 10ms is lowest frame time
frame_time
=
10e-3
if
exposure
<
10e-3
else
exposure
...
...
@@ -144,40 +144,43 @@ class DeviceTangoEigerDetector(DeviceTango):
self
.
set_attribute
([
"FrameTime"
,
VALUE
],
frame_time
)
self
.
set_attribute
([
"CountTime"
,
VALUE
],
exposure
)
self
.
set_attribute
([
"Ntrigger"
,
VALUE
],
1
)
self
.
set_attribute
([
"Nimages"
,
VALUE
],
frames
)
self
.
set_attribute
([
"Nimages"
,
VALUE
],
nb_
frames
)
self
.
Arm
()
self
.
Trigger
()
self
.
set_value
(
ATTR_FRAME_COUNT
,
self
.
get_value
(
ATTR_FRAME_COUNT
)
+
frames
)
self
.
set_value
(
ATTR_FRAME_COUNT
,
self
.
get_value
(
ATTR_FRAME_COUNT
)
+
nb_
frames
)
@
expose_method
({
"Exposure"
:
"FrameTime"
})
def
live_view
(
self
,
e
xposure
):
def
live_view
(
self
,
E
xposure
):
"""
Live view of the Eiger detector.
This is useful when aligning the optics or the sample. Images will not be saved.
:param
e
xposure: desired exposure time per frame
:param
E
xposure: desired exposure time per frame
"""
frames_per_file
=
1000000
self
.
logger
.
info
(
"Live view has started."
)
self
.
set_attribute
([
"TriggerMode"
,
VALUE
],
3
)
if
self
.
file_writer
is
not
None
:
self
.
logger
.
info
(
"FileWriter disabled"
)
self
.
set_attribute
([
"FileWriter"
,
"Mode"
,
VALUE
],
1
)
self
.
set_attribute
([
"FileWriter"
,
"NimagesPerFile"
,
VALUE
],
1000000
)
self
.
set_attribute
([
"FileWriter"
,
"NimagesPerFile"
,
VALUE
],
frames_per_file
)
if
self
.
eiger_stream
is
not
None
:
self
.
logger
.
info
(
"EigerStream disabled"
)
self
.
set_attribute
([
"EigerStream"
,
"Mode"
,
VALUE
],
1
)
exposure
=
float
(
self
.
to_device_unit
(
"FrameTime"
,
e
xposure
).
m
)
exposure
=
float
(
self
.
to_device_unit
(
"FrameTime"
,
E
xposure
).
m
)
# According to Jan Meyer 10ms is the lowest frame time
frame_time
=
10e-3
if
exposure
<
10e-3
else
exposure
self
.
set_attribute
([
"FrameTime"
,
VALUE
],
frame_time
)
self
.
set_attribute
([
"CountTime"
,
VALUE
],
exposure
)
self
.
set_attribute
([
"Ntrigger"
,
VALUE
],
1
)
self
.
set_attribute
([
"Nimages"
,
VALUE
],
1000000
)
self
.
set_attribute
([
"Nimages"
,
VALUE
],
frames_per_file
)
self
.
Arm
()
self
.
Trigger
()
self
.
set_value
(
ATTR_FRAME_COUNT
,
self
.
get_value
(
ATTR_FRAME_COUNT
)
+
1000000
)
self
.
set_value
(
ATTR_FRAME_COUNT
,
self
.
get_value
(
ATTR_FRAME_COUNT
)
+
frames_per_file
)
@
expose_method
()
def
stop
(
self
):
...
...
@@ -242,11 +245,11 @@ class EigerTrigger(Device):
)
@
expose_method
({
"Exposure"
:
ATTR_TRIGGER_PULSE_WIDTH
,
"Frames"
:
ATTR_TRIGGERS_SP
})
def
acquire_frame
(
self
,
e
xposure
,
f
rames
):
frames
=
self
.
to_device_unit
(
ATTR_TRIGGERS_SP
,
f
rames
).
m
exposure
=
self
.
to_device_unit
(
ATTR_TRIGGER_PULSE_WIDTH
,
e
xposure
).
m
self
.
set_value
(
ATTR_TRIGGERS_SP
,
frames
)
self
.
set_value
(
ATTR_TRIGGER_PULSE_WIDTH
,
exposure
)
def
acquire_frame
(
self
,
E
xposure
,
F
rames
):
nb_
frames
=
self
.
to_device_unit
(
ATTR_TRIGGERS_SP
,
F
rames
).
m
exposure
_time
=
self
.
to_device_unit
(
ATTR_TRIGGER_PULSE_WIDTH
,
E
xposure
).
m
self
.
set_value
(
ATTR_TRIGGERS_SP
,
nb_
frames
)
self
.
set_value
(
ATTR_TRIGGER_PULSE_WIDTH
,
exposure
_time
)
self
.
set_value
(
ATTR_TRIGGERS_GENERATED
,
0
)
Thread
(
target
=
self
.
_acquisition_thread
).
start
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment