API

Modules

    Types and constants

      Functions and macros

      Documentation

      LegendEventAnalysis.build_cross_system_eventsMethod
      function build_cross_system_events(
          data::NamedTuple,
          ts_window::Number = 25u"μs"
      )

      Build cross-system events.

      data must be a NamedTuple with properties that represent the names of experiment (sub)-systems and values that are the result of build_global_events for each system.

      Note: Currently requires the tstart columns of all systems to be identical.

      source
      LegendEventAnalysis.build_global_event_mapMethod
      build_global_event_map(local_events::StructArray; ts_window::Number = 25u"μs")

      Build a map of global events based on local_events.

      data must contain columns channel, chevtno and timestamp. It will typically be the result of flatten_over_channels.

      Returns a StructArray that contains the columns start, channels, localevents and timestamps, sorted by start globally and along timestamps in each row.

      The start column contains the start time of each event, the channels, chevts and timestamps columns are vectors of vectors that contain the channel-id, per-channel event numbers and per-channel timestamps that have been associated with each respective events.

      Per-channel events are accociated with the same global event if their timestamps fall within a time windows of length ts_window.

      source
      LegendEventAnalysis.build_global_eventsFunction
      function build_global_events(
          data::AbstractDict{<:ChannelIdLike},
          channels::AbstractVector{<:ChannelIdLike} = collect(keys(data));
          ts_window::Number = 25u"μs"
      )

      Build global events from a dictionary of per-channel events

      Per-channel events are accociated with the same global event if their timestamps fall within a time windows of length ts_window.

      data must a dictionary of in-memory or on-disk table-like objects, keyed by channel-IDs. It may, e.g. be a Dict with values that are StructArrays.StructVector, TypedTables.Table or similar, but may also be a LegendHDF5IO.LHDataStore. Note that on-disk data will be read into memory as a whole.

      source
      LegendEventAnalysis.calibrate_allFunction
      calibrate_all(data::LegendData, sel::ValiditySelection, datastore::AbstractDict)

      Calibrate all channels in the given datastore, using the metadata processing configuration for data and sel.

      source
      LegendEventAnalysis.calibrate_aux_channel_dataMethod
      calibrate_aux_channel_data(data::LegendData, sel::ValiditySelection, detector::DetectorId, channel_data::AbstractVector)

      Apply the calibration specified by data and sel for aux channel referred to by the detector ID to the single-channel channel_data for that detector.

      Also calculates the configured cut/flag values.

      source
      LegendEventAnalysis.calibrate_ged_channel_dataMethod
      calibrate_ged_channel_data(data::LegendData, sel::AnyValiditySelection, detector::DetectorId, channel_data::AbstractVector; 
          psd_cal_pars_type::Symbol=:ppars, psd_cal_pars_cat::Symbol=:aoe, psd_cut_pars_type::Symbol=:ppars, psd_cut_pars_cat::Symbol=:aoe,
          keep_chdata::Bool=false)

      Apply the calibration specified by data and sel for the given HPGe detector to the single-channel channel_data for that detector.

      Also calculates the configured cut/flag values.

      source
      LegendEventAnalysis.calibrate_pmt_channel_dataMethod
      calibrate_pmt_channel_data(data::LegendData, sel::ValiditySelection, detector::DetectorId, channel_data::AbstractVector)

      Apply the calibration specified by data and sel for the given PMT detector to the single-channel channel_data for that detector.

      Also calculates the configured cut/flag values.

      source
      LegendEventAnalysis.calibrate_spm_channel_dataMethod
      calibrate_spm_channel_data(data::LegendData, sel::ValiditySelection, detector::DetectorId, channel_data::AbstractVector)

      Apply the calibration specified by data and sel for the given SiPM detector to the single-channel channel_data for that detector.

      Also calculates the configured cut/flag values.

      source
      LegendEventAnalysis.flag_coincidencesMethod
      flag_coincidences(
          timestamps::AbstractVector{<:RealQuantity}, ref_timestamps::AbstractVector{<:RealQuantity};
          ts_window::Number = 125u"μs"
      )

      Flag coincidences in timestamps with respect to ref_timestamps.

      Return a boolean vector of the same length as timestamps that is true where a timestamp is within ts_window of an element of ref_timestamps and false otherwise.

      source
      LegendEventAnalysis.flatten_over_channelsFunction
      function flatten_over_channels(
          data::AbstractDict{<:ChannelIdLike},
          channels::AbstractVector{<:ChannelIdLike} = collect(keys(data))
      )

      Flatten per-channel data data to a single StructArrays.StructVector by concatenating its table-like values and adding the columns a channel and chevtno.

      data must a dictionary of in-memory or on-disk table-like objects, keyed by channel-IDs. It may, e.g. be a Dict with values that are StructArrays.StructVector, TypedTables.Table or similar, but may also be a LegendHDF5IO.LHDataStore. Note that on-disk data will be read into memory as a whole.

      Returns a NamedTuple{(:result, :per_channel)}: result is the flattened data and per_channel is a channel-indexed dictionary of views into result.

      source