Skip to content

Commit

Permalink
Raise good error message in case border slices removed by EVB
Browse files Browse the repository at this point in the history
  • Loading branch information
maxnoe committed Jul 29, 2024
1 parent a145edd commit 7889ee5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/ctapipe_io_lst/calibration.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,15 @@ def apply_drs4_corrections(self, event: LSTArrayEventContainer):
if r1.waveform is None:
r1.waveform = event.r0.tel[tel_id].waveform

n_samples = r1.waveform.shape[-1]
if n_samples != N_SAMPLES:
msg = (

Check warning on line 235 in src/ctapipe_io_lst/calibration.py

View check run for this annotation

Codecov / codecov/patch

src/ctapipe_io_lst/calibration.py#L235

Added line #L235 was not covered by tests
f"Data has n_samples={n_samples}, expected {N_SAMPLES}."
" Applying offline drs4 corrections to data with border samples"
" already removed by EVB is not supported."
)
raise NotImplementedError(msg)

Check warning on line 240 in src/ctapipe_io_lst/calibration.py

View check run for this annotation

Codecov / codecov/patch

src/ctapipe_io_lst/calibration.py#L240

Added line #L240 was not covered by tests

# float32 can represent all values of uint16 exactly,
# so this does not loose precision.
r1.waveform = r1.waveform.astype(np.float32, copy=False)
Expand Down

0 comments on commit 7889ee5

Please sign in to comment.