[med-svn] [python-mne] 94/376: FIX : fix in time interval
Yaroslav Halchenko
debian at onerussian.com
Fri Nov 27 17:22:15 UTC 2015
This is an automated email from the git hooks/post-receive script.
yoh pushed a commit to annotated tag v0.1
in repository python-mne.
commit 004f196d9da454958937752d456a58a3e82bd31c
Author: Alexandre Gramfort <alexandre.gramfort at inria.fr>
Date: Fri Feb 25 13:02:55 2011 -0500
FIX : fix in time interval
---
mne/epochs.py | 39 ++-------------------------------------
1 file changed, 2 insertions(+), 37 deletions(-)
diff --git a/mne/epochs.py b/mne/epochs.py
index f6b4218..bf7c931 100644
--- a/mne/epochs.py
+++ b/mne/epochs.py
@@ -104,41 +104,6 @@ def read_epochs(raw, events, event_id, tmin, tmax, picks=None,
print 'Appropriate compensator added to change to grade %d.' % (
dest_comp)
- # # Read the events
- # if event_fname is None:
- # if fname.endswith('.fif'):
- # event_name = '%s-eve.fif' % fname[:-4]
- # else:
- # raise ValueError, 'Raw file name does not end properly'
- #
- # events = fiff.read_events(event_name)
- # print 'Events read from %s' % event_name
- # else:
- # # Binary file
- # if event_name.endswith('-eve.fif'):
- # events = fiff.read_events(event_name)
- # print 'Binary event file %s read' % event_name
- # else:
- # # Text file
- # events = np.loadtxt(event_name)
- # if events.shape[0] < 1:
- # raise ValueError, 'No data in the event file'
- #
- # # Convert time to samples if sample number is negative
- # events[events[:,0] < 0,0] = events[:,1] * sfreq
- # # Select the columns of interest (convert to integers)
- # events = np.array(events[:,[0, 2, 3]], dtype=np.int32)
- # # New format?
- # if events[0,1] == 0 and events[0,2] == 0:
- # print 'The text event file %s is in the new format' % event_name
- # if events[0,0] != raw['first_samp']:
- # raise ValueError, ('This new format event file is not compatible'
- # ' with the raw data')
- # else:
- # print 'The text event file %s is in the old format' % event_name
- # # Offset with first sample
- # events[:,0] += raw['first_samp']
-
# Select the desired events
selected = np.logical_and(events[:, 1] == 0, events[:, 2] == event_id)
n_events = np.sum(selected)
@@ -151,8 +116,8 @@ def read_epochs(raw, events, event_id, tmin, tmax, picks=None,
for p, event_samp in enumerate(events[selected, 0]):
# Read a data segment
- start = event_samp + tmin*sfreq
- stop = event_samp + tmax*sfreq
+ start = int(event_samp + tmin*sfreq)
+ stop = int(event_samp + tmax*sfreq)
epoch, _ = raw[picks, start:stop]
if p == 0:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/python-mne.git
More information about the debian-med-commit
mailing list