Package mvpa :: Package datasets :: Module channel :: Class ChannelDataset

[hide private]
[frames] | no frames]

# Class ChannelDataset

source code

Dataset handling data structured into channels.

Channels are assumes to contain several timepoints, thus this Dataset stores some additional properties (reference time t0, temporal distance of two timepoints dt and channelids (names)).

Instance Methods | [hide private]

__init__(self, samples=None, dsattr=None, t0=None, dt=None, channelids=None, **kwargs) Initialize ChannelDataset. | source code

substractBaseline(self, t=None) Substract mean baseline signal from the each timepoint. | source code

resample(self, nt=None, sr=None, dt=None, window='ham', inplace=True, **kwargs) Convenience method to resample data sample channel-wise. | source code

Inherited from `mapped.MappedDataset`: `mapForward`, `mapReverse`, `mapSelfReverse`, `selectFeatures`

Class Variables | [hide private]

| __doc__ = `enhancedDocString('ChannelDataset', locals(), Mapped`...``
| channelids = `property(fget= lambda self: self._dsattr ['ch_ids`...``
| t0 = `property(fget= lambda self: self._dsattr ['ch_t0'], doc= `...``
| dt = `property(fget= lambda self: self._dsattr ['ch_dt'], doc= `...``
| samplingrate = `property(fget= lambda self: 1.0/ self._dsattr [`...``
Inherited from `mapped.MappedDataset`: `O`, `mapper`, `samples_original`

Method Details | [hide private]

### __init__(self, samples=None, dsattr=None, t0=None, dt=None, channelids=None, **kwargs)
(Constructor)

source code

Initialize ChannelDataset.

Parameters:
  - `samples`, `ndarray` - Three-dimensional array: (samples x channels x timepoints).
  - `t0`, `float` - Reference time of the first timepoint. Can be used to preserve information about the onset of some stimulation. Preferably in seconds.
  - `dt`, `float` - Temporal distance between two timepoints. Has to be given in seconds. Otherwise samplingrate property will not return `Hz`.
  - `channelids`, `list` - List of channel names.
Overrides: mapped.MappedDataset.__init__

### substractBaseline(self, t=None)

source code

Substract mean baseline signal from the each timepoint.

The baseline is determined by computing the mean over all timepoints specified by `t`.

The samples of the dataset are modified in-place and nothing is returned.

### resample(self, nt=None, sr=None, dt=None, window='ham', inplace=True, **kwargs)

source code

Convenience method to resample data sample channel-wise.

Resampling target can be specified by number of timepoint or temporal distance or sampling rate.

Please note that this method only operates on ChannelDataset and always returns such.

Returns:
  ChannelDataset

Parameters:

nt: int
  Number of timepoints to resample to.
dt: float
  Temporal distance of samples after resampling.
sr: float
  Target sampling rate.
inplace : bool
  If inplace=False, it would create and return a new dataset with new samples
**kwargs:
  All additional arguments are passed to resample() from scipy.signal

Class Variable Details | [hide private]

### __doc__

Value:

      enhancedDocString('ChannelDataset', locals(), MappedDataset)

### channelids

Value:

      property(fget= lambda self: self._dsattr ['ch_ids'], doc= 'List of cha
      nnel IDs')

### t0

Value:

      property(fget= lambda self: self._dsattr ['ch_t0'], doc= 'Temporal pos
      ition of first sample in the ' 'timeseries (in seconds) -- possibly re
      lative ' 'to stimulus onset.')

### dt

Value:

      property(fget= lambda self: self._dsattr ['ch_dt'], doc= 'Time differe
      nce between two samples ' '(in seconds).')

### samplingrate

Value:

      property(fget= lambda self: 1.0/ self._dsattr ['ch_dt'], doc= 'Yeah, s
      ampling rate.')