AllenSDK
AllenSDK copied to clipboard
calculate_dvdt(v_window, t_window, filter) throwing an error
Describe the bug I'm calling the putative_spike_detection function on some optical electrophysiology data. The data is squeezed to a range of -80,80 mV.
The function runs smoothly until it calls on the calculate_dvdt function, where it then throws the error:
Traceback (most recent call last):
File "allen_sdk.py", line 258, in
I can eliminate the error by setting the filter parameter to anything less than or equal to 0.000099, but this returns no spike indices despite obvious spikes in the data.
To Reproduce Here is a sample of the data that I'm working with:

and as of now I'm calling the putative spike function with the correct numpy arrays, one voltage array and the other a time array of equivalent dimension:
def allensdk_feature_extraction(denoised_trace):
voltage = np.interp(denoised_trace,(denoised_trace.min(),denoised_trace.max()),(-80,80))
time = np.arange(1,voltage.shape[0]+1)
spike_indices = detect_putative_spikes(voltage,time)
print(f"spike indices: : {spike_indices}")
Environment (please complete the following information):
- OS & version: MacOS 11.5.2
- Python version: Python 3.7.13
- AllenSDK version: allensdk 2.13.4
Thank you for the help!
@ImagineOrange Just curious: is it possible for you to provide us with a .txt file containing a sample of voltage, time values that are failing but that you would expect to succeed?
If not, we'll find a way to work through, but it will be more straightforward on our end if there is example of data that is provoking this failure.
Thanks.
@danielsf sure thing: Here are voltage,time in order. time.txt voltage.txt
thank you for the quick response.