Conveniently generate epochs around ECG artifact events. %(create_ecg_epochs)s .. note:: Filtering is only applied to the ECG channel while finding events. The resulting ``ecg_epochs`` will have no filtering applied (i.e., have the same filter properties as
(
raw,
ch_name=None,
event_id=999,
picks=None,
tmin=-0.5,
tmax=0.5,
l_freq=8,
h_freq=16,
reject=None,
flat=None,
baseline=None,
preload=True,
keep_ecg=False,
reject_by_annotation=True,
decim=1,
verbose=None,
)
| 335 | |
| 336 | @verbose |
| 337 | def create_ecg_epochs( |
| 338 | raw, |
| 339 | ch_name=None, |
| 340 | event_id=999, |
| 341 | picks=None, |
| 342 | tmin=-0.5, |
| 343 | tmax=0.5, |
| 344 | l_freq=8, |
| 345 | h_freq=16, |
| 346 | reject=None, |
| 347 | flat=None, |
| 348 | baseline=None, |
| 349 | preload=True, |
| 350 | keep_ecg=False, |
| 351 | reject_by_annotation=True, |
| 352 | decim=1, |
| 353 | verbose=None, |
| 354 | ): |
| 355 | """Conveniently generate epochs around ECG artifact events. |
| 356 | |
| 357 | %(create_ecg_epochs)s |
| 358 | |
| 359 | .. note:: Filtering is only applied to the ECG channel while finding |
| 360 | events. The resulting ``ecg_epochs`` will have no filtering |
| 361 | applied (i.e., have the same filter properties as the input |
| 362 | ``raw`` instance). |
| 363 | |
| 364 | Parameters |
| 365 | ---------- |
| 366 | raw : instance of Raw |
| 367 | The raw data. |
| 368 | %(ch_name_ecg)s |
| 369 | %(event_id_ecg)s |
| 370 | %(picks_all)s |
| 371 | tmin : float |
| 372 | Start time before event. |
| 373 | tmax : float |
| 374 | End time after event. |
| 375 | %(l_freq_ecg_filter)s |
| 376 | %(reject_epochs)s |
| 377 | %(flat)s |
| 378 | %(baseline_epochs)s |
| 379 | preload : bool |
| 380 | Preload epochs or not (default True). Must be True if |
| 381 | keep_ecg is True. |
| 382 | keep_ecg : bool |
| 383 | When ECG is synthetically created (after picking), should it be added |
| 384 | to the epochs? Must be False when synthetic channel is not used. |
| 385 | Defaults to False. |
| 386 | %(reject_by_annotation_epochs)s |
| 387 | |
| 388 | .. versionadded:: 0.14.0 |
| 389 | %(decim)s |
| 390 | |
| 391 | .. versionadded:: 0.21.0 |
| 392 | %(verbose)s |
| 393 | |
| 394 | Returns |