Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
experiment-control
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
whuie2
experiment-control
Commits
73c35047
Commit
73c35047
authored
3 years ago
by
Yb Tweezer
Browse files
Options
Downloads
Patches
Plain Diff
fix timings
parent
c69b45b9
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mot_transfer.py
+16
-8
16 additions, 8 deletions
mot_transfer.py
mot_transfer_temperature.py
+17
-17
17 additions, 17 deletions
mot_transfer_temperature.py
with
33 additions
and
25 deletions
mot_transfer.py
+
16
−
8
View file @
73c35047
...
...
@@ -24,10 +24,17 @@ camera_config = {
}
# CONSTRUCT SEQUENCE
t0
=
2.5
# big coils start turning off at t0
t0
=
1.8
# big coils start turning off at t0
R
=
3
# repetition for each tau
tau_
=
np
.
array
([
np
.
linspace
(
6.5e-3
,
86.5e-3
,
11
)
for
k
in
range
(
R
)]).
T
.
flatten
()
z
=
int
(
np
.
ceil
(
np
.
log10
(
tau_
.
shape
[
0
])))
#TAU = np.array([np.linspace(6.5e-3, 506.5e-3, 16) for k in range(R)]).T.flatten()
TAU
=
np
.
array
([
[
6.5e-3
,
8e-3
,
10e-3
,
12e-3
,
14e-3
,
16e-3
,
18e-3
,
20e-3
,
100e-3
,
120e-3
,
140e-3
,
160e-3
,
240e-3
,
260e-3
,
280e-3
,
300e-3
,
]
for
k
in
range
(
R
)
]).
T
.
flatten
()
z
=
int
(
np
.
ceil
(
np
.
log10
(
R
)))
def
make_sequence
(
tau
,
name
=
None
):
name
=
f
"
tau=
{
tau
:
.
5
f
}
"
if
name
is
None
else
name
...
...
@@ -120,9 +127,10 @@ class MOTTransfer(Controller):
def
postcmd
(
self
,
*
args
):
self
.
comp
.
disconnect
()
self
.
cam
.
disconnect
()
def
run_sequence
(
self
,
*
args
):
for
k
,
tau
in
enumerate
(
tau_
):
for
k
,
tau
in
enumerate
(
TAU
):
sseq
=
make_sequence
(
tau
,
f
"
tau=
{
tau
:
.
5
f
}
_
{
str
(
k
%
R
).
zfill
(
z
)
:
s
}
"
)
(
self
.
comp
.
enqueue
(
sseq
.
to_sequence
())
...
...
@@ -138,9 +146,9 @@ class MOTTransfer(Controller):
sseq_bkgd
.
save
()
def
run_camera
(
self
,
*
args
):
frames
=
self
.
cam
.
acquire_frames
(
len
(
tau_
)
+
1
)
frames
=
self
.
cam
.
acquire_frames
(
len
(
TAU
)
+
1
)
arrays
=
{
f
"
tau=
{
tau_
[
k
]
:
.
5
f
}
_
{
str
(
k
%
R
).
zfill
(
z
)
:
s
}
"
:
frame
f
"
tau=
{
TAU
[
k
]
:
.
5
f
}
_
{
str
(
k
%
R
).
zfill
(
z
)
:
s
}
"
:
frame
for
k
,
frame
in
enumerate
(
frames
[:
-
1
])
}
arrays
.
update
({
"
background
"
:
frames
[
-
1
]})
...
...
@@ -152,10 +160,10 @@ class MOTTransfer(Controller):
)
data
.
compute_results
(
subtract_bkgd
=
False
)
data
.
save
()
data
.
render_arrays
()
#
data.render_arrays()
def
cmd_visualize
(
self
,
*
args
):
(
make_sequence
(
float
(
args
[
0
])
if
len
(
args
)
>
0
else
tau_
.
max
())
(
make_sequence
(
float
(
args
[
0
])
if
len
(
args
)
>
0
else
TAU
.
max
())
.
draw_detailed
().
show
().
close
()
)
sys
.
exit
(
0
)
...
...
This diff is collapsed.
Click to expand it.
mot_transfer_temperature.py
+
17
−
17
View file @
73c35047
...
...
@@ -3,7 +3,7 @@ from lib import *
from
lib
import
CONNECTIONS
as
C
import
sys
,
pathlib
raise
Exception
(
"
This script is outdated: needs timing updates
"
)
#
raise Exception("This script is outdated: needs timing updates")
outdir
=
DATADIRS
.
mot_transfer
.
joinpath
(
get_timestamp
())
...
...
@@ -25,7 +25,7 @@ camera_config = {
t0
=
2.25
# big coils start turn off at t0
R
=
3
# repetition for each tau
G
=
50e-3
# keep the green MOT on for G seconds
tau_
=
np
.
array
([
np
.
linspace
(
0.0e-3
,
100.0e-3
,
11
)
for
k
in
range
(
R
)]).
T
.
flatten
()
TAU
=
np
.
array
([
np
.
linspace
(
0.0e-3
,
100.0e-3
,
11
)
for
k
in
range
(
R
)]).
T
.
flatten
()
z
=
int
(
np
.
ceil
(
np
.
log10
(
R
)))
def
make_sequence
(
tau
,
name
=
None
):
...
...
@@ -49,7 +49,7 @@ def make_sequence(tau, name=None):
"
MOT coils 2
"
:
(
Sequence
.
digital_hilo
(
*
C
.
mot3_coils_igbt
,
t0
+
G
+
tau
-
4.5
e-3
,
t0
+
G
+
tau
+
100e-3
)
t0
+
G
+
tau
-
6.8
e-3
,
t0
+
G
+
tau
+
100e-3
)
).
with_color
(
"
C1
"
).
with_stack_idx
(
2
),
"
Blue beams 1
"
:
(
Sequence
...
...
@@ -58,11 +58,11 @@ def make_sequence(tau, name=None):
"
Blue beams 2
"
:
(
Sequence
.
digital_hilo
(
*
C
.
mot3_blue_sh
,
t0
+
G
+
tau
-
1
e-3
,
t0
+
G
+
tau
+
100e-3
)
t0
+
G
+
tau
-
3
e-3
,
t0
+
G
+
tau
+
100e-3
)
).
with_color
(
"
C0
"
).
with_stack_idx
(
5
),
"
MOT shims
"
:
(
Sequence
.
digital_hilo
(
*
C
.
mot3_shims_onoff
,
t0
-
1
e-3
,
t0
+
G
-
1e-3
)
.
digital_hilo
(
*
C
.
mot3_shims_onoff
,
t0
-
0.5
e-3
,
t0
+
G
)
).
with_color
(
"
C1
"
).
with_stack_idx
(
3
),
"
Green beams
"
:
(
Sequence
...
...
@@ -78,23 +78,23 @@ def make_sequence(tau, name=None):
sseq_bkgd
=
SuperSequence
(
outdir
.
joinpath
(
"
sequences
"
),
f
"
background
"
,
{
"
Sequence
"
:
(
Sequence
.
digital_hilo
(
*
C
.
dummy
,
0.0
,
1
00e-3
)
.
digital_hilo
(
*
C
.
dummy
,
0.0
,
2
00e-3
)
),
"
Push
"
:
(
Sequence
.
digital_lohi
(
*
C
.
push_sh
,
0.0
,
1
00e-3
)
.
digital_lohi
(
*
C
.
push_sh
,
0.0
,
2
00e-3
)
),
"
MOT beams
"
:
(
Sequence
.
digital_lohi
(
*
C
.
mot3_blue_sh
,
0.0
,
50e-3
)
.
digital_lohi
(
*
C
.
mot3_blue_sh
,
0.0
,
1
50e-3
)
),
"
MOT coils
"
:
(
Sequence
.
digital_hilo
(
*
C
.
mot3_coils_igbt
,
0.0
,
1
00e-3
)
.
digital_hilo
(
*
C
.
mot3_coils_onoff
,
0.0
,
1
00e-3
)
.
digital_hilo
(
*
C
.
mot3_coils_igbt
,
0.0
,
2
00e-3
)
.
digital_hilo
(
*
C
.
mot3_coils_onoff
,
0.0
,
2
00e-3
)
),
"
Camera
"
:
(
Sequence
.
digital_pulse
(
*
C
.
flir_trig
,
80e-3
,
camera_config
[
"
exposure_time
"
]
*
1e-6
)
.
digital_pulse
(
*
C
.
flir_trig
,
1
80e-3
,
camera_config
[
"
exposure_time
"
]
*
1e-6
)
),
"
Scope
"
:
(
Sequence
.
digital_hilo
(
*
C
.
scope_trig
,
0.0
,
1
00e-3
)
.
digital_hilo
(
*
C
.
scope_trig
,
0.0
,
2
00e-3
)
),
},
C
)
...
...
@@ -122,7 +122,7 @@ class MOTTransferTemperature(Controller):
self
.
comp
.
disconnect
()
def
run_sequence
(
self
,
*
args
):
for
k
,
tau
in
enumerate
(
tau_
):
for
k
,
tau
in
enumerate
(
TAU
):
sseq
=
make_sequence
(
tau
,
f
"
tau=
{
tau
:
.
5
f
}
_
{
str
(
k
%
R
).
zfill
(
z
)
:
s
}
"
)
(
self
.
comp
.
enqueue
(
sseq
.
to_sequence
())
...
...
@@ -138,10 +138,10 @@ class MOTTransferTemperature(Controller):
sseq_bkgd
.
save
()
def
run_camera
(
self
,
*
args
):
frames
=
self
.
cam
.
acquire_frames
(
len
(
tau_
)
+
1
)
frames
=
self
.
cam
.
acquire_frames
(
len
(
TAU
)
+
1
)
arrays
=
{
f
"
tau=
{
tau
:
.
5
f
}
_
{
str
(
k
%
R
).
zfill
(
z
)
:
s
}
"
:
frame
for
k
,
(
tau
,
frame
)
in
enumerate
(
zip
(
tau_
,
frames
[:
-
1
]))
for
k
,
(
tau
,
frame
)
in
enumerate
(
zip
(
TAU
,
frames
[:
-
1
]))
}
arrays
.
update
({
"
background
"
:
frames
[
-
1
]})
data
=
FluorescenceData
(
...
...
@@ -152,10 +152,10 @@ class MOTTransferTemperature(Controller):
)
data
.
compute_results
(
subtract_bkgd
=
False
)
data
.
save
()
data
.
render_arrays
()
#
data.render_arrays()
def
cmd_visualize
(
self
,
*
args
):
(
make_sequence
(
float
(
args
[
0
])
if
len
(
args
)
>
0
else
tau_
.
max
())
(
make_sequence
(
float
(
args
[
0
])
if
len
(
args
)
>
0
else
TAU
.
max
())
.
draw_detailed
().
show
().
close
()
)
sys
.
exit
(
0
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment