Epochs
- class gpype.backend.flow.epochs.Epochs[source]
Bases:
IONodeCuts one epoch per marker of a condition, stacked into a trial axis.
Batch only, like
Apply(D-BATCH-56): a realtime pipeline is refused with this node named. Selects on the events model rather than on a trigger column (D-BATCH-13) – every marker in the input context whose label equalsconditionbecomes one trial, spanning[tmin, tmax)seconds around its sample.An epoch that straddles a recording gap is refused outright, naming the trial and the gap (D-BATCH-12): a dense block across a dropout would silently mean less than it claims. One that runs off either end of the recording is dropped instead, and the count is logged once (D-BATCH-88). An unknown condition is refused, listing the labels the recording actually has.
The output has no samples in common with its input’s grid, so its context carries no
markersorgaps(D-BATCH-86); it carriesConstants.Keys.TRIALSinstead –[[source_sample, label], ...], one entry per trial – whichResult.trialsreads. It also publishestime_pre/time_postthe wayTriggerdoes, soBaselineandEpochAveragework downstream of either.- Parameters:
- Raises:
ValueError – If
tminis not earlier thantmax.
- BATCH_ONLY = True
Refused outside a batch run, by
Pipeline._validate(seeApply.BATCH_ONLY): the whole recording has to already be in hand for a marker’s neighbourhood to mean anything.
- TIME_PRE = 'time_pre'
Context keys naming where the marker sits in the epoch, in the exact strings Trigger publishes and Baseline reads – so either node can feed a Baseline or an EpochAverage downstream.
- TIME_POST = 'time_post'
- __init__(condition, tmin, tmax, **kwargs)[source]
Initialize the epoch cutter.
- Parameters:
- Raises:
ValueError – If tmin is not earlier than tmax.
- setup(data, port_context_in)[source]
Resolve every trial’s slice against the input’s events model.
- Parameters:
- Return type:
- Returns:
Output port contexts.
- Raises:
ValueError – If the context declares no sampling rate; if no marker matches
condition, naming the labels present; or if an in-range epoch straddles a recording gap, naming the trial and the gap.