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
a51dc512
Commit
a51dc512
authored
3 years ago
by
Yb Tweezer
Browse files
Options
Downloads
Patches
Plain Diff
parameter adjustment and add tau_pause between tau_ncool and tau_twzr_load
parent
c6f6ecda
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
narrow_cooling_tweezer_align.py
+107
-80
107 additions, 80 deletions
narrow_cooling_tweezer_align.py
with
107 additions
and
80 deletions
narrow_cooling_tweezer_align.py
+
107
−
80
View file @
a51dc512
...
@@ -35,7 +35,7 @@ camera_config = {
...
@@ -35,7 +35,7 @@ camera_config = {
## MAIN SEQUENCE PARAMETERS
## MAIN SEQUENCE PARAMETERS
# general
# general
reps
=
50
# repeat shots for statistics
reps
=
50
0
# repeat shots for statistics
clk_freq
=
10e6
# serial_bits clock frequency; Hz
clk_freq
=
10e6
# serial_bits clock frequency; Hz
take_background
=
False
# include a background image
take_background
=
False
# include a background image
flir_two_shots
=
False
# use the Flir to take two shots
flir_two_shots
=
False
# use the Flir to take two shots
...
@@ -43,12 +43,12 @@ check_556_tweezer = False # use the 556 tweezer instead of the probe beams
...
@@ -43,12 +43,12 @@ check_556_tweezer = False # use the 556 tweezer instead of the probe beams
# timings (not to scale)
# timings (not to scale)
# | tau_all |
# | tau_all |
# start | t0 |
tau_ncool
| tau_twzr_load | tau_hold | tau_pp | tau_dark | tau_probe | end
# start | t0 | tau_ncool
| tau_pause
| tau_twzr_load | tau_hold | tau_pp | tau_dark | tau_probe | end
# | | |
# |
|
| |
# <tau_comp> | |
# <tau_comp>
|
| |
# | <tau_flir>
|
# |
|
<tau_flir>
,<tau_flir_second>
|
# | | <tau_andor>
# | | <tau_andor>
# | t_ramp | tau_ramp |
# | t_ramp | tau_ramp |
... |
# |
# |
# <tau_ref>
# <tau_ref>
t0
=
300e-3
# transfer to green MOT; s
t0
=
300e-3
# transfer to green MOT; s
...
@@ -57,28 +57,31 @@ tau_blue_overlap = 2e-3 # overlap time of blue beams with green beams relative t
...
@@ -57,28 +57,31 @@ tau_blue_overlap = 2e-3 # overlap time of blue beams with green beams relative t
tau_ncool
=
100e-3
# narrow cooling/compression time; s
tau_ncool
=
100e-3
# narrow cooling/compression time; s
tau_comp
=
46e-3
# start compression ramping relative to beginning of narrow cooling; s
tau_comp
=
46e-3
# start compression ramping relative to beginning of narrow cooling; s
T_COMP
=
t0
+
tau_comp
+
np
.
linspace
(
0.0
,
4e-3
,
51
)
# compression ramp times
T_COMP
=
t0
+
tau_comp
+
np
.
linspace
(
0.0
,
4e-3
,
51
)
# compression ramp times
tau_twzr_load
=
50e-3
# time to load into tweezers; s
tau_pause
=
0.75e-3
# pause between ncool and load; s
tau_hold
=
10e-3
# hold with CMOT beams at imaging (proxy) frequency
tau_twzr_load
=
2.5e-3
# time to load into tweezers; s
tau_hold
=
0e-3
# hold with CMOT beams at imaging (proxy) frequency
tau_dark
=
27e-3
# shutter opening time for EMCCD; s
tau_dark
=
27e-3
# shutter opening time for EMCCD; s
tau_pp
=
0e-3
# parity projection time; s
tau_pp
=
0e-3
# parity projection time; s
tau_probe
=
50e-3
# probe imaging time; s
tau_probe
=
30e-3
# probe imaging time; s
tau_all
=
tau_ncool
+
tau_twzr_load
+
tau_hold
+
tau_pp
+
tau_dark
+
tau_probe
# main sequence time; s
tau_all
=
(
# main sequence time; s
tau_ncool
+
tau_pause
+
tau_twzr_load
+
tau_hold
+
tau_pp
+
tau_dark
+
tau_probe
)
# camera timings
# camera timings
tau_flir
=
-
10e-3
# Flir camera time relative to end of narrow cooling; s
tau_flir
=
-
10e-3
# Flir camera time rel. to end of pause after narrow cooling; s
tau_flir_second
=
tau_twzr_load
+
tau_pp
+
tau_dark
+
0.1e-3
# second Flir shot relative to end of narrow cooling; s
tau_flir_second
=
tau_twzr_load
+
tau_pp
+
tau_dark
+
0.1e-3
# second Flir shot rel. to end of pause after narrow cooling; s
TAU_ANDOR
=
np
.
linspace
(
0.0e-3
,
400e-3
,
9
)
# EMCCD camera time relative to end of dark period; s
TAU_ANDOR
=
np
.
array
([
0.0e-3
])
# EMCCD camera time relative to end of dark period; s
TAU_ANDOR
=
np
.
array
([
0.0e-3
])
# tau_andor = -17.0e-3
# coil settings
# coil settings
SHIMS_FB
=
np
.
linspace
(
1.255
,
1.255
,
1
)
# Front/Back shim scans: 1.22; +1.2 for 174
SHIMS_FB
=
np
.
linspace
(
1.200
,
1.200
,
1
)
# Front/Back shim scans: 1.22; +1.2 for 174
SHIMS_LR
=
np
.
linspace
(
0.165
,
0.165
,
1
)
# Left/Right shim scans: 0.20; -0.2 for 174
SHIMS_LR
=
np
.
linspace
(
0.125
,
0.125
,
1
)
# Left/Right shim scans: 0.20; -0.2 for 174
# SHIMS_LR = np.append(
SHIMS_UD
=
np
.
linspace
(
0.580
,
0.580
,
1
)
# Up/Down shim scans: 0.57; +0.4 for 174
# np.linspace(-0.30, -0.12, 5),
# np.linspace(+0.12, +0.30, 5),
# )
SHIMS_UD
=
np
.
linspace
(
0.565
,
0.565
,
1
)
# Up/Down shim scans: 0.57; +0.4 for 174
B_blue
=
int
(
441815
)
# blue MOT gradient setting
B_blue
=
int
(
441815
)
# blue MOT gradient setting
B_green
=
int
(
44182
*
1.25
)
# 174: 1.25 -> 1.1
B_green
=
int
(
44182
*
1.25
)
# 174: 1.25 -> 1.1
bits_Bset
=
int
(
20
)
# number of bits in a servo setting
bits_Bset
=
int
(
20
)
# number of bits in a servo setting
...
@@ -86,10 +89,9 @@ bits_DACset = int(4) # number of bits in a DAC-mode setting
...
@@ -86,10 +89,9 @@ bits_DACset = int(4) # number of bits in a DAC-mode setting
B_COMP
=
np
.
linspace
(
B_green
,
B_green
*
1.8
,
T_COMP
.
shape
[
0
])
# compression ramp values
B_COMP
=
np
.
linspace
(
B_green
,
B_green
*
1.8
,
T_COMP
.
shape
[
0
])
# compression ramp values
# detunings
# detunings
DET_MOT
=
np
.
linspace
(
+
0.9
,
+
0.9
,
1
)
# green MOT detuning for tweezer loading (rel. to CMOT); MHz
DET_MOT
=
np
.
linspace
(
+
1.3
,
+
1.3
,
1
)
# green MOT detuning for tweezer loading (rel. to CMOT); MHz
DET_PROBE_PROXY
=
3.68
+
np
.
linspace
(
-
1.0
,
+
1.0
,
11
)
# imaging conditions proxy using CMOT beams (rel. to AOM center); MHz
DET_PROBE_PROXY
=
3.68
+
np
.
linspace
(
+
0.8
,
+
0.8
,
1
)
# imaging conditions proxy using CMOT beams (rel. to AOM center); MHz
DET_PROBE
=
3.68
+
np
.
linspace
(
-
0.4
,
-
0.4
,
1
)
# probe beam detuning for imaging (rel. to AOM center); MHz
DET_PROBE
=
3.68
+
np
.
linspace
(
-
0.3
,
-
0.3
,
1
)
# probe beam detuning for imaging (rel. to AOM center); MHz
# DET_PP = 3.68 + np.linspace(-1.0, +1.0, 11) # green MOT detuning for parity projection (rel. to AOM center); MHz
DET_PP
=
3.68
+
np
.
linspace
(
+
0.8
,
+
0.8
,
1
)
DET_PP
=
3.68
+
np
.
linspace
(
+
0.8
,
+
0.8
,
1
)
det_block
=
10
# shift the RF on the MOT beams to decouple the fiber; MHz
det_block
=
10
# shift the RF on the MOT beams to decouple the fiber; MHz
det_556_tweezer
=
3.68
# detuning on the 556 tweezer (probe) path (rel. to AOM center); MHz
det_556_tweezer
=
3.68
# detuning on the 556 tweezer (probe) path (rel. to AOM center); MHz
...
@@ -113,16 +115,21 @@ p_ramp_end = 0.0 # end of ramp; dBm
...
@@ -113,16 +115,21 @@ p_ramp_end = 0.0 # end of ramp; dBm
p_probe
=
14.0
# power in probe beam AOMs; dBm
p_probe
=
14.0
# power in probe beam AOMs; dBm
p_556_tweezer
=
-
10.0
# power in the 556 tweezer (probe) AOM; dBm
p_556_tweezer
=
-
10.0
# power in the 556 tweezer (probe) AOM; dBm
def
make_sequence
(
name
:
str
,
shim_fb
:
float
,
shim_lr
:
float
,
shim_ud
:
float
,
tau_andor
:
float
)
\
allvars
=
{
k
:
list
(
v
)
if
isinstance
(
v
,
np
.
ndarray
)
else
v
for
k
,
v
in
vars
().
items
()
if
isinstance
(
v
,
(
str
,
int
,
float
,
complex
,
tuple
,
list
,
dict
,
np
.
ndarray
))
}
def
make_sequence
(
shim_fb
:
float
,
shim_lr
:
float
,
shim_ud
:
float
,
tau_andor
:
float
)
\
->
SuperSequence
:
->
SuperSequence
:
SEQ
=
SuperSequence
(
SEQ
=
SuperSequence
(
outdir
.
joinpath
(
"
sequences
"
),
outdir
.
joinpath
(
"
sequences
"
),
name
,
f
"
fb=
{
shim_fb
:
.
5
f
}
_lr=
{
shim_lr
:
.
5
f
}
_ud=
{
shim_ud
:
.
5
f
}
_tau-andor=
{
tau_andor
:
.
5
f
}
"
,
{
{
"
Flir
"
:
(
Sequence
()
"
Flir
"
:
(
Sequence
()
+
Sequence
.
digital_pulse
(
+
Sequence
.
digital_pulse
(
*
C
.
flir_trig
,
*
C
.
flir_trig
,
t0
+
tau_ncool
+
tau_flir
,
t0
+
tau_ncool
+
tau_pause
+
tau_flir
,
camera_config
[
"
exposure_time
"
]
*
1e-6
# convert back us -> s
camera_config
[
"
exposure_time
"
]
*
1e-6
# convert back us -> s
)
)
).
with_color
(
"
C2
"
),
).
with_color
(
"
C2
"
),
...
@@ -130,7 +137,7 @@ def make_sequence(name: str, shim_fb: float, shim_lr: float, shim_ud: float, tau
...
@@ -130,7 +137,7 @@ def make_sequence(name: str, shim_fb: float, shim_lr: float, shim_ud: float, tau
"
EMCCD
"
:
(
Sequence
()
"
EMCCD
"
:
(
Sequence
()
+
Sequence
.
digital_pulse
(
+
Sequence
.
digital_pulse
(
*
C
.
andor_trig
,
*
C
.
andor_trig
,
t0
+
tau_ncool
+
tau_twzr_load
+
tau_hold
+
tau_pp
+
tau_dark
+
tau_andor
-
27e-3
,
# shutter time
t0
+
tau_ncool
+
tau_pause
+
tau_twzr_load
+
tau_hold
+
tau_pp
+
tau_dark
+
tau_andor
-
27e-3
,
# shutter time
10e-3
# pulse length is arbitrary; currently set to exposure time
10e-3
# pulse length is arbitrary; currently set to exposure time
)
)
).
with_color
(
"
C2
"
),
).
with_color
(
"
C2
"
),
...
@@ -167,7 +174,7 @@ def make_sequence(name: str, shim_fb: float, shim_lr: float, shim_ud: float, tau
...
@@ -167,7 +174,7 @@ def make_sequence(name: str, shim_fb: float, shim_lr: float, shim_ud: float, tau
"
MOT servo off
"
:
(
Sequence
()
"
MOT servo off
"
:
(
Sequence
()
+
Sequence
.
serial_bits_c
(
+
Sequence
.
serial_bits_c
(
C
.
mot3_coils_sig
,
C
.
mot3_coils_sig
,
t0
+
tau_ncool
+
tau_twzr_load
,
# time for MOT to disperse
t0
+
tau_ncool
+
tau_pause
+
tau_twzr_load
,
# time for MOT to disperse
0
,
bits_Bset
,
# turn off to disperse MOT before imaging
0
,
bits_Bset
,
# turn off to disperse MOT before imaging
AD5791_DAC
,
bits_DACset
,
AD5791_DAC
,
bits_DACset
,
C
.
mot3_coils_clk
,
C
.
mot3_coils_sync
,
C
.
mot3_coils_clk
,
C
.
mot3_coils_sync
,
...
@@ -257,8 +264,8 @@ def make_sequence(name: str, shim_fb: float, shim_lr: float, shim_ud: float, tau
...
@@ -257,8 +264,8 @@ def make_sequence(name: str, shim_fb: float, shim_lr: float, shim_ud: float, tau
# ]
# ]
+
Sequence
.
digital_hilo
(
+
Sequence
.
digital_hilo
(
*
C
.
mot3_green_sh
,
*
C
.
mot3_green_sh
,
t0
-
1
e-3
,
t0
-
3.8
e-3
,
t0
+
tau_ncool
+
tau_twzr_load
+
tau_hold
+
tau_pp
,
t0
+
tau_ncool
+
tau_pause
+
tau_twzr_load
+
tau_hold
+
tau_pp
,
)
)
+
Sequence
.
serial_bits_c
(
+
Sequence
.
serial_bits_c
(
...
@@ -302,7 +309,7 @@ def make_sequence(name: str, shim_fb: float, shim_lr: float, shim_ud: float, tau
...
@@ -302,7 +309,7 @@ def make_sequence(name: str, shim_fb: float, shim_lr: float, shim_ud: float, tau
SEQ
[
"
Flir
"
]
SEQ
[
"
Flir
"
]
+
Sequence
.
digital_pulse
(
+
Sequence
.
digital_pulse
(
*
C
.
flir_trig
,
*
C
.
flir_trig
,
t0
+
tau_ncool
+
tau_flir_second
,
t0
+
tau_ncool
+
tau_pause
+
tau_flir_second
,
camera_config
[
"
exposure_time
"
]
*
1e-6
# convert us -> s
camera_config
[
"
exposure_time
"
]
*
1e-6
# convert us -> s
)
)
).
with_color
(
"
C2
"
)
).
with_color
(
"
C2
"
)
...
@@ -310,18 +317,18 @@ def make_sequence(name: str, shim_fb: float, shim_lr: float, shim_ud: float, tau
...
@@ -310,18 +317,18 @@ def make_sequence(name: str, shim_fb: float, shim_lr: float, shim_ud: float, tau
SEQ
[
"
556 tweezer
"
]
=
(
Sequence
()
SEQ
[
"
556 tweezer
"
]
=
(
Sequence
()
+
Sequence
.
digital_pulse
(
+
Sequence
.
digital_pulse
(
*
C
.
tweezer_green_aom
,
*
C
.
tweezer_green_aom
,
t0
+
tau_ncool
,
t0
+
tau_ncool
+
tau_pause
,
camera_config
[
"
exposure_time
"
]
*
1e-6
# convert us -> s
camera_config
[
"
exposure_time
"
]
*
1e-6
# convert us -> s
+
2e-3
# make sure the tweezer is on while Flir is exposed
+
2e-3
# make sure the tweezer is on while Flir is exposed
)
)
+
Sequence
.
digital_pulse
(
+
Sequence
.
digital_pulse
(
*
C
.
tweezer_green_sh
,
*
C
.
tweezer_green_sh
,
t0
+
tau_ncool
-
5e-3
,
# shutter time and a bit extra for noise
t0
+
tau_ncool
+
tau_pause
-
5e-3
,
# shutter time and a bit extra for noise
camera_config
[
"
exposure_time
"
]
*
1e-6
+
10e-3
camera_config
[
"
exposure_time
"
]
*
1e-6
+
10e-3
)
)
# + Sequence.digital_pulse(
# + Sequence.digital_pulse(
# *C.probe_green_aom,
# *C.probe_green_aom,
# t0 + tau_ncool,
# t0 + tau_ncool
+ tau_pause
,
# camera_config["exposure_time"] * 1e-6 # convert us -> s
# camera_config["exposure_time"] * 1e-6 # convert us -> s
# + 2e-3 # make sure the tweezer is on while Flir is exposed
# + 2e-3 # make sure the tweezer is on while Flir is exposed
# )
# )
...
@@ -330,13 +337,13 @@ def make_sequence(name: str, shim_fb: float, shim_lr: float, shim_ud: float, tau
...
@@ -330,13 +337,13 @@ def make_sequence(name: str, shim_fb: float, shim_lr: float, shim_ud: float, tau
SEQ
[
"
Green imaging
"
]
=
(
Sequence
()
SEQ
[
"
Green imaging
"
]
=
(
Sequence
()
+
Sequence
.
digital_pulse
(
+
Sequence
.
digital_pulse
(
*
C
.
probe_green_aom
,
*
C
.
probe_green_aom
,
t0
+
tau_ncool
+
tau_twzr_load
+
tau_hold
+
tau_pp
+
tau_dark
,
t0
+
tau_ncool
+
tau_pause
+
tau_twzr_load
+
tau_hold
+
tau_pp
+
tau_dark
,
tau_probe
,
tau_probe
,
invert
=
True
invert
=
True
)
)
# + Sequence.digital_pulse(
# + Sequence.digital_pulse(
# *C.probe_green_sh,
# *C.probe_green_sh,
# t0 + tau_ncool - 2e-3, # account for 2 ms shutter delay
# t0 + tau_ncool
+ tau_pause
- 2e-3, # account for 2 ms shutter delay
# tau_twzr_load + tau_probe
# tau_twzr_load + tau_probe
# )
# )
).
with_color
(
"
C6
"
)
).
with_color
(
"
C6
"
)
...
@@ -398,20 +405,20 @@ def make_mot_mogtable(mot_det: float, probe_proxy_det: float, pp_det: float):
...
@@ -398,20 +405,20 @@ def make_mot_mogtable(mot_det: float, probe_proxy_det: float, pp_det: float):
(
mogtable
(
mogtable
# apply detuning for loading
# apply detuning for loading
<<
MOGEvent
(
frequency
=
RAMP_F
[
-
1
]
+
mot_det
)
<<
MOGEvent
(
frequency
=
RAMP_F
[
-
1
]
+
mot_det
)
@
(
-
tau_ref
+
tau_ncool
+
1.7e-3
)
# unknown source of timing error
@
(
-
tau_ref
+
tau_ncool
+
tau_pause
+
1.7e-3
)
# unknown source of timing error
# switch to imaging frequency to test in-tweezer cooling
# switch to imaging frequency to test in-tweezer cooling
<<
MOGEvent
(
frequency
=
90.0
+
probe_proxy_det
)
<<
MOGEvent
(
frequency
=
90.0
+
probe_proxy_det
)
@
(
-
tau_ref
+
tau_ncool
+
tau_twzr_load
+
1.7e-3
)
# unknown source of timing error
@
(
-
tau_ref
+
tau_ncool
+
tau_pause
+
tau_twzr_load
+
1.7e-3
)
# unknown source of timing error
# apply detuning for parity projection
# apply detuning for parity projection
<<
MOGEvent
(
frequency
=
90.0
+
pp_det
)
<<
MOGEvent
(
frequency
=
90.0
+
pp_det
)
@
(
-
tau_ref
+
tau_ncool
+
tau_twzr_load
+
tau_hold
+
1.7e-3
)
# unknown source of timing error
@
(
-
tau_ref
+
tau_ncool
+
tau_pause
+
tau_twzr_load
+
tau_hold
+
1.7e-3
)
# unknown source of timing error
# detune and depower the MOT beams for loading tweezers after the CMOT ramp
# detune and depower the MOT beams for loading tweezers after the CMOT ramp
# is finished
# is finished
<<
MOGEvent
(
frequency
=
RAMP_F
[
-
1
]
+
det_block
,
power
=-
50.0
)
<<
MOGEvent
(
frequency
=
RAMP_F
[
-
1
]
+
det_block
,
power
=-
50.0
)
@
(
-
tau_ref
+
tau_ncool
+
tau_twzr_load
+
tau_hold
+
tau_pp
+
1.7e-3
)
# unknown source of timing error
@
(
-
tau_ref
+
tau_ncool
+
tau_pause
+
tau_twzr_load
+
tau_hold
+
tau_pp
+
1.7e-3
)
# unknown source of timing error
)
)
return
mogtable
return
mogtable
...
@@ -442,36 +449,49 @@ class NarrowCoolingTweezerAlignment(Controller):
...
@@ -442,36 +449,49 @@ class NarrowCoolingTweezerAlignment(Controller):
# pre-construct all sequences and mogtables so we don't have to do it
# pre-construct all sequences and mogtables so we don't have to do it
# in the main loop
# in the main loop
print
(
"
[control] pre-computing sequences ...
"
,
end
=
""
,
flush
=
True
)
# print("[control] pre-computing sequences ... ", end="", flush=True)
self
.
sequences
=
list
()
# self.sequences = list()
self
.
ssequences
=
list
()
# self.ssequences = list()
for
fb
,
lr
,
ud
,
tau_andor
in
product
(
SHIMS_FB
,
SHIMS_LR
,
SHIMS_UD
,
TAU_ANDOR
):
# for fb, lr, ud, tau_andor in product(SHIMS_FB, SHIMS_LR, SHIMS_UD, TAU_ANDOR):
name
=
f
"
fb=
{
fb
:
.
5
f
}
_lr=
{
lr
:
.
5
f
}
_ud=
{
ud
:
.
5
f
}
_tau-andor=
{
tau_andor
:
.
5
f
}
"
# name = f"fb={fb:.5f}_lr={lr:.5f}_ud={ud:.5f}_tau-andor={tau_andor:.5f}"
sseq
=
make_sequence
(
name
,
fb
,
lr
,
ud
,
tau_andor
)
# sseq = make_sequence(name, fb, lr, ud, tau_andor)
self
.
sequences
.
append
(
sseq
.
to_sequence
())
# self.sequences.append(sseq.to_sequence())
self
.
ssequences
.
append
(
sseq
)
# self.ssequences.append(sseq)
# track the mogtables separately because they're slow to load to the controller
# # track the mogtables separately because they're slow to load to the controller
# they should be the slowest-varying parameter in scans
# # they should be the slowest-varying parameter in scans
self
.
mot_mogtables
=
[
# self.mot_mogtables = [
make_mot_mogtable
(
d_mot
,
d_probe_proxy
,
d_pp
)
# make_mot_mogtable(d_mot, d_probe_proxy, d_pp)
for
d_mot
,
d_probe_proxy
,
d_pp
in
product
(
DET_MOT
,
DET_PROBE_PROXY
,
DET_PP
)
# for d_mot, d_probe_proxy, d_pp in product(DET_MOT, DET_PROBE_PROXY, DET_PP)
]
# ]
# print(f"done ({len(self.mot_mogtables) * len(self.sequences) * reps})")
print
(
f
"
done (
{
len
(
self
.
mot_mogtables
)
*
len
(
self
.
sequences
)
*
reps
}
)
"
)
def
run_sequence
(
self
,
*
args
):
def
run_sequence
(
self
,
*
args
):
fmt
=
(
"
\r
"
N_mog
=
np
.
prod
([
len
(
X
)
for
X
in
[
DET_MOT
,
DET_PROBE_PROXY
,
DET_PP
]])
+
"
"
.
join
(
N_probe
=
len
(
DET_PROBE
)
f
"
{{:
{
int
(
np
.
log10
(
len
(
X
)))
+
1
:
.
0
f
}
}}/
{
len
(
X
)
}
"
N_ew
=
np
.
prod
([
len
(
X
)
for
X
in
[
SHIMS_FB
,
SHIMS_LR
,
SHIMS_UD
,
TAU_ANDOR
]])
for
X
in
[
self
.
mot_mogtables
,
DET_PROBE
,
self
.
sequences
,
range
(
reps
)]
)
N
=
[
N_mog
,
N_probe
,
N_ew
,
reps
]
+
"
({:6.2f}%)
"
)
N
=
[
len
(
X
)
for
X
in
[
self
.
mot_mogtables
,
DET_PROBE
,
self
.
sequences
,
range
(
reps
)]]
NN
=
[
np
.
prod
(
N
[
-
k
:])
for
k
in
range
(
1
,
len
(
N
))][::
-
1
]
+
[
1
]
NN
=
[
np
.
prod
(
N
[
-
k
:])
for
k
in
range
(
1
,
len
(
N
))][::
-
1
]
+
[
1
]
TOT
=
np
.
prod
(
N
)
TOT
=
np
.
prod
(
N
)
for
i
,
table
in
enumerate
(
self
.
mot_mogtables
):
fmt
=
(
"
"
+
"
"
.
join
(
f
"
{{:
{
int
(
np
.
log10
(
n
))
+
1
:
.
0
f
}
}}/
{
n
}
"
for
n
in
N
)
+
"
({:6.2f}%)
\r
"
)
# loop over generators for memory efficiency
mot_mogtables
=
lambda
:
(
make_mot_mogtable
(
d_mot
,
d_probe_proxy
,
d_pp
)
for
d_mot
,
d_probe_proxy
,
d_pp
in
product
(
DET_MOT
,
DET_PROBE_PROXY
,
DET_PP
)
)
sequences
=
lambda
:
(
make_sequence
(
fb
,
lr
,
ud
,
tau_andor
).
to_sequence
()
for
fb
,
lr
,
ud
,
tau_andor
in
product
(
SHIMS_FB
,
SHIMS_LR
,
SHIMS_UD
,
TAU_ANDOR
)
)
t0
=
timeit
.
default_timer
()
for
i
,
table
in
enumerate
(
mot_mogtables
()):
(
self
.
mog
(
self
.
mog
.
set_frequency
(
1
,
90.0
).
set_power
(
1
,
-
50.0
)
# make sure the AOM is off
.
set_frequency
(
1
,
90.0
).
set_power
(
1
,
-
50.0
)
# make sure the AOM is off
.
table_load
(
1
,
table
)
.
table_load
(
1
,
table
)
...
@@ -483,7 +503,7 @@ class NarrowCoolingTweezerAlignment(Controller):
...
@@ -483,7 +503,7 @@ class NarrowCoolingTweezerAlignment(Controller):
(
self
.
tb
(
self
.
tb
.
set_frequency
(
90.0
+
d_probe
)
.
set_frequency
(
90.0
+
d_probe
)
)
)
for
k
,
seq
in
enumerate
(
self
.
sequences
):
for
k
,
seq
in
enumerate
(
sequences
()
):
for
rep
in
range
(
reps
):
for
rep
in
range
(
reps
):
print
(
fmt
.
format
(
print
(
fmt
.
format
(
i
+
1
,
j
+
1
,
k
+
1
,
rep
+
1
,
i
+
1
,
j
+
1
,
k
+
1
,
rep
+
1
,
...
@@ -507,6 +527,12 @@ class NarrowCoolingTweezerAlignment(Controller):
...
@@ -507,6 +527,12 @@ class NarrowCoolingTweezerAlignment(Controller):
.
clear
()
.
clear
()
)
)
T
=
timeit
.
default_timer
()
-
t0
print
(
f
"
total elapsed time:
{
T
:
.
2
f
}
s
"
f
"
\n
average time per shot:
{
T
/
TOT
:
.
2
f
}
s
"
)
self
.
comp
.
clear
().
disconnect
()
self
.
comp
.
clear
().
disconnect
()
(
self
.
mog
(
self
.
mog
...
@@ -611,7 +637,7 @@ class NarrowCoolingTweezerAlignment(Controller):
...
@@ -611,7 +637,7 @@ class NarrowCoolingTweezerAlignment(Controller):
# # sseq.save()
# # sseq.save()
def
cmd_visualize
(
self
,
*
args
):
def
cmd_visualize
(
self
,
*
args
):
seq
=
make_sequence
(
""
,
SHIMS_FB
.
mean
(),
SHIMS_LR
.
mean
(),
SHIMS_UD
.
mean
(),
TAU_ANDOR
.
mean
())
seq
=
make_sequence
(
SHIMS_FB
.
mean
(),
SHIMS_LR
.
mean
(),
SHIMS_UD
.
mean
(),
TAU_ANDOR
.
mean
())
try
:
try
:
tmin
,
tmax
=
float
(
args
[
0
]),
float
(
args
[
1
])
tmin
,
tmax
=
float
(
args
[
0
]),
float
(
args
[
1
])
except
IndexError
:
except
IndexError
:
...
@@ -623,11 +649,12 @@ class NarrowCoolingTweezerAlignment(Controller):
...
@@ -623,11 +649,12 @@ class NarrowCoolingTweezerAlignment(Controller):
for
t
in
[
for
t
in
[
t0
,
t0
,
t0
+
tau_ncool
,
t0
+
tau_ncool
,
t0
+
tau_ncool
+
tau_twzr_load
,
t0
+
tau_ncool
+
tau_pause
,
t0
+
tau_ncool
+
tau_twzr_load
+
tau_hold
,
t0
+
tau_ncool
+
tau_pause
+
tau_twzr_load
,
t0
+
tau_ncool
+
tau_twzr_load
+
tau_hold
+
tau_pp
,
t0
+
tau_ncool
+
tau_pause
+
tau_twzr_load
+
tau_hold
,
t0
+
tau_ncool
+
tau_twzr_load
+
tau_hold
+
tau_pp
+
tau_dark
,
t0
+
tau_ncool
+
tau_pause
+
tau_twzr_load
+
tau_hold
+
tau_pp
,
t0
+
tau_ncool
+
tau_twzr_load
+
tau_hold
+
tau_pp
+
tau_dark
+
tau_probe
,
t0
+
tau_ncool
+
tau_pause
+
tau_twzr_load
+
tau_hold
+
tau_pp
+
tau_dark
,
t0
+
tau_ncool
+
tau_pause
+
tau_twzr_load
+
tau_hold
+
tau_pp
+
tau_dark
+
tau_probe
,
]:
]:
P
.
axvline
(
t
,
color
=
"
r
"
,
linestyle
=
"
-
"
,
linewidth
=
0.4
)
P
.
axvline
(
t
,
color
=
"
r
"
,
linestyle
=
"
-
"
,
linewidth
=
0.4
)
for
t
in
[
for
t
in
[
...
@@ -638,8 +665,8 @@ class NarrowCoolingTweezerAlignment(Controller):
...
@@ -638,8 +665,8 @@ class NarrowCoolingTweezerAlignment(Controller):
P
.
axvline
(
t
,
color
=
"
g
"
,
linestyle
=
"
--
"
,
linewidth
=
0.4
)
P
.
axvline
(
t
,
color
=
"
g
"
,
linestyle
=
"
--
"
,
linewidth
=
0.4
)
for
t
in
[
for
t
in
[
t0
+
tau_comp
,
t0
+
tau_comp
,
t0
+
tau_ncool
+
tau_flir
,
t0
+
tau_ncool
+
tau_pause
+
tau_flir
,
t0
+
tau_ncool
+
tau_twzr_load
+
tau_hold
+
tau_pp
+
tau_dark
+
TAU_ANDOR
.
mean
(),
t0
+
tau_ncool
+
tau_pause
+
tau_twzr_load
+
tau_hold
+
tau_pp
+
tau_dark
+
TAU_ANDOR
.
mean
(),
]:
]:
P
.
axvline
(
t
,
color
=
"
b
"
,
linestyle
=
"
:
"
,
linewidth
=
0.4
)
P
.
axvline
(
t
,
color
=
"
b
"
,
linestyle
=
"
:
"
,
linewidth
=
0.4
)
(
P
(
P
...
...
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