In [3]:
%%javascript
$.getScript('https://kmahelona.github.io/ipython_notebook_goodies/ipython_notebook_toc.js')
pair_is
from det_df
I need a function for selecting the detector pairs within a given theta range. I will add the option of including or discluding the detector pairs that include a channel directly next to the fission chamber. (There were triggering issues in these channels)
Patricia Schuster
Jan 2018
UM NERS
In [4]:
import pandas as pd
import os
import sys
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_palette('spectral')
sns.set_style(style='white')
In [5]:
sys.path.append('../scripts/')
import bicorr as bicorr
In [6]:
%load_ext autoreload
%autoreload 2
In [7]:
det_df = bicorr.load_det_df(plot_flag=True)
In [8]:
det_df.head()
Out[8]:
In [9]:
th_min = 0
th_max = 20
In [19]:
ind_mask = (det_df['angle'] > th_min) & (det_df['angle'] <= th_max)
In [20]:
det_df[ind_mask].head()
Out[20]:
In [21]:
det_df[ind_mask].index.values
Out[21]:
In [22]:
pair_is = det_df[ind_mask].index.values
In [69]:
chList, fcList, detList, num_dets, num_det_pairs = bicorr.build_ch_lists()
In [70]:
chIgnore = [1,17,33]
Ignore indices in det_df
that include one of these channels.
In [77]:
det_df.head()
Out[77]:
In [85]:
det_df_ig = det_df[~det_df['d1'].isin(chIgnore) & ~det_df['d2'].isin(chIgnore)]
det_df_ig
Out[85]:
Make sure that we don't have any of those channels.
In [86]:
plt.plot(det_df_ig['d1'],det_df_ig['d2'],'.k')
plt.axvline( 1); plt.axhline( 1)
plt.axvline(17); plt.axhline(17)
plt.axvline(33); plt.axhline(33)
plt.xlabel('d1'); plt.ylabel('d2'); plt.title('Channels in det_df_ig')
plt.show()
In [87]:
import inspect
In [88]:
print(inspect.getsource(bicorr.generate_pair_is))
In [89]:
bicorr.generate_pair_is(det_df,0,20)
Out[89]:
In [90]:
det_df.iloc[bicorr.generate_pair_is(det_df,0,20)]
Out[90]:
In [91]:
det_df.iloc[bicorr.generate_pair_is(det_df,0,20,ignore_fc_neighbors_flag=True)]
Out[91]:
In [ ]: