From 9d43744aaa1f0c1eb3a2b6fb02ea37ea6eedf8dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20N=C3=B6the?= Date: Sat, 22 Sep 2018 14:06:14 +0200 Subject: [PATCH] Test rotation slicing for all cameras --- ctapipe/instrument/tests/test_camera.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/ctapipe/instrument/tests/test_camera.py b/ctapipe/instrument/tests/test_camera.py index 57bc726e3c4..82193526ee1 100644 --- a/ctapipe/instrument/tests/test_camera.py +++ b/ctapipe/instrument/tests/test_camera.py @@ -6,8 +6,6 @@ _get_min_pixel_seperation, ) import pytest -from ctapipe.io.eventsourcefactory import EventSourceFactory -from ctapipe.utils import get_dataset_path cam_ids = CameraGeometry.get_known_camera_names() @@ -154,17 +152,14 @@ def test_slicing(): assert len(sliced2.pix_x) == 5 -def test_slicing_rotation(): - event_source = EventSourceFactory.produce( - input_url=get_dataset_path('gamma_test.simtel.gz'), - product='HESSIOEventSource', - ) - e = next(iter(event_source)) - geom = e.inst.subarray.tel[1].camera +@pytest.mark.parametrize("cam_id", cam_ids) +def test_slicing_rotation(cam_id): + cam = CameraGeometry.from_name(cam_id) + cam.rotate('25d') - sliced1 = geom[5:10] + sliced1 = cam[5:10] - assert sliced1.pix_x[0] == geom.pix_x[5] + assert sliced1.pix_x[0] == cam.pix_x[5] def test_border_pixels():