Skip to main content

cells.compute_3d_acgs

cells.compute_3d_acgs(spike_times, spike_clusters, cluster_ids, fs)

Firing-rate-decile x log-time-lag 3D autocorrelogram, one per cluster.

Computes the linear-time 3D ACG (spikeinterface’s compute_acgs_3d, the same algorithm as npyx.c4.fast_acg3d), then resamples each cluster onto Han Yu’s NEMO/ICLR log-time axis via :func:ephysatlas.iblnpyx.convert_acg_log. Uses this module’s ACG3D_* constants; call with unmodified constants to reproduce a reference dataset exactly.

Requires the optional spikeinterface dependency (pip install ibleatools[full]); imported lazily here so the rest of this module stays usable without it.

Parameters

Name Type Description Default
spike_times numpy.ndarray Spike times for the whole recording, in seconds. required
spike_clusters numpy.ndarray Cluster id of each spike, same length as spike_times. required
cluster_ids numpy.ndarray Clusters to compute the ACG for; defines the output row order. required
fs float Sampling frequency of spike_times, in Hz. required

Returns

Name Type Description
acgs_3d numpy.ndarray (len(cluster_ids), ACG3D_NUM_FIRING_RATE_QUANTILES, 201) float32 array.
t_log numpy.ndarray (201,) log-time bin centres, in ms (negative, zero, then positive lags).