def boxplot_phi_reconstruction_results_for_MIP(table, N): figure() THETA = deg2rad(22.5) DTHETA = deg2rad(5.) bin_edges = linspace(-180, 180, 18) x, r_dphi = [], [] d25, d50, d75 = [], [], [] for low, high in zip(bin_edges[:-1], bin_edges[1:]): rad_low = deg2rad(low) rad_high = deg2rad(high) query = '(min_n134 >= N) & (rad_low < reference_phi) & (reference_phi < rad_high) & (abs(reference_theta - THETA) <= DTHETA)' sel = table.readWhere(query) dphi = sel[:]['reconstructed_phi'] - sel[:]['reference_phi'] dphi = (dphi + pi) % (2 * pi) - pi r_dphi.append(rad2deg(dphi)) d25.append(scoreatpercentile(rad2deg(dphi), 25)) d50.append(scoreatpercentile(rad2deg(dphi), 50)) d75.append(scoreatpercentile(rad2deg(dphi), 75)) x.append((low + high) / 2) #boxplot(r_dphi, positions=x, widths=1 * (high - low), sym='') fill_between(x, d25, d75, color='0.75') plot(x, d50, 'o-', color='black') xlabel(r"$\phi_K$ [deg]") ylabel(r"$\phi_H - \phi_K$ [deg]") title(r"$N_{MIP} \geq %d, \quad \theta = 22.5^\circ \pm %d^\circ$" % (N, rad2deg(DTHETA))) xticks(linspace(-180, 180, 9)) axhline(0, color='black') utils.saveplot(N) graph = GraphArtist() graph.draw_horizontal_line(0, linestyle='gray') graph.shade_region(x, d25, d75) graph.plot(x, d50, linestyle=None) graph.set_xlabel(r"$\phi_K$ [\si{\degree}]") graph.set_ylabel(r"$\phi_H - \phi_K$ [\si{\degree}]") graph.set_xticks([-180, -90, '...', 180]) graph.set_xlimits(-180, 180) graph.set_ylimits(-23, 23) artist.utils.save_graph(graph, suffix=N, dirname='plots')
def boxplot_phi_reconstruction_results_for_MIP(table, N): figure() THETA = deg2rad(22.5) DTHETA = deg2rad(5.) bin_edges = linspace(-180, 180, 18) x, r_dphi = [], [] d25, d50, d75 = [], [], [] for low, high in zip(bin_edges[:-1], bin_edges[1:]): rad_low = deg2rad(low) rad_high = deg2rad(high) query = '(min_n134 >= N) & (rad_low < reference_phi) & (reference_phi < rad_high) & (abs(reference_theta - THETA) <= DTHETA)' sel = table.read_where(query) dphi = sel[:]['reconstructed_phi'] - sel[:]['reference_phi'] dphi = (dphi + pi) % (2 * pi) - pi r_dphi.append(rad2deg(dphi)) d25.append(scoreatpercentile(rad2deg(dphi), 25)) d50.append(scoreatpercentile(rad2deg(dphi), 50)) d75.append(scoreatpercentile(rad2deg(dphi), 75)) x.append((low + high) / 2) #boxplot(r_dphi, positions=x, widths=1 * (high - low), sym='') fill_between(x, d25, d75, color='0.75') plot(x, d50, 'o-', color='black') xlabel(r"$\phi_K$ [deg]") ylabel(r"$\phi_H - \phi_K$ [deg]") title(r"$N_{MIP} \geq %d, \quad \theta = 22.5^\circ \pm %d^\circ$" % (N, rad2deg(DTHETA))) xticks(linspace(-180, 180, 9)) axhline(0, color='black') utils.saveplot(N) graph = GraphArtist() graph.draw_horizontal_line(0, linestyle='gray') graph.shade_region(x, d25, d75) graph.plot(x, d50, linestyle=None) graph.set_xlabel(r"$\phi_K$ [\si{\degree}]") graph.set_ylabel(r"$\phi_H - \phi_K$ [\si{\degree}]") graph.set_xticks([-180, -90, '...', 180]) graph.set_xlimits(-180, 180) graph.set_ylimits(-23, 23) artist.utils.save_graph(graph, suffix=N, dirname='plots')
def boxplot_phi_reconstruction_results_for_MIP(group, N): table = group.E_1PeV.zenith_22_5 figure() bin_edges = linspace(-180, 180, 18) x, r_dphi = [], [] d25, d50, d75 = [], [], [] for low, high in zip(bin_edges[:-1], bin_edges[1:]): rad_low = deg2rad(low) rad_high = deg2rad(high) query = '(min_n134 >= N) & (rad_low < reference_phi) & (reference_phi < rad_high)' sel = table.read_where(query) dphi = sel[:]['reconstructed_phi'] - sel[:]['reference_phi'] dphi = (dphi + pi) % (2 * pi) - pi r_dphi.append(rad2deg(dphi)) d25.append(scoreatpercentile(rad2deg(dphi), 25)) d50.append(scoreatpercentile(rad2deg(dphi), 50)) d75.append(scoreatpercentile(rad2deg(dphi), 75)) x.append((low + high) / 2) fill_between(x, d25, d75, color='0.75') plot(x, d50, 'o-', color='black') xlabel(r"$\phi_{simulated}$ [deg]") ylabel(r"$\phi_{reconstructed} - \phi_{simulated}$ [deg]") #title(r"$N_{MIP} \geq %d, \quad \theta = 22.5^\circ$" % N) xticks(linspace(-180, 180, 9)) axhline(0, color='black') ylim(-15, 15) utils.saveplot(N) graph = GraphArtist() graph.draw_horizontal_line(0, linestyle='gray') graph.shade_region(x, d25, d75) graph.plot(x, d50, linestyle=None) graph.set_xlabel(r"$\phi_\mathrm{sim}$ [\si{\degree}]") graph.set_ylabel(r"$\phi_\mathrm{rec} - \phi_\mathrm{sim}$ [\si{\degree}]") graph.set_title(r"$N_\mathrm{MIP} \geq %d$" % N) graph.set_xticks([-180, -90, '...', 180]) graph.set_xlimits(-180, 180) graph.set_ylimits(-17, 17) artist.utils.save_graph(graph, suffix=N, dirname='plots')
def boxplot_phi_reconstruction_results_for_MIP(group, N): table = group.E_1PeV.zenith_22_5 figure() bin_edges = linspace(-180, 180, 18) x, r_dphi = [], [] d25, d50, d75 = [], [], [] for low, high in zip(bin_edges[:-1], bin_edges[1:]): rad_low = deg2rad(low) rad_high = deg2rad(high) query = '(min_n134 >= N) & (rad_low < reference_phi) & (reference_phi < rad_high)' sel = table.readWhere(query) dphi = sel[:]['reconstructed_phi'] - sel[:]['reference_phi'] dphi = (dphi + pi) % (2 * pi) - pi r_dphi.append(rad2deg(dphi)) d25.append(scoreatpercentile(rad2deg(dphi), 25)) d50.append(scoreatpercentile(rad2deg(dphi), 50)) d75.append(scoreatpercentile(rad2deg(dphi), 75)) x.append((low + high) / 2) fill_between(x, d25, d75, color='0.75') plot(x, d50, 'o-', color='black') xlabel(r"$\phi_{simulated}$ [deg]") ylabel(r"$\phi_{reconstructed} - \phi_{simulated}$ [deg]") #title(r"$N_{MIP} \geq %d, \quad \theta = 22.5^\circ$" % N) xticks(linspace(-180, 180, 9)) axhline(0, color='black') ylim(-15, 15) utils.saveplot(N) graph = GraphArtist() graph.draw_horizontal_line(0, linestyle='gray') graph.shade_region(x, d25, d75) graph.plot(x, d50, linestyle=None) graph.set_xlabel(r"$\phi_\mathrm{sim}$ [\si{\degree}]") graph.set_ylabel(r"$\phi_\mathrm{rec} - \phi_\mathrm{sim}$ [\si{\degree}]") graph.set_title(r"$N_\mathrm{MIP} \geq %d$" % N) graph.set_xticks([-180, -90, '...', 180]) graph.set_xlimits(-180, 180) graph.set_ylimits(-17, 17) artist.utils.save_graph(graph, suffix=N, dirname='plots')
def boxplot_theta_reconstruction_results_for_MIP(table, N): figure() DTHETA = deg2rad(1.) angles = [0, 5, 10, 15, 22.5, 35] r_dtheta = [] x = [] d25, d50, d75 = [], [], [] for angle in angles: theta = deg2rad(angle) sel = table.readWhere( '(min_n134 >= N) & (abs(reference_theta - theta) <= DTHETA)') dtheta = rad2deg(sel[:]['reconstructed_theta'] - sel[:]['reference_theta']) r_dtheta.append(dtheta) d25.append(scoreatpercentile(dtheta, 25)) d50.append(scoreatpercentile(dtheta, 50)) d75.append(scoreatpercentile(dtheta, 75)) x.append(angle) #boxplot(r_dtheta, sym='', positions=angles, widths=2.) fill_between(x, d25, d75, color='0.75') plot(x, d50, 'o-', color='black') xlabel(r"$\theta_K$ [deg]") ylabel(r"$\theta_H - \theta_K$ [deg]") title(r"$N_{MIP} \geq %d$" % N) axhline(0, color='black') ylim(-20, 25) xlim(0, 35) utils.saveplot(N) graph = GraphArtist() graph.draw_horizontal_line(0, linestyle='gray') graph.shade_region(angles, d25, d75) graph.plot(angles, d50, linestyle=None) graph.set_xlabel(r"$\theta_K$ [\si{\degree}]") graph.set_ylabel(r"$\theta_H - \theta_K$ [\si{\degree}]") graph.set_ylimits(-5, 15) artist.utils.save_graph(graph, suffix=N, dirname='plots')
def boxplot_theta_reconstruction_results_for_MIP(table, N): figure() DTHETA = deg2rad(1.) angles = [0, 5, 10, 15, 22.5, 35] r_dtheta = [] x = [] d25, d50, d75 = [], [], [] for angle in angles: theta = deg2rad(angle) sel = table.read_where('(min_n134 >= N) & (abs(reference_theta - theta) <= DTHETA)') dtheta = rad2deg(sel[:]['reconstructed_theta'] - sel[:]['reference_theta']) r_dtheta.append(dtheta) d25.append(scoreatpercentile(dtheta, 25)) d50.append(scoreatpercentile(dtheta, 50)) d75.append(scoreatpercentile(dtheta, 75)) x.append(angle) #boxplot(r_dtheta, sym='', positions=angles, widths=2.) fill_between(x, d25, d75, color='0.75') plot(x, d50, 'o-', color='black') xlabel(r"$\theta_K$ [deg]") ylabel(r"$\theta_H - \theta_K$ [deg]") title(r"$N_{MIP} \geq %d$" % N) axhline(0, color='black') ylim(-20, 25) xlim(0, 35) utils.saveplot(N) graph = GraphArtist() graph.draw_horizontal_line(0, linestyle='gray') graph.shade_region(angles, d25, d75) graph.plot(angles, d50, linestyle=None) graph.set_xlabel(r"$\theta_K$ [\si{\degree}]") graph.set_ylabel(r"$\theta_H - \theta_K$ [\si{\degree}]") graph.set_ylimits(-5, 15) artist.utils.save_graph(graph, suffix=N, dirname='plots')
def boxplot_theta_reconstruction_results_for_MIP(group, N): group = group.E_1PeV figure() angles = [0, 5, 10, 15, 22.5, 30, 35, 45] r_dtheta = [] d25, d50, d75 = [], [], [] for angle in angles: table = group._f_getChild('zenith_%s' % str(angle).replace('.', '_')) sel = table.readWhere('min_n134 >= %d' % N) dtheta = sel[:]['reconstructed_theta'] - sel[:]['reference_theta'] r_dtheta.append(rad2deg(dtheta)) d25.append(scoreatpercentile(rad2deg(dtheta), 25)) d50.append(scoreatpercentile(rad2deg(dtheta), 50)) d75.append(scoreatpercentile(rad2deg(dtheta), 75)) fill_between(angles, d25, d75, color='0.75') plot(angles, d50, 'o-', color='black') xlabel(r"$\theta_{simulated}$ [deg]") ylabel(r"$\theta_{reconstructed} - \theta_{simulated}$ [deg]") #title(r"$N_{MIP} \geq %d$" % N) axhline(0, color='black') ylim(-10, 25) utils.saveplot(N) graph = GraphArtist() graph.draw_horizontal_line(0, linestyle='gray') graph.shade_region(angles, d25, d75) graph.plot(angles, d50, linestyle=None) graph.set_xlabel(r"$\theta_\mathrm{sim}$ [\si{\degree}]") graph.set_ylabel( r"$\theta_\mathrm{rec} - \theta_\mathrm{sim}$ [\si{\degree}]") graph.set_title(r"$N_\mathrm{MIP} \geq %d$" % N) graph.set_ylimits(-8, 22) artist.utils.save_graph(graph, suffix=N, dirname='plots')
def boxplot_theta_reconstruction_results_for_MIP(group, N): group = group.E_1PeV figure() angles = [0, 5, 10, 15, 22.5, 30, 35, 45] r_dtheta = [] d25, d50, d75 = [], [], [] for angle in angles: table = group._f_get_child('zenith_%s' % str(angle).replace('.', '_')) sel = table.read_where('min_n134 >= %d' % N) dtheta = sel[:]['reconstructed_theta'] - sel[:]['reference_theta'] r_dtheta.append(rad2deg(dtheta)) d25.append(scoreatpercentile(rad2deg(dtheta), 25)) d50.append(scoreatpercentile(rad2deg(dtheta), 50)) d75.append(scoreatpercentile(rad2deg(dtheta), 75)) fill_between(angles, d25, d75, color='0.75') plot(angles, d50, 'o-', color='black') xlabel(r"$\theta_{simulated}$ [deg]") ylabel(r"$\theta_{reconstructed} - \theta_{simulated}$ [deg]") #title(r"$N_{MIP} \geq %d$" % N) axhline(0, color='black') ylim(-10, 25) utils.saveplot(N) graph = GraphArtist() graph.draw_horizontal_line(0, linestyle='gray') graph.shade_region(angles, d25, d75) graph.plot(angles, d50, linestyle=None) graph.set_xlabel(r"$\theta_\mathrm{sim}$ [\si{\degree}]") graph.set_ylabel(r"$\theta_\mathrm{rec} - \theta_\mathrm{sim}$ [\si{\degree}]") graph.set_title(r"$N_\mathrm{MIP} \geq %d$" % N) graph.set_ylimits(-8, 22) artist.utils.save_graph(graph, suffix=N, dirname='plots')