Skip to content

Commit 0753ff0

Browse files
authored
Merge pull request #37 from legend-exp/pr/fix-duplicate-aux-events
Handle duplicate aux entries (pulser) in cross-system event building
2 parents 8b42925 + de0b986 commit 0753ff0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/calibrate_all.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ function calibrate_all(data::LegendData, sel::AnyValiditySelection, datastore::A
154154
), aux_events)
155155

156156
global_events_pre = build_cross_system_events(system_events)
157-
aux_cols = NamedTuple{keys(aux_events)}([StructVector(map(Broadcast.BroadcastFunction(only), columns(getproperty(global_events_pre, k)))) for k in keys(aux_events)])
157+
# Aux channels may have duplicate entries per event from cross-system matching — take first
158+
aux_cols = NamedTuple{keys(aux_events)}([StructVector(map(Broadcast.BroadcastFunction(first), columns(getproperty(global_events_pre, k)))) for k in keys(aux_events)])
158159
global_events = StructVector(merge(Base.structdiff(columns(global_events_pre), NamedTuple{keys(aux_events)}), (aux = StructArray(aux_cols),)))
159160

160161
cross_systems_cols = (

0 commit comments

Comments
 (0)