Skip to content

Commit

Permalink
Fix lstchain_r0g_to_r0v.py
Browse files Browse the repository at this point in the history
For interleaved events, the event status was not properly updated!
  • Loading branch information
moralejo authored May 7, 2024
1 parent 8bfba0f commit f6b21d9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lstchain/scripts/lstchain_r0g_to_r0v.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,15 @@ def main():
wf = wf.reshape((num_gains, num_pixels, num_samples))

evtype = event_type[event.event_id]

pixel_status = protozfits.any_array_to_numpy(event.pixel_status)
ordered_pix_mask = np.array(num_pixels*[True])

if evtype in EVENT_TYPES_TO_REDUCE:
pixmask = pixel_mask[event.event_id]
ordered_pix_mask = pixmask[pixel_id_map]
new_wf = wf[:, ordered_pix_mask, :]
event.waveform.data = new_wf.tobytes()
pixel_status = protozfits.any_array_to_numpy(event.pixel_status)

# Modify pixel status as needed
new_status = np.where(ordered_pix_mask,
pixel_status | PixelStatus.DVR_STATUS_0,
Expand Down

0 comments on commit f6b21d9

Please sign in to comment.