Skip to content

Commit c963fdc

Browse files
author
Wenz
committed
Changed needs for find_hits in test_ accordingly
1 parent b549150 commit c963fdc

2 files changed

Lines changed: 21 additions & 2 deletions

File tree

tests/test_data_reduction.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,17 @@
77
@settings(deadline=None)
88
@given(single_fake_pulse)
99
def test_cut_outside_hits(records):
10-
hits = strax.find_hits(records, threshold=0)
10+
default_thresholds = np.zeros(248,
11+
dtype=[(('Hitfinder threshold in absolute adc counts above baseline',
12+
'absolute_adc_counts_threshold'), np.int16),
13+
(('Multiplicator for a RMS based threshold (h_o_n * RMS).',
14+
'height_over_noise'),
15+
np.float32),
16+
(('Channel/PMT number', 'channel'), np.int16)
17+
])
18+
default_thresholds['channel'] = np.arange(0, 248, 1, dtype=np.int16)
19+
20+
hits = strax.find_hits(records, threshold=default_thresholds)
1121

1222
# Set all record waveforms to 1 (still and 0 out of bounds)
1323
for r in records:

tests/test_pulse_processing.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,16 @@
88

99

1010
def _find_hits(r):
11-
hits = strax.find_hits(r, threshold=0)
11+
default_thresholds = np.zeros(248,
12+
dtype=[(('Hitfinder threshold in absolute adc counts above baseline',
13+
'absolute_adc_counts_threshold'), np.int16),
14+
(('Multiplicator for a RMS based threshold (h_o_n * RMS).',
15+
'height_over_noise'),
16+
np.float32),
17+
(('Channel/PMT number', 'channel'), np.int16)
18+
])
19+
default_thresholds['channel'] = np.arange(0, 248, 1, dtype=np.int16)
20+
hits = strax.find_hits(r, threshold=default_thresholds)
1221
# Test pulses have dt=1 and time=0
1322
# TODO: hm, maybe this doesn't test everything
1423
np.testing.assert_equal(hits['time'], hits['left'])

0 commit comments

Comments
 (0)