amstrax.plugins package

Submodules

amstrax.plugins.daqreader module

class amstrax.plugins.daqreader.DAQReader

Bases: Plugin

Read the XENONnT DAQ-live_data from redax and split it to the appropriate raw_record data- types based on the channel-map.

Does nothing whatsoever to the live_data; not even baselining.

Provides:
  • raw_records: (tpc)raw_records.

  • raw_records_ext: (external)raw_records.

chunk_target_size_mb = 50
compressor = 'lz4'
compute(chunk_i)
data_kind: Union[str, immutabledict, dict] = immutabledict({'raw_records_ext': 'raw_records_ext', 'raw_records': 'raw_records'})
depends_on: Tuple = ()
infer_dtype()

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

input_timeout = 300
is_ready(chunk_i)

Return whether the chunk chunk_i is ready for reading. Returns True by default; override if you make an online input plugin.

parallel = 'process'
provides: Tuple[str, ...] = ('raw_records_ext', 'raw_records')
rechunk_on_save = immutabledict({'raw_records': False, 'raw_records_ext': False})
setup()

Hook if plugin wants to do something on initialization

source_finished()

Return whether all chunks the plugin wants to read have been written. Only called for online input plugins.

takes_config = immutabledict({'record_length': <strax.config.Option object>, 'max_digitizer_sampling_time': <strax.config.Option object>, 'run_start_time': <strax.config.Option object>, 'daq_chunk_duration': <strax.config.Option object>, 'daq_overlap_chunk_duration': <strax.config.Option object>, 'daq_compressor': <strax.config.Option object>, 'readout_threads': <strax.config.Option object>, 'daq_input_dir': <strax.config.Option object>, 'safe_break_in_pulses': <strax.config.Option object>, 'channel_map': <strax.config.Option object>})
amstrax.plugins.daqreader.split_channel_ranges(records, channel_ranges)

Return numba.List of record arrays in channel_ranges.

channel_ranges is a list of tuples specifying the channel ranges for each subdetector.

amstrax.plugins.event_processing module

amstrax.plugins.pax_interface module

amstrax.plugins.peak_processing module

amstrax.plugins.pulse_processing module

class amstrax.plugins.pulse_processing.PulseProcessing

Bases: Plugin

Get the specific raw_records of the measurements (raw_records_v1724 or raw_records_v1730) and split the raw_records into: - records - pulse_counts Apply basic pulse processing:

  1. Flip the pulse if it is necessary (only for the PMT pulse)

  2. Calculate the baseline and integrate the waveform

  3. Find hits

  4. Filter the record and cut outside the hit bounds

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.

compressor = 'zstd'
compute(raw_records, start, end)
config: Dict
data_kind: Union[str, immutabledict, dict] = {'pulse_counts': 'pulse_counts', 'records': 'records'}
depends_on: tuple = 'raw_records'
deps: Dict
dtype: Union[tuple, dtype, immutabledict, dict]
infer_dtype()

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

input_buffer: Dict[str, Chunk]
parallel = 'process'
provides: tuple = ('records', 'pulse_counts')
rechunk_on_save = immutabledict({'records': False, 'pulse_counts': True})
run_i: int
run_id: str
takes_config = immutabledict({'baseline_samples': <strax.config.Option object>, 'pmt_pulse_filter': <strax.config.Option object>, 'save_outside_hits': <strax.config.Option object>, 'n_tpc_pmts': <strax.config.Option object>, 'check_raw_record_overlaps': <strax.config.Option object>, 'allow_sloppy_chunking': <strax.config.Option object>, 'hit_min_amplitude': <strax.config.Option object>})
amstrax.plugins.pulse_processing.baseline_per_channel(records, baseline_samples=40, flip=False, allow_sloppy_chunking=False, fallback_baseline=16000)

Determine baseline as the average of the first baseline_samples of each pulse in each channel. Subtract the pulse data from int(baseline), and store the baseline mean and rms.

Parameters

baseline_samples – number of samples at start of pulse to average

to determine the baseline. :param flip: If true, flip sign of data (only for PMT data) :param allow_sloppy_chunking: Allow use of the fallback_baseline in case the 0th fragment of a pulse is missing :param fallback_baseline: Fallback baseline (ADC counts)

Assumes records are sorted in time (or at least by channel, then time).

Assumes record_i information is accurate – so don’t cut pulses before baselining them!

amstrax.plugins.pulse_processing.channel_split(rr, first_other_ch)

Return

amstrax.plugins.pulse_processing.check_overlaps(records, n_channels)

Raise a ValueError if any of the pulses in records overlap Assumes records is already sorted by time.

amstrax.plugins.pulse_processing.mask_and_not(x, mask)
amstrax.plugins.pulse_processing.pulse_count_dtype(n_channels)

amstrax.plugins.pulse_processing_alt_baseline module

Module contents