# compute\_source\_psd\_epochs 'noisenorm' error

**URL:** <https://mne.discourse.group/t/compute-source-psd-epochs-noisenorm-error/1621>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [September 18, 2018, 9:29pm UTC](https://mne.discourse.group/t/compute-source-psd-epochs-noisenorm-error/1621 "2018-09-18T21:29:36Z")\
**Posts on this page:** 8\
**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:** [September 18, 2018, 9:29pm UTC](https://mne.discourse.group/t/compute-source-psd-epochs-noisenorm-error/1621/1 "2018-09-18T21:29:36Z")

</div>

Hi all,

&nbsp;&nbsp;&nbsp;When running compute\_psd\_epochs I get the following error:

Traceback (most recent call last):  
&nbsp;&nbsp;File "\<stdin\>", line 1, in \<module\>  
&nbsp;&nbsp;File "/autofs/space/karima\_001/users/alex/software/anaconda2/lib/python2.7/site-packages/mne/minimum\_norm/time\_frequency.py", line 536, in \_compute\_source\_psd\_epochs  
&nbsp;&nbsp;&nbsp;&nbsp;prepared=prepared, method\_params=method\_params, verbose=verbose)  
&nbsp;&nbsp;File "/autofs/space/karima\_001/users/alex/software/anaconda2/lib/python2.7/site-packages/mne/minimum\_norm/time\_frequency.py", line 46, in \_prepare\_source\_params  
&nbsp;&nbsp;&nbsp;&nbsp;K, noise\_norm, vertno, \_ = \_assemble\_kernel(inv, label, method, pick\_ori)  
&nbsp;&nbsp;File "\<string\>", line 2, in \_assemble\_kernel  
&nbsp;&nbsp;File "/autofs/space/karima\_001/users/alex/software/anaconda2/lib/python2.7/site-packages/mne/utils.py", line 729, in verbose  
&nbsp;&nbsp;&nbsp;&nbsp;return function(\*args, \*\*kwargs)  
&nbsp;&nbsp;File "/autofs/space/karima\_001/users/alex/software/anaconda2/lib/python2.7/site-packages/mne/minimum\_norm/inverse.py", line 679, in \_assemble\_kernel  
&nbsp;&nbsp;&nbsp;&nbsp;noise\_norm = inv['noisenorm'][:, None]  
KeyError: 'noisenorm'

My inverse worked to generate the stc so I'm not sure what is going on. Any help would be appreciated.

Thanks,

Alex

Translational NeuroEngineering Laboratory  
Division of Neurotherapeutics, Department of Psychiatry  
Massachusetts General Hospital, Martinos Center  
149 13th St Charlestown #2301, Boston, MA 02129  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20180918/16a68fce/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20180918/16a68fce/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:** [September 19, 2018, 9:31am UTC](https://mne.discourse.group/t/compute-source-psd-epochs-noisenorm-error/1621/2 "2018-09-19T09:31:25Z")

</div>

External Email - Use Caution

HI Alex,

can you check if this error is still present with current master branch?

do you only see it when using "MNE" method?

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:** [September 19, 2018, 12:41pm UTC](https://mne.discourse.group/t/compute-source-psd-epochs-noisenorm-error/1621/3 "2018-09-19T12:41:09Z")

</div>

Hi Alex,

&nbsp;&nbsp;&nbsp;I just pulled the most recent development version of MNE and the error is still occurring. I was originally using python 2.7 but took this impetus to move to python 3.6.5. The MNE version is listed at 0.16.2. Neither python version or the latest pull worked unfortunately, and I am still getting the same error.

Thanks,

Alex

Translational NeuroEngineering Laboratory  
Division of Neurotherapeutics, Department of Psychiatry  
Massachusetts General Hospital, Martinos Center  
149 13th St Charlestown #2301, Boston, MA 02129

---

<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:** [September 19, 2018, 12:51pm UTC](https://mne.discourse.group/t/compute-source-psd-epochs-noisenorm-error/1621/4 "2018-09-19T12:51:12Z")

</div>

External Email - Use Caution

ok so please open an issue here [http://github.com/mne-tools/mne-python/issues](http://github.com/mne-tools/mne-python/issues)  
and provide a full script to replicate the pb using the sample dataset.

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:** [September 19, 2018, 8:56pm UTC](https://mne.discourse.group/t/compute-source-psd-epochs-noisenorm-error/1621/5 "2018-09-19T20:56:35Z")

</div>

Before I do that, I saw that the inverse\_operator['noisenorm'] property was just an empty list in the example audio inverse. Do you or does anyone know what effect setting that property to an empty list would have? If so, I could just do that.

Alex

Translational NeuroEngineering Laboratory  
Division of Neurotherapeutics, Department of Psychiatry  
Massachusetts General Hospital, Martinos Center  
149 13th St Charlestown #2301, Boston, MA 02129

---

<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:** [September 19, 2018, 8:59pm UTC](https://mne.discourse.group/t/compute-source-psd-epochs-noisenorm-error/1621/6 "2018-09-19T20:59:16Z")

</div>

Hi Alex,

Please feel free to pass by my office, if you want to debug it together.

Thanks

Sheraz

---

<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:** [September 20, 2018, 1:34pm UTC](https://mne.discourse.group/t/compute-source-psd-epochs-noisenorm-error/1621/7 "2018-09-20T13:34:31Z")

</div>

I figured it out... it was the prepared = True keyword argument. I hadn't prepared the inverse. It's always the simplest things... thanks for all the help.

Alex

Translational NeuroEngineering Laboratory  
Division of Neurotherapeutics, Department of Psychiatry  
Massachusetts General Hospital, Martinos Center  
149 13th St Charlestown #2301, Boston, MA 02129

---

<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:** [September 20, 2018, 1:38pm UTC](https://mne.discourse.group/t/compute-source-psd-epochs-noisenorm-error/1621/8 "2018-09-20T13:38:40Z")

</div>

External Email - Use Caution

can we avoid making this mistake next time? we should detect it and  
provide a good mesage  
so people don't fall into the trap.

can you send us a PR for this?

thanks

Alex
