In order to correct for differences in detection efficiencies and solid angles, we will divide all of the doubles rates by the singles rates of the two detectors as follows:
$ W_{i,j} = \frac{D_{i,j}}{S_i*S_j}$
This requires calculating $S_i$ and $S_j$ from the cced
files. I need to rewrite my analysis from the beginning, or write another function that parses the cced
file.
In this file, I will import the singles and bicorr data and calculate all $D_{i,j}$, $S_i$, $S_j$, and $W_{i,j}$.
This notebook does the analysis in energy space.
In [1]:
import os
import sys
import matplotlib.pyplot as plt
import numpy as np
import imageio
In [2]:
import pandas as pd
In [3]:
import seaborn as sns
sns.set(style='ticks')
In [4]:
sys.path.append('../scripts/')
In [5]:
import bicorr as bicorr
import bicorr_e as bicorr_e
import bicorr_plot as bicorr_plot
import bicorr_sums as bicorr_sums
import bicorr_math as bicorr_math
In [6]:
%load_ext autoreload
%autoreload 2
In [7]:
det_df = bicorr.load_det_df('../meas_info/det_df_pairs_angles.csv')
det_df.head()
Out[7]:
In [8]:
chList, fcList, detList, num_dets, num_det_pairs = bicorr.build_ch_lists()
dict_pair_to_index, dict_index_to_pair, dict_pair_to_angle = bicorr.build_dict_det_pair(det_df)
In [9]:
num_fissions = 2194651200.00
In [10]:
e_min = 0.62
e_max = 12
In [11]:
singles_hist_e_n, e_bin_edges, dict_det_to_index, dict_index_to_det = bicorr_e.load_singles_hist_both(filepath = '../analysis/Cf072115_to_Cf072215b/datap/',plot_flag=True, show_flag=True)
In [12]:
bicorr_plot.plot_singles_hist_e_n(singles_hist_e_n, e_bin_edges, show_flag=False, clear_flag=False)
for e in [e_min, e_max]:
plt.axvline(e,c='r')
plt.show()
In [13]:
singles_hist_e_n.shape
Out[13]:
In [14]:
bhm_e, e_bin_edges, note = bicorr_e.load_bhm_e('../analysis/Cf072115_to_Cf072215b/datap')
In [15]:
bhm_e.shape
Out[15]:
In [16]:
bhp_e = np.zeros((len(det_df),len(e_bin_edges)-1,len(e_bin_edges)-1))
bhp_e.shape
Out[16]:
In [17]:
for index in det_df.index.values: # index is same as in `bhm`
bhp_e[index,:,:] = bicorr_e.build_bhp_e(bhm_e,e_bin_edges,pair_is=[index])[0]
In [18]:
bicorr_plot.bhp_e_plot(np.sum(bhp_e,axis=0),e_bin_edges, show_flag=True)
In [19]:
det_df.head()
Out[19]:
In [20]:
det_df = bicorr_sums.init_det_df_sums(det_df)
det_df.head()
Out[20]:
In [21]:
singles_e_df = bicorr_sums.init_singles_e_df(dict_index_to_det)
singles_e_df.head()
Out[21]:
In [22]:
bhp_e.shape
Out[22]:
In [23]:
det_df, energies_real = bicorr_sums.fill_det_df_doubles_e_sums(det_df, bhp_e, e_bin_edges, e_min, e_max, True)
det_df.head()
Out[23]:
In [24]:
bicorr_plot.counts_vs_angle_all(det_df, save_flag=False)
In [25]:
singles_e_df.head()
Out[25]:
In [26]:
bicorr_plot.Sd_vs_ch_all(singles_e_df, save_flag=False)
In [27]:
det_df = bicorr_sums.fill_det_df_singles_sums(det_df, singles_e_df)
det_df.head()
Out[27]:
In [28]:
plt.figure(figsize=(4,4))
ax = plt.gca()
sc = ax.scatter(det_df['d1'],det_df['d2'],s=13,marker='s',
edgecolor = 'none', c=det_df['Cd'],cmap='viridis')
ax.set_xlabel('d1 channel')
ax.set_ylabel('d2 channel')
ax.set_title('Doubles counts')
cbar = plt.colorbar(sc,fraction=0.043,pad=0.1)
cbar.set_label('Doubles counts')
plt.show()
plt.figure(figsize=(4,4))
ax = plt.gca()
sc = ax.scatter(det_df['d1'],det_df['d2'],s=13,marker='s',
edgecolor = 'none', c=det_df['Sd1'],cmap='viridis')
ax.set_xlabel('d1 channel')
ax.set_ylabel('d2 channel')
ax.set_title('D1 singles counts')
cbar = plt.colorbar(sc,fraction=0.043,pad=0.1)
cbar.set_label('D1 singles counts')
plt.show()
plt.figure(figsize=(4,4))
ax = plt.gca()
sc = ax.scatter(det_df['d1'],det_df['d2'],s=13,marker='s',
edgecolor = 'none', c=det_df['Sd2'],cmap='viridis')
ax.set_xlabel('d1 channel')
ax.set_ylabel('d2 channel')
ax.set_title('D2 singles counts')
cbar = plt.colorbar(sc,fraction=0.043,pad=0.1)
cbar.set_label('D2 Singles counts')
plt.show()
In [29]:
det_df = bicorr_sums.calc_det_df_W(det_df)
det_df.head()
Out[29]:
In [30]:
plt.figure(figsize=(4,4))
ax = plt.gca()
sc = ax.scatter(det_df['d1'],det_df['d2'],s=13,marker='s',
edgecolor = 'none', c=det_df['W'],cmap='viridis')
ax.set_xlabel('d1 channel')
ax.set_ylabel('d2 channel')
ax.set_title('W')
cbar = plt.colorbar(sc,fraction=0.043,pad=0.1)
cbar.set_label('W')
plt.show()
In [31]:
chIgnore = [1,17,33]
det_df_ignore = det_df[~det_df['d1'].isin(chIgnore) & ~det_df['d2'].isin(chIgnore)]
bicorr_plot.W_vs_angle_all(det_df_ignore, save_flag=False)
In [18]:
bicorr_plot.W_vs_angle_all?
In [32]:
angle_bin_edges = np.arange(8,190,10)
print(angle_bin_edges)
In [33]:
by_angle_df = bicorr_sums.condense_det_df_by_angle(det_df_ignore, angle_bin_edges)
by_angle_df.head()
Out[33]:
In [34]:
bicorr_plot.W_vs_angle(det_df_ignore, by_angle_df, save_flag=False)
In [39]:
singles_e_df.to_csv('singles_e_df_filled.csv')
In [40]:
det_df.to_csv(r'det_df_e_filled.csv')
In [41]:
by_angle_df.to_csv(r'by_angle_e_df.csv')
In [12]:
det_df_filled = pd.read_csv(r'det_df_e_filled.csv',index_col=0)
det_df_filled.head()
Out[12]:
In [14]:
chIgnore = [1,17,33]
det_df_ignore = det_df_filled[~det_df_filled['d1'].isin(chIgnore) & ~det_df_filled['d2'].isin(chIgnore)]
det_df_ignore.head()
Out[14]:
In [7]:
singles_e_df_filled = pd.read_csv(r'singles_e_df_filled.csv',index_col=0)
singles_e_df_filled.head()
Out[7]:
In [8]:
by_angle_e_df = pd.read_csv(r'by_angle_e_df.csv',index_col=0)
by_angle_e_df.head()
Out[8]:
In [16]:
bicorr_plot.W_vs_angle(det_df_ignore, by_angle_e_df, save_flag=False)
In [ ]: