# epochs.save()

**URL:** <https://mne.discourse.group/t/epochs-save/1203>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [April 10, 2017, 12:29pm UTC](https://mne.discourse.group/t/epochs-save/1203 "2017-04-10T12:29:02Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 10, 2017, 12:29pm UTC](https://mne.discourse.group/t/epochs-save/1203/1 "2017-04-10T12:29:02Z")

</div>

Hi all,  
I'm trying to save epochs data using these two commands:

1- epochs = mne.Epochs(raw,events,event\_id,tmin,tmax,picks=picks,

baseline=baseline,reject=reject,preload=True,verbose=True)  
2- epochs.save(epo\_fname)

the epochs are saved into two files each with size around 600 MB although  
the total size of the input raw fif file is only 1.25 GB! as far as I know  
this should not happen unless the fif file is larger than 2 GB!?

I would appreciate it if anyone could explain why this would happen and how  
to save the epochs in one fif file.

with best regards  
Rasha  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20170410/57e13062/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20170410/57e13062/attachment.html)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 10, 2017, 12:44pm UTC](https://mne.discourse.group/t/epochs-save/1203/2 "2017-04-10T12:44:51Z")

</div>

Hi Rasha,

see split\_size option of epochs.save  
\<[https://4354-1301584-gh.circle-artifacts.com/0/home/ubuntu/mne-python/doc/\_build/html/generated/mne.Epochs.html?highlight=epochs%20save#mne.Epochs.save](https://4354-1301584-gh.circle-artifacts.com/0/home/ubuntu/mne-python/doc/_build/html/generated/mne.Epochs.html?highlight=epochs%20save#mne.Epochs.save)\>  
.

-Jaakko

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 10, 2017, 1:59pm UTC](https://mne.discourse.group/t/epochs-save/1203/3 "2017-04-10T13:59:47Z")

</div>

Hi Jaakko,  
thanks for your reply. I have already tried that option and ran epoching  
after setting split\_size to '2GB':  
epochs.save(epo\_fname, split\_size= '2GB')

but still having the same problem, two saved files!  
am I doing something wrong here? isn't the default splitting size value  
'2GB' or should we set it explicitly when saving?

Rasha

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 10, 2017, 2:09pm UTC](https://mne.discourse.group/t/epochs-save/1203/4 "2017-04-10T14:09:07Z")

</div>

hi Rasha,

can you provide a code snippet to replicate?

thanks  
Alex

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 10, 2017, 2:42pm UTC](https://mne.discourse.group/t/epochs-save/1203/5 "2017-04-10T14:42:34Z")

</div>

Hi Alex,  
this is what I'm using for epoching:

events = mne.find\_events(raw, stim\_channel='STI101',  
shortest\_event=2,min\_duration=0.002, verbose=True)

picks = mne.pick\_types(raw.info,meg=True, eeg=True, eog=True, stim=False,  
exclude='bads')

epochs = mne.Epochs(raw,events,event\_id,tmin,tmax,picks=picks,  
baseline=baseline,reject=reject,preload=True,verbose=True)  
# epochs.save(epo\_fname)  
epochs.save(eop\_fname, split\_size='2GB')

However, I'm not sure if you need more specific information but I can send  
them to you.

I want to mention that I've noticed that epochs are splitted into two files  
whenever the total size is larger that 1GB and I'm not sure why this is the  
case!

Many thanks for your help  
Rasha

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 10, 2017, 3:28pm UTC](https://mne.discourse.group/t/epochs-save/1203/6 "2017-04-10T15:28:55Z")

</div>

I believe there is a bug in the size calculation. See  
[https://github.com/mne-tools/mne-python/issues/4180](https://github.com/mne-tools/mne-python/issues/4180)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 10, 2017, 7:58pm UTC](https://mne.discourse.group/t/epochs-save/1203/7 "2017-04-10T19:58:40Z")

</div>

Many thanks Jaakko, I will check this.

all the best  
Rasha
