Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
iguinn committed Apr 28, 2024
2 parents 43dd6f7 + b67ca0e commit d3fec03
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
4 changes: 2 additions & 2 deletions tests/configs/icpc-dsp-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"cuspEmax",
"zacEmax",
"zacEftp",
"cuspEftp",
"cuspEftp"
],
"processors": {
"tp_min, tp_max, wf_min, wf_max": {
Expand Down Expand Up @@ -350,6 +350,6 @@
"module": "numpy",
"args": ["tp_0_est", "tp_aoe_max/16", "tp_aoe_samp"],
"unit": "ns"
},
}
}
}
19 changes: 12 additions & 7 deletions tests/processors/test_time_point_thresh.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def test_bi_level_zero_crossing_time_points(compare_numba_vs_python):
# ensure that if there is a nan in w_in, all nans are outputted
w_in = np.ones(100)
w_in[4] = np.nan
n_out = np.zeros(1, 'uint32')
n_out = np.zeros(1, "uint32")
t_out = np.zeros(5)
pol_out = np.zeros(5)
bi_level_zero_crossing_time_points(w_in, 100, 100, 100, 0, n_out, pol_out, t_out)
Expand Down Expand Up @@ -324,7 +324,14 @@ def test_bi_level_zero_crossing_time_points(compare_numba_vs_python):
t_trig_times_out = np.zeros(5)
pol_out = np.zeros(5)
bi_level_zero_crossing_time_points(
-1 * np.linspace(-1, 100, 101), 4, -4, gate_time, 0, n_out, pol_out, t_trig_times_out
-1 * np.linspace(-1, 100, 101),
4,
-4,
gate_time,
0,
n_out,
pol_out,
t_trig_times_out,
)
assert np.isnan(t_trig_times_out).all()
assert np.isnan(pol_out).all()
Expand Down Expand Up @@ -369,13 +376,11 @@ def test_bi_level_zero_crossing_time_points(compare_numba_vs_python):
assert int(pol_out[0]) == 1

# Check for overflow. This should not fail and should return n_crossings greater than the length of the outputs
w_in = np.zeros(100, 'float')*10
w_in = np.zeros(100, "float") * 10
w_in[::2] = -10
w_in[1::2] = 10
pol_out = np.zeros(30)
t_trig_out = np.zeros(30)
bi_level_zero_crossing_time_points(
w_in, 1, 1, 10, 0, n_out, pol_out, t_trig_out
)
assert np.all(pol_out==0)
bi_level_zero_crossing_time_points(w_in, 1, 1, 10, 0, n_out, pol_out, t_trig_out)
assert np.all(pol_out == 0)
assert n_out[0] == 49

0 comments on commit d3fec03

Please sign in to comment.