-
Notifications
You must be signed in to change notification settings - Fork 237
fix bug spatial filter #4175 #4286
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
base: main
Are you sure you want to change the base?
Conversation
| from copy import deepcopy | ||
|
|
||
| import spikeinterface as si | ||
| import spikeinterface.full as si |
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.
Why switch from core to full. This is super heavy and probably not necessary right? This is a bit of a poorly explained part of our importing.
import spikeinterface as siis equivalent to
import spikeinterface.core as siwhich is a faster import.
alejoe91
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.
Thanks @oliche!!!
Just a few minor comments
| if Path(folder_path).is_file(): | ||
| folder_path = Path(folder_path).parent |
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.
Why do we need this? :)
One can either pass the root folder or a direct path the the cbin file with the cbin_file_path arg
| gain = scipy.signal.fftconvolve(np.abs(traces), window[:, None], mode="same", axes=0) | ||
| # default value for epsilon is relative to the rms, loosely matching the IBL 1e-8 for an input in Volts | ||
| if epsilon is None: | ||
| epsilon = np.std(traces - np.mean(traces)) * 0.003 |
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.
maybe the 0.003 should also be an argument? epsilon_factor?
| local_path = si.download_dataset(remote_path="spikeglx/Noise4Sam_g0") | ||
| si_recording = se.read_spikeglx(local_path, stream_id="imec0.ap") | ||
| si_recording = spre.astype(si_recording, "float") | ||
| recording_ps = si.phase_shift(si_recording) |
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.
| recording_ps = si.phase_shift(si_recording) | |
| recording_ps = spre.phase_shift(si_recording) |
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.
following @zm711 comment about not importing full!
| si_recording = se.read_spikeglx(local_path, stream_id="imec0.ap") | ||
| si_recording = spre.astype(si_recording, "float") | ||
| recording_ps = si.phase_shift(si_recording) | ||
| recording_hp = si.highpass_filter(recording_ps, freq_min=300, filter_order=3) |
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.
| recording_hp = si.highpass_filter(recording_ps, freq_min=300, filter_order=3) | |
| recording_hp = spre.highpass_filter(recording_ps, freq_min=300, filter_order=3) |
| si_recording = spre.astype(si_recording, "float") | ||
| recording_ps = si.phase_shift(si_recording) | ||
| recording_hp = si.highpass_filter(recording_ps, freq_min=300, filter_order=3) | ||
| recording_hps = si.highpass_spatial_filter(recording_hp) |
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.
| recording_hps = si.highpass_spatial_filter(recording_hp) | |
| recording_hps = spre.highpass_spatial_filter(recording_hp) |
Fixed the main bug: all of the processing has to be done in float, even if only to reconvert to int at the end of the module.
I have also improved a few things:
neurodspmodule doesn't exist anymore