From 986f28353af58f56fa5aec0c4d148220c5a092a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20N=C3=B6the?= Date: Wed, 9 Mar 2022 11:59:42 +0100 Subject: [PATCH] Fix issue with drive report and bending model tables not having the same length --- ctapipe_io_lst/pointing.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ctapipe_io_lst/pointing.py b/ctapipe_io_lst/pointing.py index ffada85a..cb3131e0 100644 --- a/ctapipe_io_lst/pointing.py +++ b/ctapipe_io_lst/pointing.py @@ -76,8 +76,12 @@ def _read_drive_report(path): corrections = PointingSource._read_bending_model_corrections(bending_path) # according to an email by Armand Fiasson, the timestamps are guaranteed to be equal + # but it might happen that one report has more rows than the other due to different + # times when they are synced to fefs during the night if len(corrections) != len(data): - raise IOError('Pointing report and bending model correction lengths differ') + n_common = min(len(corrections), len(data)) + corrections = corrections[:n_common] + data = data[:n_common] if np.any(data['unix_time'] != corrections['unix_time']): raise IOError('Drive report and corrections timestamps differ')