Skip to content

Commit

Permalink
Validate the number of S1/2 group
Browse files Browse the repository at this point in the history
  • Loading branch information
dachengx committed Jan 14, 2025
1 parent e3ba229 commit 3571d49
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions axidence/plugins/pairing/peaks_paired.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,9 @@ def shadow_matching(
_s1_group_index[s1_digit == xd].tolist()
for xd in range(n_shadow_bins * n_shadow_bins)
]
n_s1_group = np.array([len(s) for s in s1_group_index_list])
if np.any(n_s1_group != s1_shadow_count.flatten()):
raise ValueError("Mismatch in number of S1s in group!")

drift_time_bins = np.linspace(min_drift_time, max_drift_time, n_drift_time_bins + 1)
drift_time_bin_center = (drift_time_bins[:-1] + drift_time_bins[1:]) / 2
Expand Down Expand Up @@ -409,6 +412,9 @@ def shadow_matching(
_s2_group_index[s2_digit == xd].tolist()
for xd in range(n_shadow_bins * n_shadow_bins)
]
n_s2_group = np.array([len(s) for s in s2_group_index_list])
if np.any(n_s2_group != s2_shadow_count.flatten()):
raise ValueError("Mismatch in number of S2s in group!")
# random sample isolated S1 and S2's group number
_s1_group_index = np.hstack(
[
Expand Down

0 comments on commit 3571d49

Please sign in to comment.