straxen.plugins.peaklets package

Submodules

straxen.plugins.peaklets.peaklet_classification module

straxen.plugins.peaklets.peaklet_classification_som module

class straxen.plugins.peaklets.peaklet_classification_som.PeakletClassificationSOM[source]

Bases: PeakletClassificationVanilla

Self-Organizing Maps (SOM) https://xe1t-wiki.lngs.infn.it/doku.php?id=xenon:xenonnt:lsanchez:unsupervised_neural_network_som_methods https://xe1t-wiki.lngs.infn.it/doku.php?id=xenon:xenonnt:lsanchez:som_summary_note For peaklet classification. We this pluggin will provide 2 data types, the ‘type’ we are already familiar with, classifying peaklets as s1, s2 (using the new classification) or unknown (from the previous classification). As well as a new data type, SOM type, which will be assigned numbers based on the cluster in the SOM in which they are found. For each version I will make some documentation in the corrections repository explaining what I believe each cluster represents.

This correction/plugin is currently on the testing phase, feel free to use it if you are curious or just want to test it or try it out but note this is note ready to be used in analysis.

Here data will be classified into one of four types:
Type 0: Unknown, these are all data that associated with being non-physical like

dark counts or unknown signals that do not seem to come from interactions of interest in our detector.

Type 1: S1 interactions produced by excited xenon molecules in the liquid xenon Type 2: S2 interactions produced when freed electrons in the LXe breach the liquid

gas interface.

Type 3: Gas events. S1 interactions that occur on the GXe instead of the liquid.

Have S1 waveform shape, with higher AFT.

child_plugin = True
compute(peaklets)[source]
dtype: Union[tuple, np.dtype, immutabledict, dict] = [(('Start time since unix epoch [ns]', 'time'), <class 'numpy.int64'>), (('Length of the interval in samples', 'length'), <class 'numpy.int32'>), (('Width of one sample [ns]', 'dt'), <class 'numpy.int32'>), (('Channel/PMT number', 'channel'), <class 'numpy.int16'>), ('type', <class 'numpy.int8'>, 'Classification of the peak(let)'), ('vanilla_type', <class 'numpy.int8'>, 'Vanilla type of the peak(let)'), ('som_type', <class 'numpy.int8'>, 'SOM type of the peak(let)'), ('som_sub_type', <class 'numpy.int32'>, 'SOM subtype of the peak(let)'), ('loc_x_som', <class 'numpy.int16'>, 'x location of the peak(let) in the SOM'), ('loc_y_som', <class 'numpy.int16'>, 'y location of the peak(let) in the SOM')]
provides: str | tuple = ('peaklet_classification',)
setup()[source]

Hook if plugin wants to do something on initialization.

som_files

Dispatch on URL protocol.

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

takes_config = immutabledict({'s1_risetime_area_parameters': <straxen.config.url_config.URLConfig object>, 's1_risetime_aft_parameters': <straxen.config.url_config.URLConfig object>, 's1_flatten_threshold_aft': <straxen.config.url_config.URLConfig object>, 's1_max_rise_time_post100': <straxen.config.url_config.URLConfig object>, 's1_min_coincidence': <straxen.config.url_config.URLConfig object>, 's2_min_pmts': <straxen.config.url_config.URLConfig object>, 'som_files': <straxen.config.url_config.URLConfig object>, 'use_som_as_default': <straxen.config.url_config.URLConfig object>})
use_som_as_default

Dispatch on URL protocol.

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

straxen.plugins.peaklets.peaklet_classification_som.compute_wf_attributes(data, sample_length, n_samples: int)[source]

Compute waveform attribures Quantiles: represent the amount of time elapsed for a given fraction of the total waveform area to be observed in n_samples i.e. n_samples = 10, then quantiles are equivalent deciles Waveforms: downsampled waveform to n_samples :param data: waveform e.g. peaks or peaklets :param n_samples: compute quantiles for a given number of samples :return: waveforms and quantiles of size n_samples

straxen.plugins.peaklets.peaklet_classification_som.euclidean_dist(XA, XB)[source]

straxen.plugins.peaklets.peaklets module

class straxen.plugins.peaklets.peaklets.Peaklets[source]

Bases: Plugin

Split records into:
  • peaklets

  • lone_hits

Peaklets are very aggressively split peaks such that we are able to find S1-S2s even if they are close to each other. (S2) Peaks that are split into too many peaklets will be merged later on.

To get Peaklets from records apply/do:
  1. Hit finding

  2. Peak finding

  3. Peak splitting using the natural breaks algorithm

  4. Compute the digital sum waveform

Lone hits are all hits which are outside of any peak. The area of lone_hits includes the left and right hit extension, except the extension overlaps with any peaks or other hits.

static add_hit_features(hitlets, peaklets)[source]

Create hits timing features.

channel_map

Dispatch on URL protocol.

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

chunk_source_size_mb = 100
chunk_target_size_mb = 2000
static clip_peaklet_times(peaklets, start, end)[source]
compressor = 'zstd'
compute(records, start, end)[source]
static create_outside_peaks_region(peaklets, start, end)[source]

Creates time intervals which are outside peaks.

Parameters:
  • peaklets – Peaklets for which intervals should be computed.

  • start – Chunk start

  • end – Chunk end

Returns:

array of strax.time_fields dtype.

data_kind: Dict[str, str] | str = {'lone_hits': 'lone_hits', 'peaklets': 'peaklets'}
depends_on: Union[str, tuple, list] = 'records'
diagnose_sorting

Dispatch on URL protocol.

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

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.

n_top_pmts

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.

natural_breaks_threshold(peaks)[source]
parallel: Union[str, bool] = 'process'
peak_left_extension

Dispatch on URL protocol.

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

peak_min_pmts

Dispatch on URL protocol.

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

peak_right_extension

Dispatch on URL protocol.

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

peak_split_filter_wing_width

Dispatch on URL protocol.

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

peak_split_gof_threshold

Dispatch on URL protocol.

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

peak_split_iterations

Dispatch on URL protocol.

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

peak_split_min_area

Dispatch on URL protocol.

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

peaklet_gap_threshold

Dispatch on URL protocol.

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

peaklet_max_duration

Dispatch on URL protocol.

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

provides: Tuple[str, ...] | str = ('peaklets', 'lone_hits')
rechunk_on_load = True
saturation_correction_on

Dispatch on URL protocol.

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

saturation_min_reference_length

Dispatch on URL protocol.

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

saturation_reference_length

Dispatch on URL protocol.

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

setup()[source]

Hook if plugin wants to do something on initialization.

store_data_start

Dispatch on URL protocol.

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

store_data_top

Dispatch on URL protocol.

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

takes_config = immutabledict({'peaklet_gap_threshold': <straxen.config.url_config.URLConfig object>, 'peak_left_extension': <straxen.config.url_config.URLConfig object>, 'peak_right_extension': <straxen.config.url_config.URLConfig object>, 'peak_min_pmts': <straxen.config.url_config.URLConfig object>, 'peak_split_gof_threshold': <straxen.config.url_config.URLConfig object>, 'peak_split_filter_wing_width': <straxen.config.url_config.URLConfig object>, 'peak_split_min_area': <straxen.config.url_config.URLConfig object>, 'peak_split_iterations': <straxen.config.url_config.URLConfig object>, 'diagnose_sorting': <straxen.config.url_config.URLConfig object>, 'gain_model': <straxen.config.url_config.URLConfig object>, 'tight_coincidence_window_left': <straxen.config.url_config.URLConfig object>, 'tight_coincidence_window_right': <straxen.config.url_config.URLConfig object>, 'n_tpc_pmts': <straxen.config.url_config.URLConfig object>, 'n_top_pmts': <straxen.config.url_config.URLConfig object>, 'store_data_top': <straxen.config.url_config.URLConfig object>, 'store_data_start': <straxen.config.url_config.URLConfig object>, 'saturation_correction_on': <straxen.config.url_config.URLConfig object>, 'saturation_reference_length': <straxen.config.url_config.URLConfig object>, 'saturation_min_reference_length': <straxen.config.url_config.URLConfig object>, 'peaklet_max_duration': <straxen.config.url_config.URLConfig object>, 'channel_map': <straxen.config.url_config.URLConfig object>, 'hit_min_amplitude': <straxen.config.url_config.URLConfig object>})
tight_coincidence_window_left

Dispatch on URL protocol.

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

tight_coincidence_window_right

Dispatch on URL protocol.

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

Module contents