radiens_qc.events
Fetch every threshold crossing in a recording, for the events-in-time figures.
Distinct from :mod:radiens_qc.raw, which reads bounded excerpts. The questions
this level answers -- does activity start or stop mid-recording, is a burst
array-wide or local, is this bursty or continuous -- are all statements about the
recording's span, and none of them is answerable from three one-second windows.
So the whole event stream is read, and the object holding it is organized around
the span rather than around excerpts.
The crossings come from a detect-only fileset the caller produced; see
:mod:radiens_qc.spikes for how, and for why a clustered sort will not do.
Nothing here is archived on a :class:~radiens_qc.report.QualityReport, for the
same reason an excerpt is not: a report is a measurement the KPI pass produced,
while this is a view into the recording, fetched when a figure is drawn.
Classes
EventTrains
dataclass
Every threshold crossing in one recording, per channel.
Attributes:
| Name | Type | Description |
|---|---|---|
base_name |
str
|
Recording identifier. |
sampling_rate |
float
|
Sampling rate in Hz. |
time_range_sec |
tuple[float, float]
|
|
channel_indices |
tuple[int, ...]
|
Amplifier |
geometry |
DataFrame
|
Per-channel probe geometry, indexed by |
crossings |
dict[int, NDArray[float64]]
|
|
detection |
ResolvedDetection
|
Stage-2 filters and threshold the crossings were found at. |
spikes_id |
str
|
Fileset the crossings were read from. Carried so a caller wanting waveforms for these same events reads the fileset that produced them rather than whichever the dataset offers by default. |
Attributes
Methods:
depth_order
Row order for the raster: shank, then depth.
See :func:~radiens_qc._dataset.depth_order. This level takes depth
rather than the SNR rank the report's panels share, because what it is
drawn to show -- an array-wide stripe, a burst confined to one shank --
is spatial structure that a quality ranking scatters.
Functions:
fetch_events
Read every threshold crossing in the recording from a detect-only fileset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vc
|
VidereClient
|
Client connected to the server holding the recording. |
required |
data
|
DatasetMetadata | Path
|
An already-linked recording, or a path to link. |
required |
spikes_id
|
str
|
Detect-only fileset to read, detected at |
required |
channels
|
Sequence[int] | None
|
Amplifier |
None
|
detection
|
DetectionSettings
|
Stage-2 filters and detection threshold. Pass the same object
given to :func: |
DEFAULT_DETECTION
|
Returns:
| Type | Description |
|---|---|
EventTrains
|
The crossings, with the geometry needed to order them by depth. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If no amplifier channels are selected, or the fileset does not
hold per-site crossings at |