Skip to content

Commit 8a6b4d6

Browse files
committed
typo randint
1 parent ba45132 commit 8a6b4d6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dl1_data_handler/reader.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1839,7 +1839,7 @@ def _get_balanced_patches(self, batch):
18391839
tel_index.extend([tel_id] * 2 * comparator)
18401840
# If there is no cosmic or nsb patches append random patch
18411841
else:
1842-
rand_index = np.randint(0, len(trigger_patches))
1842+
rand_index = np.random.randint(0, len(trigger_patches))
18431843
patches_indexes.append(rand_index)
18441844
cherenkov.append(true_sums[rand_index])
18451845
nsb_cosmic.append(1 if true_sums[rand_index]<= self.trigger_settings["cpe_threshold"] else 0)
@@ -1953,7 +1953,7 @@ class (1 for nsb, 0 for cosmic), and computes and appends the number of true Che
19531953
if random_trigger_patch:
19541954
nsb_patches = np.where(patch_sums <= self.trigger_settings["cpe_threshold"])[0]
19551955
#If no patches with only nsb take a random patch
1956-
index = np.random.choice(nsb_patches) if len(nsb_patches) != 0 else np.randint(0, len(trigger_patches))
1956+
index = np.random.choice(nsb_patches) if len(nsb_patches) != 0 else np.random.randint(0, len(trigger_patches))
19571957
# Select the patch nearer to the hot pixel
19581958
else:
19591959
patches_x = np.array([patch["x"] for patch in self.trigger_settings["trigger_patches"]])

0 commit comments

Comments
 (0)