Skip to content

Commit

Permalink
Test rotation slicing for all cameras
Browse files Browse the repository at this point in the history
  • Loading branch information
maxnoe committed Oct 11, 2018
1 parent 84f898d commit 9d43744
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions ctapipe/instrument/tests/test_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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():
Expand Down

0 comments on commit 9d43744

Please sign in to comment.