goldpan.io

Bridge from nsdf_dark_matter’s cdms objects into the plain-ndarray convention ((n_pulses, n_samples), samples on the last axis) the rest of this library expects. Only this module knows about cdms; everything else in python/ only ever sees plain arrays.

Functions

detector_index(detector_id)

The <detector> component of a "<event>_<detector>_Phonon_<n>" id.

event_id(detector_id)

The <event> component of a "<event>_<detector>_Phonon_<n>" id.

filter_by_detector(detector_ids, detector)

Keep only ids whose <detector> component matches detector.

load_channel_batch(cdms, detector_ids, channel)

Stack one channel from a list of detector_ids into a batch array.

load_channel_batch_multi(cdms_by_dump, channel)

Like load_channel_batch, pooled across multiple dumps.

trigger_types(cdms, detector_ids)

The trigger_type string the dump's .csv records for each id's event, as an array aligned with detector_ids (e.g. "Physics", "Unknown").

goldpan.io.detector_index(detector_id)[source]

The <detector> component of a "<event>_<detector>_Phonon_<n>" id.

Parameters:

detector_id (str)

Return type:

int

goldpan.io.event_id(detector_id)[source]

The <event> component of a "<event>_<detector>_Phonon_<n>" id.

Parameters:

detector_id (str)

Return type:

str

goldpan.io.filter_by_detector(detector_ids, detector)[source]

Keep only ids whose <detector> component matches detector.

goldpan.io.load_channel_batch(cdms, detector_ids, channel)[source]

Stack one channel from a list of detector_ids into a batch array.

Returns (ids, data): ids is np.array(detector_ids) (same order as data), data is float64 shape (len(detector_ids), n_samples).

Parameters:

channel (int)

goldpan.io.trigger_types(cdms, detector_ids)[source]

The trigger_type string the dump’s .csv records for each id’s event, as an array aligned with detector_ids (e.g. "Physics", "Unknown"). Metadata is per event, so the three detectors of one event share a value. Feed it to goldpan.cuts.randoms / real_triggers.

goldpan.io.load_channel_batch_multi(cdms_by_dump, channel, detector=None)[source]

Like load_channel_batch, pooled across multiple dumps.

cdms_by_dump: {dump_label: cdms} (e.g. {"F0002": cdms2, "F0003": cdms3}). Pass detector to filter each dump’s ids with filter_by_detector first.

Returns (dumps, ids, data), all the same length, concatenated across dumps in cdms_by_dump’s iteration order: dumps[i]/ids[i] name which dump and detector_id data[i] came from.

Parameters:

channel (int)