Skip to content

Commit 68479e4

Browse files
authored
Merge pull request #68 from vmarandon/UpdateR1Status
Adapt the pixel_status to the change on the R1 format
2 parents af4d667 + 4da6129 commit 68479e4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/ctapipe_io_nectarcam/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,9 +1269,13 @@ def fill_mon_container_from_zfile(self, array_event, event):
12691269
status_container = array_event.mon.tel[self.tel_id].pixel_status
12701270

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

12761280

12771281
class LightNectarCAMEventSource(NectarCAMEventSource):

0 commit comments

Comments
 (0)