Skip to content

Commit 7889ee5

Browse files
committed
Raise good error message in case border slices removed by EVB
1 parent a145edd commit 7889ee5

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/ctapipe_io_lst/calibration.py

+9
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,15 @@ def apply_drs4_corrections(self, event: LSTArrayEventContainer):
230230
if r1.waveform is None:
231231
r1.waveform = event.r0.tel[tel_id].waveform
232232

233+
n_samples = r1.waveform.shape[-1]
234+
if n_samples != N_SAMPLES:
235+
msg = (
236+
f"Data has n_samples={n_samples}, expected {N_SAMPLES}."
237+
" Applying offline drs4 corrections to data with border samples"
238+
" already removed by EVB is not supported."
239+
)
240+
raise NotImplementedError(msg)
241+
233242
# float32 can represent all values of uint16 exactly,
234243
# so this does not loose precision.
235244
r1.waveform = r1.waveform.astype(np.float32, copy=False)

0 commit comments

Comments
 (0)