In [1]:
import os
import sys
import matplotlib.pyplot as plt
import numpy as np
import scipy.io as sio
import imageio
import pandas as pd
import seaborn as sns
sns.set(style='ticks')
In [2]:
sys.path.append('../../scripts')
In [3]:
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 [4]:
%load_ext autoreload
%autoreload 2
In [5]:
os.getcwd()
Out[5]:
In [6]:
det_df = bicorr.load_det_df('../../meas_info/det_df_pairs_angles.csv')
det_df.head()
Out[6]:
In [7]:
num_fissions = int(sio.loadmat('datap/num_fissions.mat')['num_fissions'])
print(num_fissions)
In [8]:
load_filename = 'datap/bhp_nn_1ns.npz'
npzfile = np.load(load_filename)
print(npzfile.files)
print(npzfile['note'])
pair_is = npzfile['pair_is']
bhp_nn = npzfile['bhp_nn']
dt_bin_edges = npzfile['dt_bin_edges']
pair_is = npzfile['pair_is']
In [9]:
norm_factor = num_fissions * len(pair_is) * np.power((dt_bin_edges[1]-dt_bin_edges[0]),2)
bhp = np.sum(bhp_nn,axis=0)/norm_factor
In [10]:
vmin = np.min(bhp[np.nonzero(bhp)])
vmax = np.max(bhp)
print(vmin,vmax)
In [14]:
ax= bicorr_plot.bhp_plot(bhp,dt_bin_edges,show_flag = False,
vmin = 1e-12, vmax=4e-9,clear=False)
ax.text(10,175,'POLIMI', size=10, backgroundcolor='lightgray')
ax.text(165,175,'(b)',size=15,backgroundcolor='lightgray')
bicorr_plot.save_fig_to_folder('bhm_all_normed')
plt.show()
Map to with and without fission chamber neighbors.
In [15]:
all_pairs = pair_is
all_pairs.shape
Out[15]:
In [16]:
with_to_without = dict(zip(all_pairs,np.arange(861)))
In [17]:
pair_is = bicorr.generate_pair_is(det_df, th_min=10, th_max=20, ignore_fc_neighbors_flag=True)
pair_is_without = [with_to_without[pair_is[i]] for i in range(len(pair_is))]
In [18]:
norm_factor = num_fissions * len(pair_is) * np.power((dt_bin_edges[1]-dt_bin_edges[0]),2)
bhp = np.sum(bhp_nn[pair_is_without,:,:],axis=0)/norm_factor
In [19]:
ax = bicorr_plot.bhp_plot(bhp,dt_bin_edges, show_flag=False,
clear = False)
ax.text(10,175,'$15^\circ$', size=13, backgroundcolor='lightgray')
ax.text(165,175,'(a)',size=15,backgroundcolor='lightgray')
bicorr_plot.save_fig_to_folder(fig_filename='bhm_15_normed')
plt.show()
In [20]:
pair_is = bicorr.generate_pair_is(det_df, th_min=40, th_max=50, ignore_fc_neighbors_flag=True)
pair_is_without = [with_to_without[pair_is[i]] for i in range(len(pair_is))]
In [21]:
norm_factor = num_fissions * len(pair_is) * np.power((dt_bin_edges[1]-dt_bin_edges[0]),2)
bhp = np.sum(bhp_nn[pair_is_without,:,:],axis=0)/norm_factor
In [22]:
ax = bicorr_plot.bhp_plot(bhp,dt_bin_edges, show_flag=False,
clear = False)
ax.text(10,175,'$45^\circ$', size=13, backgroundcolor='lightgray')
ax.text(165,175,'(b)',size=15,backgroundcolor='lightgray')
bicorr_plot.save_fig_to_folder(fig_filename='bhm_45_normed')
plt.show()
In [23]:
bhm_e, e_bin_edges, note = bicorr_e.load_bhm_e('datap')
In [24]:
bhm_e.shape
Out[24]:
In [25]:
bhp_e, norm_factor = bicorr_e.build_bhp_e(bhm_e,e_bin_edges,pair_is=all_pairs,num_fissions=num_fissions)
In [26]:
vmin = np.min(bhp_e[np.nonzero(bhp_e)])
vmax = np.max(bhp_e)
print(vmin, vmax)
In [30]:
ax = bicorr_plot.bhp_e_plot(bhp_e, e_bin_edges, show_flag = False,
vmin = 1e-8, vmax=1e-6, zoom_range =[0,6],
clear_flag=False)
ax.text(0.25,5.25,'POLIMI', size=10, backgroundcolor='lightgray')
ax.text(4.85,5.25,'(d)',size=15,backgroundcolor='lightgray')
bicorr_plot.save_fig_to_folder(fig_filename='bhm_e_all')
plt.show()
In [31]:
pair_is = bicorr.generate_pair_is(det_df, th_min=10, th_max=20, ignore_fc_neighbors_flag=True)
In [32]:
bhp_e, norm_factor = bicorr_e.build_bhp_e(bhm_e,e_bin_edges,pair_is=pair_is,num_fissions=num_fissions)
In [33]:
vmin = np.min(bhp_e[np.nonzero(bhp_e)])
vmax = np.max(bhp_e)
print(vmin, vmax)
In [34]:
ax = bicorr_plot.bhp_e_plot(bhp_e, e_bin_edges, show_flag = False,
vmin = 4e-8, vmax=6e-6, zoom_range =[0,6],
clear_flag=False)
ax.text(0.25,5.25,'$15^\circ$', size=13, backgroundcolor='lightgray')
ax.text(4.85,5.25,'(c)',size=15,backgroundcolor='lightgray')
bicorr_plot.save_fig_to_folder(fig_filename='bhm_e_15')
plt.show()
In [35]:
pair_is = bicorr.generate_pair_is(det_df, th_min=40, th_max=50, ignore_fc_neighbors_flag=True)
In [36]:
bhp_e, norm_factor = bicorr_e.build_bhp_e(bhm_e,e_bin_edges,pair_is=pair_is,num_fissions=num_fissions)
In [37]:
vmin = np.min(bhp_e[np.nonzero(bhp_e)])
vmax = np.max(bhp_e)
print(vmin, vmax)
In [38]:
ax = bicorr_plot.bhp_e_plot(bhp_e, e_bin_edges, show_flag = False,
vmin = 3e-8, vmax=1.4e-6, zoom_range =[0,6],
clear_flag = False)
ax.text(0.25,5.25,'$45^\circ$', size=13, backgroundcolor='lightgray')
ax.text(4.85,5.25,'(d)',size=15,backgroundcolor='lightgray')
bicorr_plot.save_fig_to_folder(fig_filename='bhm_e_45')
plt.show()
In [ ]: