Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Kilosort / phy2

Sorrel reads everything phy reads. The minimum is two arrays plus a trace; the rest of the phy artefacts are picked up opportunistically and unlock additional views.

Required

FilePurpose
spike_times.npySpike sample indices.
spike_clusters.npyCluster ID for each spike.

Plus a raw trace — typically recording.dat. The path can come from params.py:dat_path, --dat, --oebin, or default to recording.dat inside the directory.

Optional, used when present

FilePowers
params.pySample rate, n channels, dtype, offset, dat path.
cluster_group.tsvInitial good / mua / noise / unsorted labels.
channel_positions.npyProbe geometry — authoritative row order.
templates.npyTemplate view, similarity matrix.
template_features.npy, template_feature_ind.npyTemplate-feature scatter.
pc_features.npy, pc_feature_ind.npyFeature view (PC space).
amplitudes.npyAmplitude-vs-time scatter, drift map.
similar_templates.npySimilarity view shortcut.
cluster_<metric>.tsvQuality-metric columns in the cluster table.
quality_metrics.csvSI-style quality metrics.
probe.json / probegroup.jsonProbe geometry fallback (probeinterface).

Loading model

Spike arrays and the raw .dat are memory-mapped. On open, Sorrel buckets spike times and amplitudes once per cluster; subsequent hot-path lookups are slice borrows into the bucket. The .npy parser supports the dtypes Kilosort actually emits for these arrays.