Esempio n. 1
0
    def peek(self):
        """
        Draw a quick matplotlib plot of the array
        """
        from ctapipe.coordinates.ground_frames import EastingNorthingFrame
        from ctapipe.visualization import ArrayDisplay
        from matplotlib import pyplot as plt

        plt.figure(figsize=(8, 8))
        ad = ArrayDisplay(subarray=self, frame=EastingNorthingFrame(), tel_scale=0.75)
        ad.add_labels()
        plt.title(self.name)
        plt.tight_layout()
Esempio n. 2
0
    # pointing direction of the telescopes
    point_azimuth = {}
    point_altitude = {}

    subarray = source.subarray
    calib = CameraCalibrator(subarray=subarray)
    off_angles = []
    first_event = True
    markers = None

    for event in source:
        if first_event:
            fig, ax = plt.subplots(1, 1, figsize=(10, 8))
            array_disp = ArrayDisplay(subarray, axes=ax, tel_scale=1.0)
            array_disp.telescopes.set_linewidth(3)
            array_disp.add_labels()
            first_event = False
            hit_pattern = np.zeros(subarray.num_tels)

        if len(event.r0.tel.keys()) < 3:
            continue

        # calibrating the event
        calib(event)
        hillas_dict = {}
        timing_dict = {}

        # plot the core position, which must be transformed from the tilted
        # system to the system that the ArrayDisplay is in (default
        # GroundFrame)
        point_dir = SkyCoord(
Esempio n. 3
0
    # display the array
    subarray = event.inst.subarray
    ad = ArrayDisplay(subarray, tel_scale=3.0)

    print("Now setting vectors")
    plt.pause(1.0)
    plt.tight_layout()

    for phi in np.linspace(0, 360, 30) * u.deg:
        r = np.cos(phi / 2)
        ad.set_vector_rho_phi(r, phi)
        plt.pause(0.01)

    ad.set_vector_rho_phi(0, 0 * u.deg)
    plt.pause(1.0)

    print("Now setting values")
    ad.telescopes.set_linewidth(0)
    for ii in range(50):
        vals = np.random.uniform(100.0, size=subarray.num_tels)
        ad.values = vals
        plt.pause(0.01)

    print("Setting labels")
    for ii in range(3):
        ad.add_labels()
        plt.pause(0.5)
        ad.remove_labels()
        plt.pause(0.5)
Esempio n. 4
0
    point_altitude = {}

    calib = CameraCalibrator(eventsource=source)
    off_angles = []
    first_event = True
    markers = None

    for event in source:

        subarray = event.inst.subarray

        if first_event:
            fig, ax = plt.subplots(1, 1, figsize=(10, 8))
            array_disp = ArrayDisplay(subarray, axes=ax, tel_scale=1.0)
            array_disp.telescopes.set_linewidth(3)
            array_disp.add_labels()
            first_event = False
            hit_pattern = np.zeros(subarray.num_tels)

        if len(event.r0.tels_with_data) < 3:
            continue

        # calibrating the event
        calib.calibrate(event)
        hillas_dict = {}

        # plot the core position, which must be transformed from the tilted
        # system to the system that the ArrayDisplay is in (default
        # GroundFrame)
        point_dir = SkyCoord(
            *event.mcheader.run_array_direction,