Skip to content

Commit

Permalink
Changed needs for find_hits in test_ accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
WenzDaniel committed Feb 17, 2020
1 parent b549150 commit c963fdc
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
12 changes: 11 additions & 1 deletion tests/test_data_reduction.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@
@settings(deadline=None)
@given(single_fake_pulse)
def test_cut_outside_hits(records):
hits = strax.find_hits(records, threshold=0)
default_thresholds = np.zeros(248,
dtype=[(('Hitfinder threshold in absolute adc counts above baseline',
'absolute_adc_counts_threshold'), np.int16),
(('Multiplicator for a RMS based threshold (h_o_n * RMS).',
'height_over_noise'),
np.float32),
(('Channel/PMT number', 'channel'), np.int16)
])
default_thresholds['channel'] = np.arange(0, 248, 1, dtype=np.int16)

hits = strax.find_hits(records, threshold=default_thresholds)

# Set all record waveforms to 1 (still and 0 out of bounds)
for r in records:
Expand Down
11 changes: 10 additions & 1 deletion tests/test_pulse_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,16 @@


def _find_hits(r):
hits = strax.find_hits(r, threshold=0)
default_thresholds = np.zeros(248,
dtype=[(('Hitfinder threshold in absolute adc counts above baseline',
'absolute_adc_counts_threshold'), np.int16),
(('Multiplicator for a RMS based threshold (h_o_n * RMS).',
'height_over_noise'),
np.float32),
(('Channel/PMT number', 'channel'), np.int16)
])
default_thresholds['channel'] = np.arange(0, 248, 1, dtype=np.int16)
hits = strax.find_hits(r, threshold=default_thresholds)
# Test pulses have dt=1 and time=0
# TODO: hm, maybe this doesn't test everything
np.testing.assert_equal(hits['time'], hits['left'])
Expand Down

0 comments on commit c963fdc

Please sign in to comment.