You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Short-term solution would be to skip traces that have NaN's in them.
Long-term we'll want to be able to handle NaN's in the trace.
Additionally, need to ensure that sigma and gamma are estimated correctly with NaN values.
Example code that fails (modified from test_spikes.py):
importsimaimportsima.spikesimportnumpyasnpfromscipyimportsignalfromscipy.statsimportuniform, normimportpicosRATE=1# mean firing rate of poisson spike train (Hz)STEPS=100# number of time steps in dataTAU=0.6# time constant of calcium indicator (seconds)DELTAT=1/30# time step duration (seconds)sigma=0.1# standard deviation of gaussian noiseSEED=2222# random number generator seed# Make a poisson spike trainsspikes=sima.spikes.get_poisson_spikes(
deltat=DELTAT, rate=RATE, steps=STEPS, seed=SEED)
# Convolve with kernel to make calcium signalnp.random.seed(SEED)
gamma=1- (DELTAT/TAU)
CALCIUM=signal.lfilter([1], [1, -gamma], spikes)
# Make fluorescence traces with random gaussian noise and baselinefluors=CALCIUM+norm.rvs(
scale=sigma, size=STEPS) +uniform.rvs()
fluors[5:7] =np.naninference, fits, params=sima.spikes.spike_inference(fluors)
The text was updated successfully, but these errors were encountered:
As the title says.
Short-term solution would be to skip traces that have NaN's in them.
Long-term we'll want to be able to handle NaN's in the trace.
Additionally, need to ensure that sigma and gamma are estimated correctly with NaN values.
Example code that fails (modified from test_spikes.py):
The text was updated successfully, but these errors were encountered: