示例#1
0
def test_camera_image(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)
    colors = intensity_to_hex(image)

    with pytest.raises(ValueError):
        CameraDisplay(None, image)

    c_display = CameraDisplay(geom, image)
    assert (c_display.cdsource.data['image'] == colors).all()
    assert c_display.image_min == 0
    assert c_display.image_max == 2

    image[5] = 5
    colors = intensity_to_hex(image)
    c_display.image = image
    assert (c_display.cdsource.data['image'] == colors).all()
    assert c_display.image_min == image.min()
    assert c_display.image_max == image.max()
示例#2
0
def test_camera_image(example_event, example_subarray):
    from ctapipe.visualization.bokeh import CameraDisplay, intensity_to_hex

    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)
    colors = intensity_to_hex(image)

    with pytest.raises(ValueError):
        CameraDisplay(None, image)

    c_display = CameraDisplay(geom, image)
    assert (c_display.cdsource.data["image"] == colors).all()
    assert c_display.image_min == 0
    assert c_display.image_max == 2

    image[5] = 5
    colors = intensity_to_hex(image)
    c_display.image = image
    assert (c_display.cdsource.data["image"] == colors).all()
    assert c_display.image_min == image.min()
    assert c_display.image_max == image.max()
示例#3
0
def test_camera_image(example_event):
    from ctapipe.visualization.bokeh import CameraDisplay, intensity_to_hex

    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)
    colors = intensity_to_hex(image)

    with pytest.raises(ValueError):
        CameraDisplay(None, image)

    c_display = CameraDisplay(geom, image)
    assert (c_display.cdsource.data['image'] == colors).all()
    assert c_display.image_min == 0
    assert c_display.image_max == 2

    image[5] = 5
    colors = intensity_to_hex(image)
    c_display.image = image
    assert (c_display.cdsource.data['image'] == colors).all()
    assert c_display.image_min == image.min()
    assert c_display.image_max == image.max()
示例#4
0
def test_fast_camera_image(example_event):
    t = list(example_event.r0.tels_with_data)[0]
    geom = example_event.inst.subarray.tel[t].camera

    x = geom.pix_x.value
    y = geom.pix_y.value
    area = geom.pix_area.value
    size = np.sqrt(area)

    c_display = FastCameraDisplay(x, y, size)

    image = np.ones(x.size)
    colors = intensity_to_hex(image)
    c_display.image = colors

    assert (c_display.cdsource.data['image'] == colors).all()
示例#5
0
def test_fast_camera_image(example_event, example_subarray):
    from ctapipe.visualization.bokeh import FastCameraDisplay, intensity_to_hex

    t = list(example_event.r0.tels_with_data)[0]
    geom = example_subarray.tel[t].camera.geometry

    x = geom.pix_x.value
    y = geom.pix_y.value
    area = geom.pix_area.value
    size = np.sqrt(area)

    c_display = FastCameraDisplay(x, y, size)

    image = np.ones(x.size)
    colors = intensity_to_hex(image)
    c_display.image = colors

    assert (c_display.cdsource.data["image"] == colors).all()
示例#6
0
def test_fast_camera_image(example_event):
    from ctapipe.visualization.bokeh import FastCameraDisplay, intensity_to_hex

    t = list(example_event.r0.tels_with_data)[0]
    geom = example_event.inst.subarray.tel[t].camera

    x = geom.pix_x.value
    y = geom.pix_y.value
    area = geom.pix_area.value
    size = np.sqrt(area)

    c_display = FastCameraDisplay(x, y, size)

    image = np.ones(x.size)
    colors = intensity_to_hex(image)
    c_display.image = colors

    assert (c_display.cdsource.data['image'] == colors).all()