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

explicitly disallow multitaper in presence of bad annotations #12535

Merged
merged 2 commits into from
Apr 9, 2024

Conversation

drammock
Copy link
Member

@drammock drammock commented Apr 9, 2024

closes #12519

For now, with the 1.7 release pending, @larsoner and I agreed that disallowing multitaper on Raws when there are bad_* annotations present (and reject_by_annotation=True) is the best way to go.

In the long term, we could make that combination actually work by adding a new param (chunk_size or so, analogous to n_per_seg in Welch) and basically doing a welch-MT combination (using multitaper for each chunk, then combining the estimates from each chunk at the end). It's a bit complicated because (we think) you would need to aggregate across-chunks-within-taper first, and then agg across tapers afterward. (cc @mmagnuski who I think has done that for his research before / maybe even implemented in borsar?)

@larsoner larsoner added this to the 1.7 milestone Apr 9, 2024
Copy link
Member

@mscheltienne mscheltienne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me!

@cbrnr
Copy link
Contributor

cbrnr commented Apr 9, 2024

Agreed that's a good way to proceed. This doesn't resolve #11413 though, right?

@drammock
Copy link
Member Author

drammock commented Apr 9, 2024

Agreed that's a good way to proceed. This doesn't resolve #11413 though, right?

correct, this does not address #11413

@drammock drammock enabled auto-merge (squash) April 9, 2024 20:02
@drammock drammock merged commit 105c8b8 into mne-tools:main Apr 9, 2024
30 checks passed
@drammock drammock deleted the psd-nan branch April 9, 2024 21:00
larsoner added a commit to larsoner/mne-python that referenced this pull request Apr 15, 2024
* upstream/main: (50 commits)
  ENH: Improve OPM auditory dataset and example (mne-tools#12539)
  MAINT: Bump to latest pydata-sphinx-theme (mne-tools#12228)
  MRG: Simplify manual installation instructions a little by dropping explicit mention of (lib)mamba (mne-tools#12362)
  fix PSD weights handling when bad annotations present (mne-tools#12538)
  Fix phase loading (mne-tools#12537)
  align FFT windows to good data spans in psd_array_welch (mne-tools#12536)
  explicitly disallow multitaper in presence of bad annotations (mne-tools#12535)
  MAINT: Clean up PyVista contexts (mne-tools#12533)
  MAINT: Complete API change of ordered (mne-tools#12534)
  MAINT: Reinstall statsmodels and improve logging (mne-tools#12532)
  MAINT: Remove scipy.signal.morlet2 (mne-tools#12531)
  Update README badge links (mne-tools#12529)
  BUG: Fix bug with reading his_id from snirf (mne-tools#12526)
  [pre-commit.ci] pre-commit autoupdate (mne-tools#12524)
  Fix file format check in _check_eeglab_fname function (mne-tools#12523)
  MAINT: Reenable picard in pre testing (mne-tools#12525)
  MAINT: Bump to large resource class (mne-tools#12522)
  MAINT: Restore 2 jobs on Windows (mne-tools#12520)
  Add exclude_after_unique option to mne.io.read_raw_edf/read_raw_edf to search for exclude channels after making channel names unique (mne-tools#12518)
  Improve consistency of sensor types in code and documentation (mne-tools#12509)
  ...
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

Successfully merging this pull request may close these issues.

raw.compute_psd("multitaper", ...) on a raw with "bad_xxx" annotations yields all np.nan
4 participants