Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapt the pixel_status to the change on the R1 format #68

Merged
merged 1 commit into from
Mar 4, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/ctapipe_io_nectarcam/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1269,9 +1269,13 @@ def fill_mon_container_from_zfile(self, array_event, event):
status_container = array_event.mon.tel[self.tel_id].pixel_status

# reorder the array
pixel_status = np.zeros(N_PIXELS)
pixel_status = np.zeros(
N_PIXELS, dtype=event.pixel_status.dtype
) # pixel status is 8 bit
pixel_status[self.nectarcam_service.pixel_ids] = event.pixel_status
status_container.hardware_failing_pixels[:] = pixel_status == 0
# According to A.1.5 of the R1 format, pixel is off/broken/missing
# if bit 2 and 3 are at 0.
status_container.hardware_failing_pixels[:] = (pixel_status & 0xC) == 0


class LightNectarCAMEventSource(NectarCAMEventSource):
Expand Down