In [1]:
%run ../../load_fretbursts.py
Load and process the data:
In [2]:
data_dir = 'C:\Data\Antonio\data/'
In [3]:
fname = data_dir + u'/manta/2014-04-11/17d_200p_2_600mW_reall_steer_20.dat'
In [4]:
d1 = loader.multispot48(fname)
d2 = loader.multispot48(fname)
In [5]:
def compare_data_bg(d1, d2):
mch_arrays = ['bg', 'bg_dd', 'bg_ad', 'bg_aa', 'Lim', 'Ph_p']
scalars = ['nperiods', 'bg_time_s', 'bg_auto_th', 'bg_fun_name']
for name in mch_arrays:
for ich, arr in enumerate(d1[name]):
assert np.allclose(arr, d2[name][ich])
for name in scalars:
assert d1[name] == d2[name]
In [6]:
#reload(bg_cache)
In [7]:
bg_cache.remove_cache(d2)
In [8]:
d1.calc_bg(bg.exp_fit, time_s=20, tail_min_us=300)
d2.calc_bg_cache(bg.exp_fit, time_s=20, tail_min_us=300)
In [9]:
compare_data_bg(d1, d2)
In [10]:
d2.calc_bg_cache(bg.exp_fit, time_s=20, tail_min_us=300)
In [11]:
compare_data_bg(d1, d2)
In [12]:
d1.calc_bg(bg.exp_fit, time_s=20, tail_min_us='auto', F_bg=1.7)
d2.calc_bg_cache(bg.exp_fit, time_s=20, tail_min_us='auto', F_bg=1.7)
In [13]:
compare_data_bg(d1, d2)
In [14]:
d2.calc_bg_cache(bg.exp_fit, time_s=20, tail_min_us='auto', F_bg=1.7)
In [15]:
compare_data_bg(d1, d2)
In [16]:
bg_cache.remove_cache(d2)
In [17]:
d1.calc_bg(bg.exp_fit, time_s=20, tail_min_us=300)
bg_cache.calc_bg_cache(d2, fun=bg.exp_fit, time_s=20, tail_min_us=300)
In [18]:
compare_data_bg(d1, d2)
In [19]:
bg_cache.calc_bg_cache(d2, fun=bg.exp_fit, time_s=20, tail_min_us=300)
In [20]:
compare_data_bg(d1, d2)
In [21]:
d1.calc_bg(bg.exp_fit, time_s=20, tail_min_us='auto', F_bg=1.7)
bg_cache.calc_bg_cache(d2, fun=bg.exp_fit, time_s=20, tail_min_us='auto', F_bg=1.7)
In [22]:
compare_data_bg(d1, d2)
In [23]:
bg_cache.calc_bg_cache(d2, fun=bg.exp_fit, time_s=20, tail_min_us='auto', F_bg=1.7)
In [24]:
compare_data_bg(d1, d2)
In [25]:
print 'OK'
In [25]: