goldpan.archive¶
Persistent archive of “good event” selections, keyed by series/detector/channel.
Every cut in goldpan.cuts is cheap to recompute from raw data, so this isn’t
a cache – it’s a durable record of which detector_ids a particular cut (run
with particular parameters, on a particular dump) actually selected, so a
later notebook or a re-run with different library code can compare against
what was kept before, without re-deriving it from scratch or re-reading
notebook output by hand.
One HDF5 file, one group per (series, detector, channel):
/<series>/detector<N>/channel<C>
dataset "detector_ids" -- variable-length UTF-8 strings
attrs: cut_name, cut_status, cut_params (JSON string), n_total,
n_kept, dump, pretrigger_samples, glitch_samples,
sample_period_s, source_notebook, created (ISO 8601, UTC)
Saving a group overwrites it – the archive holds the current good-event
list per series/detector/channel, not a history of every past run. Only this
module knows about h5py; everything else in python/ stays free of that
dependency.
Functions
|
Return |
|
Read back one |
|
Write (or overwrite) the good-event list for one |
- goldpan.archive.save_good_events(path, series, detector, channel, detector_ids, cut_name, *, cut_status=None, cut_params=None, n_total=None, dump=None, config=None, source_notebook=None)[source]¶
Write (or overwrite) the good-event list for one
(series, detector, channel)group.detector_idsis any iterable of id strings (e.g. fromgoldpan.io.load_channel_batch, indexed by a cut’s boolean mask).Pass
cut_status(e.g.goldpan.cuts.excursion_band_AI.status) so a reader can tell at a glance whether the archived selection came from adoneorunder_developmentcut, without re-importing the library.cut_params(e.g.{"low": 0.5, "high": 0.7, "min_duration": 50}) andconfig(aPulseConfig) are stored as a record of exactly how the cut was run.