Given a list of input iovsets containing each one channel, yield the state
of each iovset in the largest (since, until) range possible. The returned
states is the same length as the number of arguments to this function.
Example usage:
iovset = fetch_iovs("SHIFTOFL", runs=152166)
channels, iovsets = zip(*sorted(iovset.by_channel))
# `iovsets` here is a list of lists, each containing the iovs for one channel
for since, until, states in process_iovs(*iovsets):
print "From", since, "to", until
for state in states:
print "", state.channel, "is :", state.Code
or:
dcsofl_sct = fetch_iovs("DCSOFL", runs=152166, channels="SCTEA")
shiftofl_sct = fetch_iovs("SHIFTOFL", runs=152166, channels="SCTEA")
for since, until, (dcsofl, shiftofl) in process_iovs(dcsofl, shiftofl):
print ("From", since, "to", until,
"dcsofl=", dcsofl.Code,
"shiftofl=", shiftofl.Code)
Pitfall: IOVs can exist on the database where there are no state changes.
process_iovs will emit
Definition at line 30 of file events.py.
32 Given a list of input iovsets containing each one channel, yield the state
33 of each iovset in the largest (since, until) range possible. The returned
34 states is the same length as the number of arguments to this function.
38 iovset = fetch_iovs("SHIFTOFL", runs=152166)
39 channels, iovsets = zip(*sorted(iovset.by_channel))
40 # `iovsets` here is a list of lists, each containing the iovs for one channel
41 for since, until, states in process_iovs(*iovsets):
42 print "From", since, "to", until
44 print "", state.channel, "is :", state.Code
48 dcsofl_sct = fetch_iovs("DCSOFL", runs=152166, channels="SCTEA")
49 shiftofl_sct = fetch_iovs("SHIFTOFL", runs=152166, channels="SCTEA")
50 for since, until, (dcsofl, shiftofl) in process_iovs(dcsofl, shiftofl):
51 print ("From", since, "to", until,
52 "dcsofl=", dcsofl.Code,
53 "shiftofl=", shiftofl.Code)
55 Pitfall: IOVs can exist on the database where there are no state changes.
56 process_iovs will emit
62 for position, index, beginning, iov
in iov_yielder(*iovsets):
63 if last_position != position:
64 if last_position
is not None:
65 assert last_position < position,
"Inputs inconsistent. since !< until."
66 yield last_position, position, states
67 last_position = position
72 states[index] = empty_iovs[index]