daq2lh5.llama package¶
Submodules¶
daq2lh5.llama.llama_base module¶
General utilities for llamaDAQ data decoding
daq2lh5.llama.llama_event_decoder module¶
- class daq2lh5.llama.llama_event_decoder.LLAMAEventDecoder(*args, **kwargs)¶
Bases:
DataDecoderDecode llamaDAQ SIS3316 digitizer event data.
- __add_accum1till6(decoded_values_fch)¶
- __add_accum7and8(decoded_values_fch)¶
- __add_energy(decoded_values_fch)¶
- __add_maw(decoded_values_fch)¶
- __add_waveform(decoded_values_fch, is_avg, max_samples, dt)¶
Helper function to add waveform.
Averaged samples are available from the 125 MHz (16 bit) variatnt of the SIS3316 and can be stored independently of raw samples. I use waveform for raw samples (dt from clock itself) and waveform_presummed from averaged samples (dt from clock * avg number).
GERDA used to have the low-frequency (waveform) & the high-frequency (aux waveform); here: LF = waveform_presummed & HF = waveform_windowed.
- decode_packet(packet, evt_rbkd, packet_id, fadc_channel_id)¶
Decode packet.
Decodes a single packet, which is a single SIS3316 event, as specified in the Struck manual. A single packet corresponds to a single event and channel, and has a unique timestamp. packets of different channel groups can vary in size!
- Return type:
- get_decoded_values(key=None)¶
Get decoded values (optionally for a given key, typically a channel).
Notes
Must overload for your decoder if it has key-specific decoded values. Must also implement
key = Nonereturns a “default” decoded_values. Otherwise, just returnsself.decoded_values, which should be defined in the constructor.
- get_key_lists()¶
Get list of keys.
Return a list of lists of keys available for this decoder. Each inner list are the fadc_channel_id’s which share the exact same settings (trace lengths, avg mode, …), so they can end up in the same buffer.
- set_channel_configs(channel_configs)¶
Receive channel configurations from llama_streamer after header was parsed.
Adapt self.decoded_values dict based on read configuration.
- set_global_configs(global_configs)¶
daq2lh5.llama.llama_header_decoder module¶
- class daq2lh5.llama.llama_header_decoder.LLAMAHeaderDecoder(*args, **kwargs)¶
Bases:
DataDecoderDecode llamaDAQ header data.
Includes the file header as well as all available (“open”) channel configurations.
- __decode_channel_configs(f_in)¶
Reads the metadata.
Reads the metadata from the beginning of the file (the “channel configuration” part, directly after the file header). Creates a dictionary of the metadata for each FADC/channel combination, which is returned. Returns number of bytes read.
FADC-ID and channel-ID are combined into a single id for flattening:
(fadcid << 4) + chid.- Return type:
- make_lgdo(key=None, size=None)¶
Make an LGDO for this
DataDecoderto fill.This default version of this function allocates a
Tableusing the decoded_values for key. If a different type of LGDO object is required for this decoder, overload this function.- Parameters:
- Returns:
data_obj – the newly allocated LGDO.
- Return type:
daq2lh5.llama.llama_streamer module¶
- class daq2lh5.llama.llama_streamer.LLAMAStreamer¶
Bases:
DataStreamerDecode SIS3316 data acquired using llamaDAQ.
- __read_bytes()¶
return bytes if read successful or None if EOF. int is the fch_id (needs to be fetched to obtain the size of the event)
- _abc_impl = <_abc._abc_data object>¶
- close_stream()¶
Close this data stream.
Note
Needs to be overloaded.
- get_decoder_list()¶
Returns a list of decoder objects for this data stream.
Notes
Needs to be overloaded. Gets called during
open_stream().- Return type:
- open_stream(llama_filename, rb_lib=None, buffer_size=8192, chunk_mode='any_full', out_stream='')¶
Initialize the LLAMA data stream.
Refer to the documentation for
data_streamer.DataStreamer.open_stream()for a description of the parameters.
- read_packet()¶
Reads a single packet’s worth of data in to the
RawBufferLibrary.- Returns:
still_has_data – returns True while there is still data to read.
- Return type: