From bc7134cfaebcc938c68fbc2b9ef6b6ef943e2636 Mon Sep 17 00:00:00 2001 From: chaithyagr Date: Fri, 27 Jun 2025 11:31:38 +0200 Subject: [PATCH 1/2] Update the codes --- mapvbvd/twix_map_obj.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mapvbvd/twix_map_obj.py b/mapvbvd/twix_map_obj.py index 5dfbb84..f4bce88 100644 --- a/mapvbvd/twix_map_obj.py +++ b/mapvbvd/twix_map_obj.py @@ -427,7 +427,11 @@ def clean(self): self.NIdc = np.max(self.Idc) + 1 self.NIdd = np.max(self.Idd) + 1 self.NIde = np.max(self.Ide) + 1 - + if int(self.NLin) == 1<<16: + if len(self.Lin) > self.NLin // self.NRep: + logging.warning('NLin is at maximum value for uint16, this may cause issues with indexing, trrying to fix') + self.NLin = len(self.Lin) // self.NRep + # ok, let us assume for now that all NCol and NCha entries are # the same for all mdhs: From f1fee6241b417d4c818016ce599461c186858e89 Mon Sep 17 00:00:00 2001 From: chaithyagr Date: Fri, 27 Jun 2025 13:20:42 +0200 Subject: [PATCH 2/2] Handle the overflow artifacts --- mapvbvd/twix_map_obj.py | 1 + 1 file changed, 1 insertion(+) diff --git a/mapvbvd/twix_map_obj.py b/mapvbvd/twix_map_obj.py index f4bce88..3a172aa 100644 --- a/mapvbvd/twix_map_obj.py +++ b/mapvbvd/twix_map_obj.py @@ -431,6 +431,7 @@ def clean(self): if len(self.Lin) > self.NLin // self.NRep: logging.warning('NLin is at maximum value for uint16, this may cause issues with indexing, trrying to fix') self.NLin = len(self.Lin) // self.NRep + self.Lin = np.arange(self.NLin) # ok, let us assume for now that all NCol and NCha entries are # the same for all mdhs: