import numpy as np
import matplotlib.pyplot as plt
from ColdTOFU import spectroscopy, spectroscopyFaddeva, ShadowImage, rcParams
%matplotlib inline
im = ShadowImage('data/shadow_imag_#3766.tif') #shadow image sequence
ROI = [40, 100, 115, 170] # approximate ROI [y_start, y_end, x_start, x_end]
od = im.averagedSignalOD(1)[:, ROI[0]:ROI[1], ROI[2]:ROI[3]] # rough position of the cloud
f = 20.7+np.arange(0, im.nSamples)*0.02 #|9/2, m_F>---> |11/2, m_F+1> transition at B=10 G
s = im.redProbeIntensity(ROI)[0]/3 # I_s = 3 muW/cm^2
rcParams().update('saturation', s)
rcParams().params
{'binning': 2, 'magnification': 2.07, 'pixelSize': 6.5e-06, 'quantum efficiency': 0.85, 'mass number': 87, 'saturation': 3.328193342152274}
x = spectroscopy(od, f, d=5, atom_loss=False, fileNum=im.filePath[-8:-4])
x = spectroscopyFaddeva(od, f, atom_loss=False, fileNum=im.filePath[-8:-4])
At B=10 G, the shift of the excited state is $\Delta f = g\mu_B m_F B/h \approx 2.96 MHz$
im = ShadowImage('data/shadow_imag_#3669.tif')
ROI = [40, 120, 85, 150]
od = im.averagedSignalOD(1)[:, ROI[0]:ROI[1], ROI[2]:ROI[3]]
f = 2.7+np.arange(0, im.nSamples)*0.02 #|9/2, m_F>---> |9/2, m_F-1> transition at B=10 G
x = spectroscopy(od, f, d=5, atom_loss=True, fileNum=im.filePath[-8:-4])