In [6]:
import sys
sys.path.append('/home/jbourbeau/cr-composition')
sys.path


Out[6]:
['',
 '/cvmfs/icecube.opensciencegrid.org/py2-v1/RHEL_6_x86_64/lib/python2.7/site-packages/setuptools-15.2-py2.7.egg',
 '/cvmfs/icecube.opensciencegrid.org/py2-v1/RHEL_6_x86_64/lib/python2.7/site-packages/setuptools-15.2-py2.7.egg',
 '/home/jbourbeau/.local/lib/python2.7/site-packages',
 '/cvmfs/icecube.opensciencegrid.org/py2-v1/RHEL_6_x86_64/i3ports/root-v5.34.18/lib',
 '/cvmfs/icecube.opensciencegrid.org/py2-v1/RHEL_6_x86_64/lib/python2.7/site-packages',
 '/cvmfs/icecube.opensciencegrid.org/py2-v1/RHEL_6_x86_64/i3ports/lib/python2.7/site-packages',
 '/data/user/jbourbeau/metaprojects/icerec/V05-00-00/build/lib',
 '/home/jbourbeau/cr-composition/analysis',
 '/home/jbourbeau',
 '/home/jbourbeau/useful',
 '/home/jbourbeau/anisotropy',
 '/home/jbourbeau/ShowerLLH_scripts',
 '/cvmfs/icecube.opensciencegrid.org/py2-v1/RHEL_6_x86_64/lib/python27.zip',
 '/cvmfs/icecube.opensciencegrid.org/py2-v1/RHEL_6_x86_64/lib/python2.7',
 '/cvmfs/icecube.opensciencegrid.org/py2-v1/RHEL_6_x86_64/lib/python2.7/plat-linux2',
 '/cvmfs/icecube.opensciencegrid.org/py2-v1/RHEL_6_x86_64/lib/python2.7/lib-tk',
 '/cvmfs/icecube.opensciencegrid.org/py2-v1/RHEL_6_x86_64/lib/python2.7/lib-old',
 '/cvmfs/icecube.opensciencegrid.org/py2-v1/RHEL_6_x86_64/lib/python2.7/lib-dynload',
 '/home/jbourbeau/.local/lib/python2.7/site-packages/IPython/extensions',
 '/home/jbourbeau/.ipython',
 '/home/jbourbeau/cr-composition',
 '/home/jbourbeau/cr-composition']

In [7]:
import os
import sys
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm
import argparse
import seaborn.apionly as sns

# from icecube import ShowerLLH

# from composition.analysis.load_sim import load_sim
# import composition.analysis.data_functions as datafunc
# import composition.analysis.plotting_functions as plotting
import composition as comp
import composition.analysis.plotting as plotting

In [8]:
sns.set_palette('muted')
sns.set_color_codes()

In [9]:
df, cut_dict = comp.load_sim(return_cut_dict=True)
selection_mask = np.array([True] * len(df))
standard_cut_keys = ['reco_exists', 'reco_zenith', 'num_hits_1_60', 'IT_signal',
                     'StationDensity', 'max_qfrac_1_60', 'reco_containment',
                     'energy_range']
for key in standard_cut_keys:
    selection_mask *= cut_dict[key]

print('n_events before cuts = {}'.format(len(df)))
df = df[selection_mask]
print('n_events after cuts = {}'.format(len(df)))


n_events before cuts = 441798
n_events after cuts = 51608

In [11]:
charge = df.InIce_log_charge_1_60
nchannels = np.log10(df.NChannels_1_60)
bins=100
fig, ax = plt.subplots()
plotting.histogram_2D(nchannels, charge, bins, log_counts=False)
plt.plot([0,10], [0,10], marker='None', linestyle='-.')
plt.xlim([1, 3.5])
plt.ylim([1, 5])
plt.xlabel('$\log_{10}(\mathrm{NChannels})$')
plt.ylabel('$\log_{10}(\mathrm{Q}_{\mathrm{tot}})$')
# plt.title('True vs. ShowerLLH Energy')
plt.show()



In [5]:
charge_half = df.InIce_log_charge_half
nchannels_half = np.log10(df.NChannels_half)
bins=100
fig, ax = plt.subplots()
plotting.histogram_2D(nchannels_half, charge_half, bins, log_counts=False)
plt.plot([0,10], [0,10], marker='None', linestyle='-.')
plt.xlim([1, 3.5])
plt.ylim([1, 5])
plt.xlabel('$\log_{10}(\mathrm{NChannels})$')
plt.ylabel('$\log_{10}(\mathrm{Q}_{\mathrm{tot}})$')
# plt.title('True vs. ShowerLLH Energy')
plt.show()



In [6]:
charge_quarter = df.InIce_log_charge_quarter
nchannels_quarter = np.log10(df.NChannels_quarter)
bins=100
fig, ax = plt.subplots()
plotting.histogram_2D(nchannels_quarter, charge_quarter, bins, log_counts=False)
plt.plot([0,10], [0,10], marker='None', linestyle='-.')
plt.xlim([1, 3.5])
plt.ylim([1, 5])
plt.xlabel('$\log_{10}(\mathrm{NChannels})$')
plt.ylabel('$\log_{10}(\mathrm{Q}_{\mathrm{tot}})$')
# plt.title('True vs. ShowerLLH Energy')
plt.show()



In [19]:
nstations = df.NStations
nchannels = df.NChannels

In [23]:
bins=25
fig, ax = plt.subplots()
plotting.histogram_2D(nchannels, nstations, bins, log_counts=False)
# plt.plot([0,10], [0,10], marker='None', linestyle='-.')
# plt.xlim([1, 3.5])
# plt.ylim([1, 5])
plt.xlabel('$\log_{10}(\mathrm{NChannels})$')
plt.ylabel('$\log_{10}(\mathrm{NStations})$')
# plt.title('True vs. ShowerLLH Energy')
plt.show()



In [ ]: