straxen.plugins.records package

Submodules

straxen.plugins.records.records module

class straxen.plugins.records.records.PulseProcessing[source]

Bases: Plugin

Split raw_records into:
  • (tpc) records

  • aqmon_records

  • pulse_counts

For TPC records, apply basic processing:
  1. Flip, baseline, and integrate the waveform

  2. Apply software HE veto after high-energy peaks.

  3. Find hits, apply linear filter, and zero outside hits.

pulse_counts holds some average information for the individual PMT channels for each chunk of raw_records. This includes e.g. number of recorded pulses, lone_pulses (pulses which do not overlap with any other pulse), or mean values of baseline and baseline rms channel.

allow_sloppy_chunking

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

baseline_samples

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

check_raw_record_overlaps

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

compressor = 'zstd'
compute(raw_records, start, end)[source]
data_kind: Union[str, immutabledict, dict] = {'pulse_counts': 'pulse_counts', 'records': 'records', 'veto_regions': 'veto_regions'}
depends_on: tuple = 'raw_records'
hev_gain_model

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

hit_min_amplitude

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

infer_dtype()[source]

Return dtype of computed data; used only if no dtype attribute defined.

max_veto_value

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

n_tpc_pmts

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

parallel: Union[str, bool] = 'process'
pmt_pulse_filter

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

provides: Tuple[str, ...] = ('records', 'veto_regions', 'pulse_counts')
rechunk_on_save = immutabledict({'records': False, 'veto_regions': True, 'pulse_counts': True})
save_outside_hits

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

save_when = immutabledict({'records': <SaveWhen.TARGET: 2>, 'veto_regions': <SaveWhen.TARGET: 2>, 'pulse_counts': <SaveWhen.ALWAYS: 3>})
setup()[source]

Hook if plugin wants to do something on initialization.

tail_veto_duration

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

tail_veto_pass_extend

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

tail_veto_pass_fraction

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

tail_veto_resolution

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

tail_veto_threshold

Dispatch on URL protocol.

unrecognized protocol returns identity inspired by dasks Dispatch and fsspec fs protocols.

takes_config = immutabledict({'hev_gain_model': <straxen.url_config.URLConfig object>, 'baseline_samples': <straxen.url_config.URLConfig object>, 'tail_veto_threshold': <straxen.url_config.URLConfig object>, 'tail_veto_duration': <straxen.url_config.URLConfig object>, 'tail_veto_resolution': <straxen.url_config.URLConfig object>, 'tail_veto_pass_fraction': <straxen.url_config.URLConfig object>, 'tail_veto_pass_extend': <straxen.url_config.URLConfig object>, 'max_veto_value': <straxen.url_config.URLConfig object>, 'pmt_pulse_filter': <straxen.url_config.URLConfig object>, 'save_outside_hits': <straxen.url_config.URLConfig object>, 'n_tpc_pmts': <straxen.url_config.URLConfig object>, 'check_raw_record_overlaps': <straxen.url_config.URLConfig object>, 'allow_sloppy_chunking': <straxen.url_config.URLConfig object>, 'hit_min_amplitude': <straxen.url_config.URLConfig object>})
straxen.plugins.records.records.channel_split(rr, first_other_ch)[source]

Return.

straxen.plugins.records.records.check_overlaps(records, n_channels)[source]

Raise a ValueError if any of the pulses in records overlap.

Assumes records is already sorted by time.

straxen.plugins.records.records.mask_and_not(x, mask)[source]
straxen.plugins.records.records.pulse_count_dtype(n_channels)[source]
straxen.plugins.records.records.software_he_veto(records, to_pe, chunk_end, area_threshold=100000, veto_length=3000000, veto_res=1000, pass_veto_fraction=0.01, pass_veto_extend=3, max_veto_value=None)[source]

Veto veto_length (time in ns) after peaks larger than area_threshold (in PE).

Further large peaks inside the veto regions are still passed: We sum the waveform inside the veto region (with time resolution veto_res in ns) and pass regions within pass_veto_extend samples of samples with amplitude above pass_veto_fraction times the maximum.

Returns:

(preserved records, vetoed records, veto intervals).

Parameters:
  • records – PMT records

  • to_pe – ADC to PE conversion factors for the channels in records.

  • chunk_end – Endtime of chunk to set as maximum ceiling for the veto period

  • area_threshold – Minimum peak area to trigger the veto.

Note we use a much rougher clustering than in later processing. :param veto_length: Time in ns to veto after the peak :param veto_res: Resolution of the sum waveform inside the veto region. Do not make too large without increasing integer type in some strax dtypes… :param pass_veto_fraction: fraction of maximum sum waveform amplitude to trigger veto passing of further peaks :param pass_veto_extend: samples to extend (left and right) the pass veto regions. :param max_veto_value: if not None, pass peaks that exceed this area no matter what.

Module contents