Skip to content

Commit

Permalink
Merge pull request #1251 from cta-observatory/r0g_r0v_bugfix
Browse files Browse the repository at this point in the history
Fix lstchain_r0g_to_r0v.py
  • Loading branch information
rlopezcoto authored May 8, 2024
2 parents 8bfba0f + f6b21d9 commit 3344a5b
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 3344a5b

Please sign in to comment.