From 94969cdfa94c5da5a36db7b51dca34fcfec166d5 Mon Sep 17 00:00:00 2001 From: Kai Bruegge Date: Wed, 10 Jul 2019 16:11:52 +0200 Subject: [PATCH 1/2] add dimension to gain mask if ndim equals 1 --- dl1_data_handler/writer.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dl1_data_handler/writer.py b/dl1_data_handler/writer.py index 93b8d122..fb2fcd6f 100644 --- a/dl1_data_handler/writer.py +++ b/dl1_data_handler/writer.py @@ -987,11 +987,15 @@ def gain_selection(self, waveform, image, peakpos, cam_id, threshold): combined_image.shape = image.shape[1] """ + # print(image.shape[0] == 2) assert image.shape[0] == 2 self.gain_selector.thresholds[cam_id] = threshold waveform, gain_mask = self.gain_selector.select_gains(cam_id, waveform) + if gain_mask.ndim == 1: + gain_mask = gain_mask[:, None] + signal_mask = gain_mask.max(axis=1) combined_image = image[0].copy() From 7e73bcdc0ffbf050f95a602f6929f186056a4926 Mon Sep 17 00:00:00 2001 From: Kai Bruegge Date: Wed, 10 Jul 2019 16:13:56 +0200 Subject: [PATCH 2/2] remove print --- dl1_data_handler/writer.py | 1 - 1 file changed, 1 deletion(-) diff --git a/dl1_data_handler/writer.py b/dl1_data_handler/writer.py index fb2fcd6f..f4c13dc7 100644 --- a/dl1_data_handler/writer.py +++ b/dl1_data_handler/writer.py @@ -987,7 +987,6 @@ def gain_selection(self, waveform, image, peakpos, cam_id, threshold): combined_image.shape = image.shape[1] """ - # print(image.shape[0] == 2) assert image.shape[0] == 2 self.gain_selector.thresholds[cam_id] = threshold