Skip to content

Commit

Permalink
Merge 60b20c4 into 85e1610
Browse files Browse the repository at this point in the history
  • Loading branch information
JoranAngevaare committed Apr 9, 2021
2 parents 85e1610 + 60b20c4 commit 586ec66
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions strax/dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
__all__ = ('interval_dtype raw_record_dtype record_dtype hit_dtype peak_dtype '
'DIGITAL_SUM_WAVEFORM_CHANNEL DEFAULT_RECORD_LENGTH '
'time_fields time_dt_fields hitlet_dtype hitlet_with_data_dtype '
'copy_to_buffer').split()
'copy_to_buffer peak_interval_dtype').split()

DIGITAL_SUM_WAVEFORM_CHANNEL = -1
DEFAULT_RECORD_LENGTH = 110
Expand All @@ -33,11 +33,15 @@
(('Width of one sample [ns]',
'dt'), np.int16)]

# Base dtype for interval-like objects (pulse, peak, hit)
# Base dtype for interval-like objects (pulse, hit)
interval_dtype = time_dt_fields + [
(('Channel/PMT number',
'channel'), np.int16)]

# Base dtype with interval like objects for long objects (peaks)
peak_interval_dtype = interval_dtype.copy()
# Allow peaks to have very long dts
peak_interval_dtype[2] = (('Width of one sample [ns]', 'dt'), np.int32)

def raw_record_dtype(samples_per_record=DEFAULT_RECORD_LENGTH):
"""Data type for a waveform raw_record.
Expand Down Expand Up @@ -178,7 +182,7 @@ def peak_dtype(n_channels=100, n_sum_wv_samples=200, n_widths=11):
if n_channels == 1:
raise ValueError("Must have more than one channel")
# Otherwise array changes shape?? badness ensues
return interval_dtype + [
return peak_interval_dtype + [
# For peaklets this is likely to be overwritten:
(('Classification of the peak(let)',
'type'), np.int8),
Expand Down Expand Up @@ -217,7 +221,7 @@ def copy_to_buffer(source: np.ndarray,
with the name 'func_name' (should start with "_").
:param source: array of input
:param destination: array of buffer to fill with values from input
:param buffer: array of buffer to fill with values from input
:param func_name: how to store the dynamically created function.
Should start with an _underscore
:param field_names: dtype names to copy (if none, use all in the
Expand Down

0 comments on commit 586ec66

Please sign in to comment.