Skip to content

Commit

Permalink
Fix number of mirrors, fixes cta-observatory#1057
Browse files Browse the repository at this point in the history
  • Loading branch information
maxnoe committed Apr 25, 2019
1 parent b5c9913 commit 7168956
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ctapipe/io/simteleventsource.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def prepare_subarray_info(self, telescope_descriptions, header):

optics = OpticsDescription(
name=telescope.name,
num_mirrors=cam_settings['n_mirrors'],
num_mirrors=telescope.n_mirrors,
equivalent_focal_length=focal_length,
mirror_area=u.Quantity(cam_settings['mirror_area'], u.m**2),
num_mirror_tiles=cam_settings['n_mirrors'],
Expand Down
8 changes: 8 additions & 0 deletions ctapipe/io/tests/test_simteleventsource.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,3 +203,11 @@ def test_camera_caching():
event = next(iter(source))
subarray = event.inst.subarray
assert subarray.tel[1].camera is subarray.tel[2].camera


def test_instrument():
'''Test if same telescope types share a single instance of CameraGeometry'''
source = SimTelEventSource(input_url=gamma_test_large_path)
event = next(iter(source))
subarray = event.inst.subarray
assert subarray.tel[1].optics.num_mirrors == 1

0 comments on commit 7168956

Please sign in to comment.