legenddataflowscripts.tier package

Submodules

legenddataflowscripts.tier.dsp module

legenddataflowscripts.tier.dsp._replace_list_with_array(dic)

Recursively replace list values with NumPy float32 arrays.

Parameters:

dic (dict) – Nested dictionary whose list values should be converted.

Returns:

dictdic modified in-place, with all list values replaced by numpy.ndarray of dtype float32.

legenddataflowscripts.tier.dsp.build_dsp_wrapper(kwargs)

Unpack kwargs and delegate to dspeed.build_dsp().

This thin wrapper exists so that a single-argument callable can be passed to multiprocessing.Pool.map().

Parameters:

kwargs (dict) – Keyword arguments forwarded verbatim to dspeed.build_dsp().

legenddataflowscripts.tier.dsp.build_tier_dsp()

Build the DSP tier from raw LH5 data (multi-channel entry point).

CLI entry point registered as build-tier-dsp. Reads raw waveform data from a single LH5 input file and runs each channel through the digital signal processing (DSP) chain defined in the dataflow configuration, writing the processed output to an LH5 file.

When --n-processes is greater than 1, channels are sorted by table length (longest first) and distributed in round-robin fashion across worker processes. Each worker writes to a temporary shard file; the shards are merged into the final output and then deleted.

Notes

Command-line arguments

--configsstr

Path to the dataflow configuration directory (TextDB-compatible).

--table-mapstr, optional

JSON-encoded {channel: lh5_table_path} mapping.

--logstr, optional

Path to the log file.

--alias-tablestr, optional

JSON-encoded alias mapping appended to the output file via alias_table().

--n-processesint

Number of parallel worker processes. Defaults to 1.

--datatypestr

Data-type identifier used to select the active configuration (e.g. cal, phy).

--timestampstr

Run timestamp used to select the active configuration.

--tierstr

Tier label (e.g. dsp).

--pars-filelist of str

Database parameter files (.json / .yaml) containing per-channel DSP parameters.

--inputstr

Path to the input raw LH5 file.

--outputstr

Path for the output DSP LH5 file.

legenddataflowscripts.tier.dsp.build_tier_dsp_single_channel()

Build the DSP tier from raw LH5 data (single-channel entry point).

CLI entry point registered as build-tier-dsp-single-channel. Processes one detector channel at a time through the DSP chain defined in the dataflow configuration. This entry point is used by single-channel Snakemake rules where parallelism is managed by the workflow scheduler rather than in-process multiprocessing.

Notes

Command-line arguments

--configsstr

Path to the dataflow configuration directory (TextDB-compatible).

--channelstr, optional

Channel identifier to process. When provided, channel-specific configuration and parameter overrides are applied.

--logstr, optional

Path to the log file.

--datatypestr

Data-type identifier.

--timestampstr

Run timestamp used to select the active configuration.

--tierstr

Tier label.

--pars-filelist of str

Database parameter files to load.

--inputstr

Path to the input raw LH5 file.

--outputstr

Path for the output DSP LH5 file.

legenddataflowscripts.tier.hit module

legenddataflowscripts.tier.hit.build_tier_hit()

Build the HIT tier from DSP LH5 data (multi-channel entry point).

CLI entry point registered as build-tier-hit. Reads DSP-level LH5 data and computes reconstructed physics quantities (hit-level parameters) for each detector channel using pygama.hit.build_hit.build_hit().

For each channel the hit configuration file is read and then enriched with per-channel calibration parameters from the provided database files before being passed to the hit builder.

Notes

Command-line arguments

--inputstr

Path to the input DSP LH5 file.

--pars-filelist of str

Database parameter files containing per-channel hit parameters.

--configsstr

Path to the dataflow configuration directory (TextDB-compatible).

--table-mapstr, optional

JSON-encoded {channel: lh5_table_path} mapping.

--logstr, optional

Path to the log file.

--alias-tablestr, optional

JSON-encoded alias mapping appended to the output file.

--datatypestr

Data-type identifier.

--timestampstr

Run timestamp used to select the active configuration.

--tierstr

Tier label (e.g. hit).

--outputstr

Path for the output HIT LH5 file.

legenddataflowscripts.tier.hit.build_tier_hit_single_channel()

Build the HIT tier from DSP LH5 data (single-channel entry point).

CLI entry point registered as build-tier-hit-single-channel. Processes a single detector channel, applying channel-specific hit configuration and calibration parameters before calling pygama.hit.build_hit.build_hit().

Notes

Command-line arguments

--inputstr

Path to the input DSP LH5 file.

--pars-filelist of str

Database parameter files to load.

--configsstr

Path to the dataflow configuration directory (TextDB-compatible).

--logstr, optional

Path to the log file.

--channelstr, optional

Channel identifier to process.

--datatypestr

Data-type identifier.

--timestampstr

Run timestamp used to select the active configuration.

--tierstr

Tier label.

--outputstr

Path for the output HIT LH5 file.