Commit c8259bd3 authored by JGlombitza's avatar JGlombitza

Aenderungen im plotting

Energy, Time, Total_Signal und Energy vs nStationen
parent bd6d7e3b
......@@ -7,6 +7,7 @@ from matplotlib.collections import PatchCollection
from matplotlib.colors import Normalize
from utils import distance2showeraxis
from pylab import *
import seaborn.apionly as sns
def plot_array(v_stations, values, label='', vmin=None, vmax=None):
......@@ -43,6 +44,7 @@ def plot_traces_of_array_for_one_event(Smu, Sem, v_axis, v_stations, n=5):
fig, axes = subplots(n, n, sharex=True, figsize=(29, 16), facecolor='w')
plt.tight_layout()
t = np.arange(12.5, 2001, 25)
v_stations = v_stations.reshape(11,11,3)
for ix in range(n):
for iy in range(n):
ax = axes[ix, iy]
......@@ -51,11 +53,57 @@ def plot_traces_of_array_for_one_event(Smu, Sem, v_axis, v_stations, n=5):
ax.step(t, h1 + h2, c='k', where='mid')
ax.step(t, h1, label='$\mu$', where='mid')
ax.step(t, h2, label='$e\gamma$', where='mid')
ax.legend(title='%i, %i' % (ix + i0, iy + i0), fontsize='x-small')
title = "X:"+ str(v_stations[ix + i0,iy + i0][0])+ " / Y:"+ str(v_stations[ix + i0,iy + i0][1])
ax.legend(title=title + " / r=" + str(ix + i0) + ", " + str(iy + i0), fontsize='x-small')
ax.set_xlim(0, 1500)
ax.grid(True)
ax.set_xlabel('$t$ / ns', fontsize='x-small')
ax.set_ylabel('$S$ / VEM', fontsize='x-small')
ax.set_ylabel('$S$ / VEM', fontsize='x-small')
savefig('trace_VEM.png')
def plot_time_distribution(t):
# histogram of time values
print "time"
fig, ax = plt.subplots(1)
ax.hist(t[~np.isnan(t)].flatten(), bins=40, normed=True)
ax.grid()
ax.set_xlabel('time [ms]')
ax.set_ylabel('frequency')
fig.savefig('./time_distribution.png')
def plot_total_signal_distribution(s):
print "signal"
# histogram of signal values
s = np.sum(s, axis=-1)
s[np.isnan(s)] = 0
fig, ax = plt.subplots(1)
ax.hist(np.sum(s, axis=(-1)), bins=401, normed=True)
ax.grid()
plt.yscale('log')
ax.set_xlabel('signal [a.u.]')
ax.set_ylabel('frequency')
fig.savefig('./total_signal_distribution.png')
def plot_energy_distribution(logE):
print "energy"
# histogram of Energy values
fig, ax = plt.subplots(1)
ax.hist(logE, bins = np.linspace(18.5, 20, 69), normed=False)
ax.grid()
ax.set_xlabel('energy [eV]')
ax.set_ylabel('frequency')
fig.savefig("./energy_distribution.png")
def plot_energy_vs_tanks_with_hits(logE, s):
print "energy vc tanks"
# histogram tons with hits vs. Energy
nt = np.sum(~np.isnan(s), axis=(1))
fig = plt.figure()
ax = sns.regplot(x=logE, y=nt, x_bins = np.linspace(18.5, 20, 69), fit_reg=False)
ax.grid()
ax.set_xlabel('Energy')
ax.set_ylabel('Number of Stations')
fig.savefig('./energy_vs_nstations.png')
if __name__ == '__main__':
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment