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
ID11
id11
Commits
c074097e
Commit
c074097e
authored
Jun 29, 2020
by
Emmanuel Papillon
Browse files
ftimescan + fscan id11 implementation
parent
2d483140
Changes
1
Hide whitespace changes
Inline
Side-by-side
id11/scans/fscans.py
View file @
c074097e
import
gevent
import
time
from
fscan.fscanrunner
import
FScanRunner
from
fscan.fscanrunner
import
FScanRunner
,
FScanDiagRunner
class
ID11CameraCalib
:
...
...
@@ -68,6 +68,7 @@ class ID11FTimeScan(FScanRunner):
def
__init__
(
self
,
scanname
,
scanmaster
,
fshutter
):
self
.
_fsh
=
fshutter
self
.
_calib
=
ID11CameraCalib
()
self
.
_min_latency_time
=
1e-5
super
().
__init__
(
scanname
,
scanmaster
)
def
validate
(
self
):
...
...
@@ -76,17 +77,45 @@ class ID11FTimeScan(FScanRunner):
# --- check minimum period
limadevs
=
self
.
_master
.
get_controllers_found
(
"lima"
)
readout_time
=
self
.
_calib
.
calibrate
(
limadevs
,
pars
.
acq_time
,
self
.
_fsh
.
shutter_time
)
min_period
=
pars
.
acq_time
+
readout_time
+
1e-4
min_period
=
pars
.
acq_time
+
readout_time
+
self
.
_latency_time
if
pars
.
period
<
min_period
:
pars
.
period
=
min_period
super
().
validate
()
def
__call__
(
self
,
acq_time
,
npoints
,
period
=
0.
,
start_delay
=
0.
):
def
__call__
(
self
,
acq_time
,
npoints
,
period
=
0.
,
**
kwargs
):
pars
=
dict
(
acq_time
=
acq_time
,
npoints
=
npoints
,
period
=
period
)
pars
.
update
(
kwargs
)
self
.
pars
.
set
(
**
pars
)
self
.
run
()
class
ID11FScan
(
FScanDiagRunner
):
def
__init__
(
self
,
scanname
,
scanmaster
,
fshutter
):
self
.
_fsh
=
fshutter
self
.
_calib
=
ID11CameraCalib
()
self
.
_min_latency_time
=
1e-5
super
().
__init__
(
scanname
,
scanmaster
)
def
validate
(
self
):
pars
=
self
.
pars
pars
.
acq_time
=
acq_time
pars
.
npoints
=
npoints
pars
.
period
=
period
# --- check minimum step_size
limadevs
=
self
.
_master
.
get_controllers_found
(
"lima"
)
readout_time
=
self
.
_calib
.
calibrate
(
limadevs
,
pars
.
acq_time
,
self
.
_fsh
.
shutter_time
)
if
pars
.
latency_time
<
self
.
_min_latency_time
:
pars
.
latency_time
=
self
.
_min_latency_time
min_step_time
=
pars
.
acq_time
+
readout_time
+
pars
.
latency_time
if
pars
.
step_time
<
min_step_time
:
pars
.
step_time
=
min_step_time
super
().
validate
()
pars
.
step_time
=
0.
def
__call__
(
self
,
motor
,
start_pos
,
step_size
,
npoints
,
acq_time
,
**
kwargs
):
pars
=
dict
(
motor
=
motor
,
start_pos
=
start_pos
,
step_size
=
step_size
,
npoints
=
npoints
,
acq_time
=
acq_time
,
step_time
=
0.
)
pars
.
update
(
kwargs
)
self
.
pars
.
set
(
**
kwargs
)
self
.
run
()
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