Skip to content

Commit

Permalink
Merge pull request #144 from cta-observatory/report_lengths
Browse files Browse the repository at this point in the history
Fix issue with drive report and bending model tables not having the same length
  • Loading branch information
maxnoe authored Mar 9, 2022
2 parents 9fc45e0 + 986f283 commit 5b7b363
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ctapipe_io_lst/pointing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 5b7b363

Please sign in to comment.