18
18
19
19
from .compat import CTAPIPE_GE_0_21
20
20
from .containers import LSTArrayEventContainer
21
+ from .evb_preprocessing import EVBPreprocessingFlag
21
22
22
23
23
24
from .constants import (
@@ -225,6 +226,9 @@ def __init__(self, subarray, config=None, parent=None, **kwargs):
225
226
def apply_drs4_corrections (self , event : LSTArrayEventContainer ):
226
227
227
228
for tel_id in event .trigger .tels_with_trigger :
229
+ tdp_action = event .lst .tel [tel_id ].evt .tdp_action
230
+ preprocessing = EVBPreprocessingFlag (tdp_action or 0 )
231
+
228
232
r1 = event .r1 .tel [tel_id ]
229
233
# If r1 was not yet filled, copy of r0 converted
230
234
if r1 .waveform is None :
@@ -244,21 +248,20 @@ def apply_drs4_corrections(self, event: LSTArrayEventContainer):
244
248
r1 .waveform = r1 .waveform .astype (np .float32 , copy = False )
245
249
246
250
# apply drs4 corrections
247
- if self .apply_drs4_pedestal_correction :
251
+ if self .apply_drs4_pedestal_correction and EVBPreprocessingFlag . BASELINE_SUBTRACTION not in preprocessing :
248
252
self .subtract_pedestal (event , tel_id )
249
253
250
- if self .apply_timelapse_correction :
254
+ if self .apply_timelapse_correction and EVBPreprocessingFlag . DELTA_T_CORRECTION not in preprocessing :
251
255
self .time_lapse_corr (event , tel_id )
252
256
else :
253
257
self .update_last_readout_times (event , tel_id )
254
258
255
- if self .apply_spike_correction :
259
+ if self .apply_spike_correction and EVBPreprocessingFlag . SPIKE_REMOVAL not in preprocessing :
256
260
if self .spike_correction_method == 'subtraction' :
257
261
self .subtract_spikes (event , tel_id )
258
262
else :
259
263
self .interpolate_spikes (event , tel_id )
260
264
261
-
262
265
# remove samples at beginning / end of waveform
263
266
start = self .r1_sample_start .tel [tel_id ]
264
267
end = self .r1_sample_end .tel [tel_id ]
0 commit comments