pactools.MaskIterator

class pactools.MaskIterator(events, tmin, tmax, n_points, fs)[source]

Iterator that creates the masks one at a time.

Parameters
eventsarray, shape (n_events, 3) | array, shape (n_events,) | None

MNE events array. To be supplied if data is 2D and output should be split by events. In this case, tmin and tmax must be provided. If ndim == 1, it is assumed to be event indices, and all events will be grouped together. Otherwise, events will be grouped along the third dimension.

tminfloat | list of floats, shape (n_windows, ) | None

If events is not provided, it is the start time to use in raw. If events is provided, it is the time (in seconds) to include before each event index. If a list of floats is given, then PAC is calculated for each pair of tmin and tmax. Defaults to min(raw.times).

tmaxfloat | list of floats, shape (n_windows, ) | None

If events is not provided, it is the stop time to use in raw. If events is provided, it is the time (in seconds) to include after each event index. If a list of floats is given, then PAC is calculated for each pair of tmin and tmax. Defaults to max(raw.times).

n_pointsint

The length of each mask.

fsfloat

The sampling frequency.

Examples

>>> from pactools import MaskIterator
>>> all_masks = MaskIterator(events, tmin, tmax, n_points, fs)
>>> n_masks = len(all_masks)
>>> for one_mask in all_masks:
...     pass
__init__(self, events, tmin, tmax, n_points, fs)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(self, events, tmin, tmax, n_points, fs)

Initialize self.

next(self)

Returns mask.

Examples using pactools.MaskIterator