Channel information in psd functions

Hello!

What would be the best way to get channel names info from psd results (e.g. with psd_welch function)?
With the picks option you can select the specific channels to include. If there you have a list, then you have the information already there, but if you select things like “all” or “meg” where could we recover the channel info for each line of the array output?

Thanks!

Also where could I find the units of the results?

Units of psd_welch are (amplitude ** 2) / Hz, where amplitude will be the SI unit for the channel type (V for EEG, T for magnetometers, etc).

For keeping track of channel names, one approach is to store raw.ch_names (or epochs.ch_names or evoked.ch_names) in a list, then use mne.pick_info to get your pick indices. You can then use the pick indices for both the PSD function and for indexing the channel name list.