Commit d6d933bb authored by Yb Tweezer's avatar Yb Tweezer
Browse files

update timings (update not complete) and add option for subtracting background...

update timings (update not complete) and add option for subtracting background from numbers reported in results.toml
parent 7cad1fb1
......@@ -112,7 +112,7 @@ class FluorescenceImaging(Controller):
config=camera_config,
comments=comments
)
data.compute_results()
data.compute_results(subtract_bkgd=False)
data.save()
data.render_arrays()
......
......@@ -161,7 +161,8 @@ class FluorescenceData(ImagingData):
return FluorescenceData(
data.outdir, data.arrays, data.config, data.comments, data.results)
def compute_results(self, dA=3.45**2, printflag: bool=True):
def compute_results(self, subtract_bkgd: bool=True, dA: float=3.45**2,
printflag: bool=True):
_dA = self.config.get("bin_size", 1)**2 \
* (DEF_DX**2 if dA is None else dA)
if printflag: print("[imaging] Compute results")
......@@ -177,13 +178,12 @@ class FluorescenceData(ImagingData):
self.arrays["background"].astype(np.float64),
**compute_mot_number_params,
k=0
) if "background" in self.arrays.keys() else 0.0
) if subtract_bkgd and "background" in self.arrays.keys() else 0.0
for label, array in self.arrays.items():
if label == "background":
continue
dtype_info = np.iinfo(array.dtype)
if array.max() >= (dtype_info.max - dtype_info.bits):
print(f"[imaging] WARNING: image '{label}' may contain clipping")
print(
f"[imaging] WARNING: image '{label}' may contain clipping")
N = compute_mot_number(
array.astype(np.float64),
**compute_mot_number_params,
......
......@@ -3,11 +3,15 @@ from lib import *
from lib import CONNECTIONS as C
import sys, pathlib
outdir = DATADIRS.mot_transfer.joinpath(get_timestamp())
timestamp = get_timestamp()
print(timestamp)
outdir = DATADIRS.mot_transfer.joinpath(timestamp)
comments = """
MOT transfer
============
71.40 MHz PDH RF
3 A shims
"""[1:-1]
# CAMERA OPTIONS
......@@ -16,13 +20,13 @@ camera_config = {
"gain": 5.0,
"gamma": 1.25,
"black_level": 5.0,
"bin_size": 2,
"bin_size": 1,
}
# CONSTRUCT SEQUENCE
t0 = 2.25 # big coils start turning off at t0
t0 = 2.5 # big coils start turning off at t0
R = 3 # repetition for each tau
tau_ = np.array([np.linspace(5.0e-3, 500.0e-3, 21) for k in range(R)]).T.flatten()
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])))
def make_sequence(tau, name=None):
......@@ -46,7 +50,7 @@ def make_sequence(tau, name=None):
"MOT coils 2": (Sequence
.digital_hilo(*C.mot3_coils_igbt,
t0 + tau - 4.5e-3, t0 + tau + 100e-3)
t0 + tau - 6.8e-3, t0 + tau + 100e-3)
).with_color("C1").with_stack_idx(2),
"Blue beams 1": (Sequence
......@@ -54,15 +58,15 @@ def make_sequence(tau, name=None):
).with_color("C0").with_stack_idx(5),
"Blue beams 2": (Sequence
.digital_hilo(*C.mot3_blue_sh, t0 + tau - 1e-3, t0 + tau + 100e-3)
.digital_hilo(*C.mot3_blue_sh, t0 + tau - 3e-3, t0 + tau + 100e-3)
).with_color("C0").with_stack_idx(5),
"MOT shims": (Sequence
.digital_hilo(*C.mot3_shims_onoff, t0 - 1e-3, t0 + tau - 1e-3)
.digital_hilo(*C.mot3_shims_onoff, t0 - 0.5e-3, t0 + tau)
).with_color("C1").with_stack_idx(3),
"Green beams": (Sequence
.digital_hilo(*C.mot3_green_aom, t0 - 1e-3, t0 + tau - 1e-3)
.digital_hilo(*C.mot3_green_aom, t0, t0 + tau)
).with_color("C6").with_stack_idx(6),
"Camera": (Sequence
......@@ -74,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)
......@@ -146,7 +150,7 @@ class MOTTransfer(Controller):
config=camera_config,
comments=comments
)
data.compute_results()
data.compute_results(subtract_bkgd=False)
data.save()
data.render_arrays()
......
......@@ -3,6 +3,8 @@ from lib import *
from lib import CONNECTIONS as C
import sys, pathlib
raise Exception("This script is outdated: needs timing updates")
outdir = DATADIRS.mot_transfer.joinpath(get_timestamp())
comments = """
......@@ -16,7 +18,7 @@ camera_config = {
"gain": 5.0,
"gamma": 1.25,
"black_level": 5.0,
"bin_size": 2,
"bin_size": 1,
}
# CONSTRUCT SEQUENCE
......@@ -148,7 +150,7 @@ class MOTTransferTemperature(Controller):
config=camera_config,
comments=comments
)
data.compute_results()
data.compute_results(subtract_bkgd=False)
data.save()
data.render_arrays()
......
Supports Markdown
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