diff --git a/CHANGELOG.md b/CHANGELOG.md index 03ec80e5b..c9362fe9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,8 @@ - `DLCPosVideo` table now inserts into self after `make` #966 - Common - Don't insert lab member when creating lab team #983 +- Spikesorting + - Allow user to set smoothing timescale in `SortedSpikesGroup.get_firing_rate` #994 ## [0.5.2] (April 22, 2024) diff --git a/src/spyglass/spikesorting/analysis/v1/group.py b/src/spyglass/spikesorting/analysis/v1/group.py index 1f20a4e11..77a3fad41 100644 --- a/src/spyglass/spikesorting/analysis/v1/group.py +++ b/src/spyglass/spikesorting/analysis/v1/group.py @@ -189,7 +189,11 @@ def get_spike_indicator(cls, key: dict, time: np.ndarray) -> np.ndarray: @classmethod def get_firing_rate( - cls, key: dict, time: np.ndarray, multiunit: bool = False + cls, + key: dict, + time: np.ndarray, + multiunit: bool = False, + smoothing_sigma: float = 0.015, ) -> np.ndarray: spike_indicator = cls.get_spike_indicator(key, time) if spike_indicator.ndim == 1: @@ -202,7 +206,9 @@ def get_firing_rate( return np.stack( [ get_multiunit_population_firing_rate( - indicator[:, np.newaxis], sampling_frequency + indicator[:, np.newaxis], + sampling_frequency, + smoothing_sigma, ) for indicator in spike_indicator.T ],