diff --git a/mapvbvd/twix_map_obj.py b/mapvbvd/twix_map_obj.py index 5dfbb84..3a172aa 100644 --- a/mapvbvd/twix_map_obj.py +++ b/mapvbvd/twix_map_obj.py @@ -427,7 +427,12 @@ 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 + self.Lin = np.arange(self.NLin) + # ok, let us assume for now that all NCol and NCha entries are # the same for all mdhs: