MCPcopy
hub / github.com/mne-tools/mne-python / mean

Method mean

mne/time_frequency/csd.py:275–299  ·  view source on GitHub ↗

Calculate the mean CSD in the given frequency range(s). Parameters ---------- fmin : float | list of float | None Lower bound of the frequency range in Hertz. Defaults to the lowest frequency available. When a list of frequencies is given, these are

(self, fmin=None, fmax=None)

Source from the content-addressed store, hash-verified

273 return csd_out
274
275 def mean(self, fmin=None, fmax=None):
276 """Calculate the mean CSD in the given frequency range(s).
277
278 Parameters
279 ----------
280 fmin : float | list of float | None
281 Lower bound of the frequency range in Hertz. Defaults to the lowest
282 frequency available. When a list of frequencies is given, these are
283 used as the lower bounds (inclusive) of frequency bins and the mean
284 is taken for each bin.
285 fmax : float | list of float | None
286 Upper bound of the frequency range in Hertz. Defaults to the
287 highest frequency available. When a list of frequencies is given,
288 these are used as the upper bounds (inclusive) of frequency bins
289 and the mean is taken for each bin.
290
291 Returns
292 -------
293 csd : instance of CrossSpectralDensity
294 The CSD matrix, averaged across the given frequency range(s).
295 """
296 csd = self.sum(fmin, fmax)
297 for i, f in enumerate(csd.frequencies):
298 csd._data[:, i] /= len(f)
299 return csd
300
301 def _get_frequency_index(self, freq):
302 """Find the index of the given frequency in ``self.frequencies``.

Callers 15

_compute_mapping_matrixFunction · 0.45
_col_corrsFunction · 0.45
test_make_forward_dipoleFunction · 0.45
test_as_meg_type_evokedFunction · 0.45
test_apply_forwardFunction · 0.45
funFunction · 0.45
_check_sphereFunction · 0.45
_check_snrFunction · 0.45
_click_ch_nameFunction · 0.45
_reg_pinvFunction · 0.45
compute_corrFunction · 0.45
_fitMethod · 0.45

Calls 1

sumMethod · 0.95

Tested by 15

_col_corrsFunction · 0.36
test_make_forward_dipoleFunction · 0.36
test_as_meg_type_evokedFunction · 0.36
test_apply_forwardFunction · 0.36
_check_snrFunction · 0.36
_click_ch_nameFunction · 0.36
test_pos_semidef_invFunction · 0.36
test_pcaFunction · 0.36
test_make_montage_volumeFunction · 0.36