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 detector, detevtno and timestamp. It will typically be the result of flatten_over_detectors.

      Returns a StructArray that contains the columns tstart, detector, detevtno and timestamp, sorted by tstart globally and along timestamp in each row.

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

      Per-detector events are associated 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{<:DetectorIdLike},
          detectors::AbstractVector{<:DetectorIdLike} = collect(keys(data));
          ts_window::Number = 25u"μs"
      )

      Build global events from a dictionary of per-detector events

      Per-detector events are associated 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 detector-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 detectors in the given datastore, using the metadata processing configuration for data and sel.

      source
      LegendEventAnalysis.calibrate_aux_detector_dataMethod
      calibrate_aux_detector_data(data::LegendData, sel::ValiditySelection, detector::DetectorId, detector_data::AbstractVector)

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

      Also calculates the configured cut/flag values.

      source
      LegendEventAnalysis.calibrate_ged_detector_dataMethod
      calibrate_ged_detector_data(data::LegendData, sel::AnyValiditySelection, detector::DetectorId, detector_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_detdata::Bool=false)

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

      Also calculates the configured cut/flag values.

      source
      LegendEventAnalysis.calibrate_pmt_detector_dataMethod
      calibrate_pmt_detector_data(data::LegendData, sel::ValiditySelection, detector::DetectorId, detector_data::AbstractVector)

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

      Also calculates the configured cut/flag values.

      source
      LegendEventAnalysis.calibrate_spm_detector_dataMethod
      calibrate_spm_detector_data(data::LegendData, sel::ValiditySelection, detector::DetectorId, detector_data::AbstractVector)

      Apply the calibration specified by data and sel for the given SiPM detector to the single-detector detector_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_detectorsFunction
      function flatten_over_detectors(
          data::AbstractDict{<:DetectorIdLike},
          detectors::AbstractVector{<:DetectorIdLike} = collect(keys(data))
      )

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

      data must a dictionary of in-memory or on-disk table-like objects, keyed by detector-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_detector)}: result is the flattened data and per_detector is a detector-indexed dictionary of views into result.

      source