[Mne_analysis] Crop function is behaving weirdly

Zuhaib Asad 19100201 at lums.edu.pk
Wed Nov 20 11:01:05 EST 2019
Search archives:

        External Email - Use Caution        

One other thing , as I am making ML model, so I need sample size should be same dimensions throughout the data so I fixed the frequency of all samples to 200 Hz (its the minimum frequency any data sample can have.) using code:

raw.info['freq'] = 200

Does it actually changes frequency? If it does, then is it a right way to do it?
________________________________
From: Zuhaib Asad
Sent: Wednesday, November 20, 2019 8:58 PM
To: mne_analysis at nmr.mgh.harvard.edu <mne_analysis at nmr.mgh.harvard.edu>
Subject: Crop function is behaving weirdly

Hi All,

I was trying to crop .EDF data into a ten minute window with this code snippet:

if max(raw.times) < 660:
    raw.crop(tmin=60, tmax=max(raw.times))
else:
    raw.crop(tmin=60, tmax=660)

but what happens it, works for first iteration of loop normally but behaves weirdly for second iteration. (I am reading .EDF file in a loop .)
These are the info about how data loaded
1st Iteration:
before cropping :
<RawEDF  |  000007135.EDF, n_channels x n_times : 41 x 241000 (1205.0 sec), ~75.5 MB, data loaded>
After cropping :
<RawEDF  |  000007135.EDF, n_channels x n_times : 41 x 120001 (600.0 sec), ~37.6 MB, data loaded>

2nd Iteration:
Before cropping :
<RawEDF  |  6969.EDF, n_channels x n_times : 41 x 616000 (1232.0 sec), ~192.8 MB, data loaded>
After cropping :
<RawEDF  |  6969.EDF, n_channels x n_times : 41 x 300003 (1500.0 sec), ~93.9 MB, data loaded>

Please guide me through and ask me if any other thing is required to solve this.
Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20191120/17e61778/attachment.html 


More information about the Mne_analysis mailing list