eegprep.eeg_lat2point#
- eegprep.eeg_lat2point(lat_array, epoch_array, srate, timewin, timeunit=1.0, **kwargs)#
Convert latencies in time units (relative to per-epoch time 0) to latencies in data points assuming concatenated epochs (EEGLAB style).
Parameters#
- lat_arrayarray-like
Latencies in ‘timeunit’ units (e.g., seconds if timeunit=1, ms if 1e-3).
- epoch_arrayarray-like or scalar
Epoch index for each latency (1-based). Scalar is broadcast.
- sratefloat
Sampling rate in Hz.
- timewinsequence length-2
[xmin xmax] epoch limits in ‘timeunit’ units.
- timeunitfloat, default 1.0
Time unit in seconds.
- kwargs:
- outrangeint {1,0}, default 1
If 1, replace points out of range with the max valid point. If 0, raise an error.
Returns#
- newlatnp.ndarray
1-based point indices assuming concatenated epochs.
- flagint
1 if any point was out of range and replaced; else 0.