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

Method crop

mne/source_estimate.py:843–868  ·  view source on GitHub ↗

Restrict SourceEstimate to a time interval. Parameters ---------- tmin : float | None The first time point in seconds. If None the first present is used. tmax : float | None The last time point in seconds. If None the last present is used.

(self, tmin=None, tmax=None, include_tmax=True)

Source from the content-addressed store, hash-verified

841
842 @fill_doc
843 def crop(self, tmin=None, tmax=None, include_tmax=True):
844 """Restrict SourceEstimate to a time interval.
845
846 Parameters
847 ----------
848 tmin : float | None
849 The first time point in seconds. If None the first present is used.
850 tmax : float | None
851 The last time point in seconds. If None the last present is used.
852 %(include_tmax)s
853
854 Returns
855 -------
856 stc : instance of SourceEstimate
857 The cropped source estimate.
858 """
859 mask = _time_mask(
860 self.times, tmin, tmax, sfreq=self.sfreq, include_tmax=include_tmax
861 )
862 self.tmin = self.times[np.where(mask)[0][0]]
863 if self._kernel is not None and self._sens_data is not None:
864 self._sens_data = self._sens_data[..., mask]
865 else:
866 self.data = self.data[..., mask]
867
868 return self # return self for chaining methods
869
870 @verbose
871 def resample(

Callers

nothing calls this directly

Calls 1

_time_maskFunction · 0.85

Tested by

no test coverage detected