-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
FIX: Fix simulate_evoked and apply_forward #9513
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
Conversation
agramfort
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you can just update the docstring it would be great !
thx @larsoner !
mne/simulation/evoked.py
Outdated
| Measurement info to generate the evoked. | ||
| cov : Covariance object | ||
| cov : Covariance object | None | ||
| The noise covariance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If None what is it that we do?
|
cc @LaetitiaG it should fix your pb. |
|
Indeed, it works fine now! thanks a lot! |
agramfort
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@larsoner I pushed here. Merge if happy
| evoked = apply_forward(fwd, stc, info, use_cps=use_cps) | ||
| if cov is None: | ||
| return evoked | ||
|
|
||
| if nave < np.inf: | ||
| noise = _simulate_noise_evoked(evoked, cov, iir_filter, random_state) | ||
| evoked.data += noise.data / math.sqrt(nave) | ||
| evoked.nave = np.int64(nave) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incorrect as you now no longer set nave in the cov=None case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... oh I guess this was always the case when nave=np.inf, but I'll fix it here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
argh I see now why you did it this way. I'm okay with it!
* upstream/main: MAINT: Speed up CIs (mne-tools#9518) Update tools (mne-tools#9517) FIX: Fix simulate_evoked and apply_forward (mne-tools#9513) FIX: Mayavi (mne-tools#9512)
No description provided.