def plot_discrete(angles): theta, phi = zip(*angles) graph = PolarPlot(use_radians=True) graph.scatter(phi, theta, markstyle='mark size=.5pt') graph.set_ylimits(0, np.pi / 2) graph.set_yticks([0, np.pi / 6, np.pi / 3, np.pi / 2]) graph.set_ytick_labels([ r'$0$', r'$\frac{1}{6}\pi$', r'$\frac{2}{6}\pi$', r'$\frac{1}{2}\pi$', ]) graph.set_ylabel('Zenith [rad]') graph.set_xlabel('Azimuth [rad]') graph.save_as_pdf('discrete_directions')
def discrete_directions(): graph = PolarPlot(use_radians=True) times = generate_discrete_times(station, detector_ids=[0, 1, 2]) detectors = [station.detectors[id].get_coordinates() for id in [0, 1, 2]] x, y, z = zip(*detectors) theta, phi = itertools.izip(*(dirrec.reconstruct_common((0,) + t, x, y, z) for t in times)) thetaa = [t for t in theta if not np.isnan(t)] phia = [p for p in phi if not np.isnan(p)] graph.scatter(phia, thetaa, markstyle='mark size=1pt', mark='*') graph.set_ylimits(0, np.pi / 2) graph.set_yticks([0, np.pi / 6, np.pi / 3, np.pi / 2]) graph.set_ytick_labels([r'$0$', r'$\frac{1}{6}\pi$', r'$\frac{2}{6}\pi$', r'$\frac{1}{2}\pi$', ]) graph.set_ylabel('Zenith [rad]') graph.set_xlabel('Azimuth [rad]') graph.save_as_pdf('discrete_directions')
def reconstruct_for_detectors(ids): graph = PolarPlot(use_radians=True) times = generate_discrete_times(station, detector_ids=ids) detectors = [station.detectors[id].get_coordinates() for id in ids] x, y, z = zip(*detectors) theta, phi = itertools.izip(*(dirrec.reconstruct_common((0,) + t, x, y, z) for t in times)) thetaa = [t for t in theta if not np.isnan(t)] phia = [p for p in phi if not np.isnan(p)] graph.scatter(phia, thetaa, markstyle='mark size=.5pt', mark='*') # Add curved lines where detector 0 and 2 have fixed but different times # and a straight line where detector 0 and 2 have equal times times = np.arange(-60, 60, TIME_RESOLUTION) for dt in (-2.5, 0, 2.5, 7.5, 15, 22.5, 30, 45): theta, phi = itertools.izip(*(dirrec.reconstruct_common((t, 0, dt), x, y, z) for t in times)) thetaa = [t for t in theta if not np.isnan(t)] phia = [p for p in phi if not np.isnan(p)] graph.plot(phia, thetaa, mark=None, linestyle='solid,' + COLORS[ids[0]]) theta, phi = itertools.izip(*(dirrec.reconstruct_common((0, t, dt), x, y, z) for t in times)) thetaa = [t for t in theta if not np.isnan(t)] phia = [p for p in phi if not np.isnan(p)] graph.plot(phia, thetaa, mark=None, linestyle='solid,' + COLORS[ids[1]]) theta, phi = itertools.izip(*(dirrec.reconstruct_common((0, dt, t), x, y, z) for t in times)) thetaa = [t for t in theta if not np.isnan(t)] phia = [p for p in phi if not np.isnan(p)] graph.plot(phia, thetaa, mark=None, linestyle='solid,' + COLORS[ids[2]]) graph.set_ylimits(0, np.pi / 2) graph.set_yticks([0, np.pi / 6, np.pi / 3, np.pi / 2]) graph.set_ytick_labels([r'$0$', r'$\frac{1}{6}\pi$', r'$\frac{2}{6}\pi$', r'$\frac{1}{2}\pi$', ]) graph.set_ylabel('Zenith [rad]') graph.set_xlabel('Azimuth [rad]') graph.save_as_pdf('discrete_directions_%s' % '_'.join(str(i) for i in ids))