# compute\_psd for resp, gsr, and temperature channels

**URL:** <https://mne.discourse.group/t/compute-psd-for-resp-gsr-and-temperature-channels/7405>\
**Category:** Support & Discussions\
**Tags:** raw\
**Created:** [August 20, 2023, 11:36pm UTC](https://mne.discourse.group/t/compute-psd-for-resp-gsr-and-temperature-channels/7405 "2023-08-20T23:36:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonas.mago](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/jonas.mago/32/935_2.png) [@jonas.mago](https://mne.discourse.group/u/jonas.mago)\
**Post date:** [August 20, 2023, 11:36pm UTC](https://mne.discourse.group/t/compute-psd-for-resp-gsr-and-temperature-channels/7405/1 "2023-08-20T23:36:12Z")

</div>

Hey there,

I am working with an MNE raw object that has 32 eeg channels and a few additional channel types: eog, ecg, resp, gsr, and temperature.  
I am interested in computing the PSD for these channels. For the EEG, eog, and ecg channels this works fine without any problems. However, for the resp, gsr, and temperature channels it just doesn’t work.

Are these channel types handled differently? And if so, is there a way to compute the psd for chose channels?

As a work around I could just label these channels ecg or eog, but if possible I would much rather keep the correct labels.

Furthermore, can someone recommend a good tutorial for working with these other peripheral physiological measures within MNE python or is it recommended to use other packages to analyse those?

All the best,  
Jonas

---

<div class="post-metadata">

**Author:** ![cbrnr](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/cbrnr/32/1409_2.png) [@cbrnr](https://mne.discourse.group/u/cbrnr)\
**Post date:** [August 21, 2023, 7:22am UTC](https://mne.discourse.group/t/compute-psd-for-resp-gsr-and-temperature-channels/7405/2 "2023-08-21T07:22:58Z")

</div>

What is the actual outcome when you compute the PSD for these channel types? Do you get an error? If not, what does the produced figure look like?

---

<div class="post-metadata">

**Author:** ![agramfort](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@agramfort](https://mne.discourse.group/u/agramfort)\
**Post date:** [August 21, 2023, 7:28am UTC](https://mne.discourse.group/t/compute-psd-for-resp-gsr-and-temperature-channels/7405/3 "2023-08-21T07:28:37Z")

</div>

hi Jonas,

There is a notion of “data channels” in mne and it’s possible that channels you are  
interested in are not considered “data channels” so they are excluded from certain  
computations like PSD.

[https://github.com/mne-tools/mne-python/blob/main/mne/io/pick.py#L1195](https://github.com/mne-tools/mne-python/blob/main/mne/io/pick.py#L1195)

[https://github.com/mne-tools/mne-python/blob/main/mne/io/pick.py#L1086](https://github.com/mne-tools/mne-python/blob/main/mne/io/pick.py#L1086)

We could reconsider this. In the mean time you can fake them as some already considered  
“data channel”.

Alex

---

<div class="post-metadata">

**Author:** ![mscheltienne](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/mscheltienne/32/827_2.png) [@mscheltienne](https://mne.discourse.group/u/mscheltienne)\
**Post date:** [August 21, 2023, 7:31am UTC](https://mne.discourse.group/t/compute-psd-for-resp-gsr-and-temperature-channels/7405/4 "2023-08-21T07:31:16Z")

</div>

Hello,

It should work, but you have to explicitly provide these channels in the `picks` argument of `compute_psd`.

```python
import numpy as np
from mne import create_info
from mne.io import RawArray

data = np.random.randn(1, 1000)
info = create_info(["GSR 1"], 1000, "gsr")
raw = RawArray(data, info)
spectrum = raw.compute_psd() # fails
spectrum = raw.compute_psd(picks="gsr") # works

```

This is due to `gsr`, `temperature`, … not being considered as [data channels](https://mne.tools/stable/glossary.html#term-data-channels).

Mathieu
