Skip to content

Commit

Permalink
Fix impact being written for non-triggered telescopes, fixes #1961 (#…
Browse files Browse the repository at this point in the history
…1967)

* Fix impact being written for non-triggered telescopes, fixes #1961

* Fix test now that impacts are only written for triggered telescopes
  • Loading branch information
maxnoe authored Jun 28, 2022
1 parent 4283aac commit 8c24857
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ctapipe/io/tests/test_table_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def test_read_telescope_events_type(test_file_dl2):
assert "HillasReconstructor_alt" in table.colnames
assert "true_energy" in table.colnames
assert "true_image" in table.colnames
assert {25, 125, 127}.issubset(set(table["tel_id"].data))
assert set(table["tel_id"].data).issubset([25, 125, 130])
assert "equivalent_focal_length" in table.colnames
assert "HillasReconstructor_impact_distance" in table.colnames

Expand Down
6 changes: 3 additions & 3 deletions ctapipe/reco/shower_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ def __call__(self, event: ArrayEventContainer):
shower_geom=event.dl2.stereo.geometry[k], subarray=self.subarray
)

for tel_index, impact_distance in enumerate(impact_distances):
tel_id = self.subarray.tel_ids[tel_index]
for tel_id in event.trigger.tels_with_trigger:
tel_index = self.subarray.tel_indices[tel_id]
event.dl2.tel[tel_id].impact[k] = TelescopeImpactParameterContainer(
distance=impact_distance
distance=impact_distances[tel_index]
)

0 comments on commit 8c24857

Please sign in to comment.