-
Notifications
You must be signed in to change notification settings - Fork 64
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
Dealing differently with missing data and short intervals #352
Comments
I might understand what you mean. Can you describe the behavior of time_support you would need? |
I think the issue is in |
If I understood correctly, you want the count process with bins containing gaps in the support, to still return the number of of events, but normalised by the actual time support.
|
Agreed, this would be a rate more than a count. For the time series support, I would actually use the span |
I will describe my (potentially very niche) issue as it is easier for understanding the request:
I currently have a trace with strong artefacts from optogenetic stimulation. Opto stimulation consists in 40 Hz pulses, 10ms each, on for 6 seconds total. During spike sorting, I blanked all times where the laser is on (which means, only the 10 ms windows, not the whole 6 seconds trials). In this way, I can avoid the artefacts but I mess up my spike detection as I can't find correct spikes in the 10 ms window. This forces me to always compensate the bin size when computing firing rates during the trials
I wanted to implement a nice solution using the
time_support
property inpynapple
. Basically What I would like to set only the laser_off times as atime_support
so that a call tospike_times.count(bin_size=x)
would gives me correct firing rate in the bins, ignoring the small 10ms epochs that are out of the time support.Currently, however, this would not be supported: if I perform the count with an large bin size that would span multiple time intervals in and out of the time support (eg, 100 ms), they are all set to nan and interpolate over by
count()
. Example plot: (blue trace below, laser; orange trace: counts withbin_size=0.1
; green trace: counts after restricting with suitable time_intervals)Would you be willing to support a change in the behavior of
time_support
that correct this? I am happy trying to implement it but not if it messes up other usages I am not seeing.The text was updated successfully, but these errors were encountered: