Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drop_channels without preloading #4381

Closed
skjerns opened this issue Jul 14, 2017 · 6 comments
Closed

drop_channels without preloading #4381

skjerns opened this issue Jul 14, 2017 · 6 comments

Comments

@skjerns
Copy link
Contributor

skjerns commented Jul 14, 2017

I remember in a previous version I was able to drop channels without preloading the data.

Now this is not possible anymore.

What would be the most simple (and fastest) way to get all data from a certain selection of channels as a numpy array?

Right now I'm loading all data with header.load_data() and then I extract the channels with header.get_data([0,1,2]). I fear that somewhere on the way there might be a memory leakage (I had this before), as my memory consumption is far above the final numpy array nbytes. One way to avoid that is to call header.pick_channels([0,1,2]) but then I'm loading all data just to discard 80% of it.

@agramfort
Copy link
Member

agramfort commented Jul 14, 2017 via email

@skjerns
Copy link
Contributor Author

skjerns commented Jul 14, 2017

great, thanks! works perfectly. Who would have thought that's so easy (well probably it was at an obvious point in the manual that I didn't see).

@larsoner
Copy link
Member

well probably it was at an obvious point in the manual that I didn't see

I'd rather think of it as, if you looked and didn't see it, it wasn't obvious enough. Where did you look? Any time to make a PR to add a line to help the next person?

@skjerns
Copy link
Contributor Author

skjerns commented Jul 18, 2017

I expected to find that at http://martinos.org/mne/stable/manual/memory.html

But also generally at http://martinos.org/mne/stable/manual/#reading-your-data

Can it be found elsewhere?

I'll try to add that to the docs in the next days.

@agramfort
Copy link
Member

agramfort commented Jul 18, 2017 via email

@jaeilepp
Copy link
Contributor

jaeilepp commented Aug 1, 2017

I believe this is solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants