@@ -485,17 +485,18 @@ def fill_from_cta_r1(self, array_event, zfits_event):
485
485
)
486
486
487
487
n_channels = zfits_event .num_channels
488
- n_pixels = zfits_event .num_pixels
489
488
n_samples = zfits_event .num_samples
490
489
491
- readout_shape = (n_channels , n_pixels , n_samples )
492
- raw_waveform = zfits_event .waveform .reshape (readout_shape )
493
- waveform = raw_waveform .astype (np .float32 ) / scale - offset
494
-
495
490
if self .dvr_applied :
496
491
stored_pixels = (zfits_event .pixel_status & PixelStatus .DVR_STATUS ) > 0
492
+ n_pixels = np .count_nonzero (stored_pixels )
497
493
else :
498
494
stored_pixels = slice (None ) # all pixels stored
495
+ n_pixels = zfits_event .num_pixels
496
+
497
+ readout_shape = (n_channels , n_pixels , n_samples )
498
+ raw_waveform = zfits_event .waveform .reshape (readout_shape )
499
+ waveform = raw_waveform .astype (np .float32 ) / scale - offset
499
500
500
501
reordered_waveform = np .full ((n_channels , N_PIXELS , n_samples ), 0.0 , dtype = np .float32 )
501
502
reordered_waveform [:, pixel_id_map [stored_pixels ]] = waveform
@@ -531,7 +532,7 @@ def fill_from_cta_r1(self, array_event, zfits_event):
531
532
532
533
if DataLevel .R0 in self .datalevels :
533
534
reordered_raw_waveform = np .full ((n_channels , N_PIXELS , n_samples ), 0 , dtype = np .uint16 )
534
- reordered_raw_waveform [:, pixel_id_map ] = raw_waveform
535
+ reordered_raw_waveform [:, pixel_id_map [ stored_pixels ] ] = raw_waveform
535
536
array_event .r0 .tel [self .tel_id ] = R0CameraContainer (
536
537
waveform = reordered_raw_waveform ,
537
538
)
0 commit comments