Skip to content

Conversation

@christianbrodbeck
Copy link
Member

Currently when running raw.plot_psd() with data containing a dead channel an empty plot is created. Should the fix treat the dead channel like a normal channel or raise a warning or error?

screen shot 2016-06-26 at 1 33 09 pm

@agramfort
Copy link
Member

aren't you supposed to mark such channels as bad?

@christianbrodbeck
Copy link
Member Author

Right, but if you forget to mark them as bad mne should not break but rather help figure out what's wrong, hence I am suggesting to warn or raise an error.

@agramfort
Copy link
Member

ok so I'll let you come up with a good way to do this :)

@christianbrodbeck
Copy link
Member Author

ok :) raising an error now...

@agramfort
Copy link
Member

LGTM

any other opinion?

@jona-sassenhagen
Copy link
Contributor

I'm only wondering if this check should be made more generally for other plotting functions. I sometimes do something wrong and end up trying to plot nan ERPs.

@larsoner
Copy link
Member

Perhaps, but that can be a follow-up PR. We probably want to use np.isfinite instead of np.isinf, for example, since np.isfinite will also catch NaN.

@dengemann
Copy link
Member

Seems ok to me, but let' make sure not to implement it too high-level, down-stream, maybe useful in many other locations. To be checked.

@christianbrodbeck
Copy link
Member Author

@Eric89GXL @dengemann are you making suggestions for this PR or discussing a more general solution?

@larsoner
Copy link
Member

Future PR for isfinite is fine

@christianbrodbeck christianbrodbeck changed the title raw.plot_psd() with flat channel [MRG] raw.plot_psd() with flat channel Jun 29, 2016
@agramfort agramfort merged commit bd3a8c1 into mne-tools:master Jun 29, 2016
@agramfort
Copy link
Member

thx @christianbrodbeck

@christianbrodbeck christianbrodbeck deleted the plot_psd branch June 29, 2016 13:59
jona-sassenhagen added a commit to jona-sassenhagen/mne-python that referenced this pull request Jul 5, 2016
* 'master' of git://github.com/mne-tools/mne-python: (48 commits)
  FIX: Flake
  fix pep8
  [MRG] FIX Topographic plotting for KIT-UMD data (mne-tools#3349)
  QUICKFIX: logging test
  Error message for simulate evoked. (mne-tools#3372)
  Warnings for big bems. (mne-tools#3374)
  Add test for baseline correction.
  Use apply_baseline in read_evokeds.
  Makes (None, 0) the default value baseline in apply_baseline.
  [FIX] Adds apply_baseline to Evoked
  fix component inds in ica tutorial (mne-tools#3379)
  FIX: Xdawn with shuffled epochs (mne-tools#3373)
  FIX consistency:  Epochs.load_data() should always return self (mne-tools#3376)
  MRG: Build relevant examples (mne-tools#3365)
  [MRG] set vmin, vmax after smoothing in plot_epochs_image (mne-tools#3360)
  [FIX] Attempt to fix circle.
  fixing a bg plotting bug for topo plots
  Modified test and tutorial.
  [MRG] convert surface using python. (mne-tools#3273)
  [MRG] raw.plot_psd() with flat channel (mne-tools#3342)
  ...
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.

5 participants