Commit 73c35047 authored by Yb Tweezer's avatar Yb Tweezer
Browse files

fix timings

parent c69b45b9
......@@ -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:.5f}" 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:.5f}_{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]:.5f}_{str(k % R).zfill(z):s}": frame
f"tau={TAU[k]:.5f}_{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)
......
......@@ -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.5e-3, t0 + G + tau + 100e-3)
t0 + G + tau - 6.8e-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 - 1e-3, t0 + G + tau + 100e-3)
t0 + G + tau - 3e-3, t0 + G + tau + 100e-3)
).with_color("C0").with_stack_idx(5),
"MOT shims": (Sequence
.digital_hilo(*C.mot3_shims_onoff, t0 - 1e-3, t0 + G - 1e-3)
.digital_hilo(*C.mot3_shims_onoff, t0 - 0.5e-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, 100e-3)
.digital_hilo(*C.dummy, 0.0, 200e-3)
),
"Push": (Sequence
.digital_lohi(*C.push_sh, 0.0, 100e-3)
.digital_lohi(*C.push_sh, 0.0, 200e-3)
),
"MOT beams": (Sequence
.digital_lohi(*C.mot3_blue_sh, 0.0, 50e-3)
.digital_lohi(*C.mot3_blue_sh, 0.0, 150e-3)
),
"MOT coils": (Sequence
.digital_hilo(*C.mot3_coils_igbt, 0.0, 100e-3)
.digital_hilo(*C.mot3_coils_onoff, 0.0, 100e-3)
.digital_hilo(*C.mot3_coils_igbt, 0.0, 200e-3)
.digital_hilo(*C.mot3_coils_onoff, 0.0, 200e-3)
),
"Camera": (Sequence
.digital_pulse(*C.flir_trig, 80e-3, camera_config["exposure_time"] * 1e-6)
.digital_pulse(*C.flir_trig, 180e-3, camera_config["exposure_time"] * 1e-6)
),
"Scope": (Sequence
.digital_hilo(*C.scope_trig, 0.0, 100e-3)
.digital_hilo(*C.scope_trig, 0.0, 200e-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:.5f}_{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:.5f}_{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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment