Пример #1
0
def test_camera_enable_pixel_picker(example_event):
    t = list(example_event.r0.tels_with_data)[0]
    geom = example_event.inst.subarray.tel[t].camera
    n_pixels = geom.pix_x.value.size
    image = np.ones(n_pixels)
    c_display = CameraDisplay(geom, image)

    c_display.enable_pixel_picker(2)
    assert len(c_display.active_pixels) == 2

    c_display.enable_pixel_picker(3)
    assert len(c_display.active_pixels) == 3
Пример #2
0
def test_camera_enable_pixel_picker(example_event, example_subarray):
    from ctapipe.visualization.bokeh import CameraDisplay
    t = list(example_event.r0.tels_with_data)[0]
    geom = example_subarray.tel[t].camera.geometry
    n_pixels = geom.pix_x.value.size
    image = np.ones(n_pixels)
    c_display = CameraDisplay(geom, image)

    c_display.enable_pixel_picker(2)
    assert len(c_display.active_pixels) == 2

    c_display.enable_pixel_picker(3)
    assert len(c_display.active_pixels) == 3
Пример #3
0
def test_camera_enable_pixel_picker(example_event):
    from ctapipe.visualization.bokeh import CameraDisplay
    t = list(example_event.r0.tels_with_data)[0]
    geom = example_event.inst.subarray.tel[t].camera
    n_pixels = geom.pix_x.value.size
    image = np.ones(n_pixels)
    c_display = CameraDisplay(geom, image)

    c_display.enable_pixel_picker(2)
    assert len(c_display.active_pixels) == 2

    c_display.enable_pixel_picker(3)
    assert len(c_display.active_pixels) == 3
Пример #4
0
def test_camera_enable_pixel_picker(example_event, example_subarray):
    """Test we can call enable_pixel_picker"""
    from ctapipe.visualization.bokeh import CameraDisplay

    t = list(example_event.r0.tel.keys())[0]
    geom = example_subarray.tel[t].camera.geometry
    n_pixels = geom.pix_x.value.size
    image = np.ones(n_pixels)
    c_display = CameraDisplay(geom, image)

    def callback(attr, new, old):
        print(attr, new, old)

    c_display.enable_pixel_picker(callback)