goldpan.adapters.rq

Quantity tables from any RQ source, and how they join an Events.

The RQ adapters (goldpan.adapters.rq_root, and any you add) return a table of quantities: an Awkward Array with one record per event whose first fields are the event key (series, dump, event). attach adds such a table to an Events of the same events, matching on the key, so the RQs of the reconstruction can be compared with, or cut on together with, what the library computes from the traces:

ev = rq.attach(ev, rq_root.read(path, detector=7, branches=["PTOFamps", "P*std"]))
ev.quantities["PTOFamps"]

Functions

attach(events, table, *[, on, prefix])

events with the columns of table added, each event matched to the row of table with the same on fields.

goldpan.adapters.rq.attach(events, table, *, on=('series', 'dump', 'event'), prefix='')[source]

events with the columns of table added, each event matched to the row of table with the same on fields.

Every event must have exactly one row in table (extra rows are ignored); otherwise ValueError names the first events without. The fields of table that are in the key (series, dump, event) are not copied, and a field with the name of an existing quantity is refused unless prefix is given (it is put before the names of the new columns). on lets you match on fewer fields, for example ("dump", "event") when the two sources name the series differently.

Parameters:
Return type:

Events