-
Notifications
You must be signed in to change notification settings - Fork 243
Description
The function NumpySorting.from_unit_dict sais
Each dict have unit_ids as keys and spike times as values
but units_dict_list is interpreted to have values as samples
| sample_indices.append(spike_times) |
Because of minimum_spike_dtype the data is casted from seconds float to int64
Either we adjust the docstring, or it could be nice to have a convenience function like from_unit_dict where we can define whether to be interpreted as samples or seconds (like the recent updates to spikeinterface clarified NumpySorting.from_times_and_labels / NumpySorting.from_samples_and_labels we could name them differently )
Edit: Actually I was looking for a function to create a sorting from a Pynapple TsGroup (in seconds) as to_pynapple_tsgroup creates, so to read that again without having access to the original Sorting/SortingAnalyzer.
# spike_trains = dict(session.units)
spike_trains = {unit_id: st.t for unit_id,st in units_tsgroup.items()} # units_tsgroup is a nap.TsGroup , convert times from nap.Ts (timestamp) to numpy array
spike_trains.keys() # unit ids
sorting = NumpySorting.from_unit_dict(spike_trains, sampling_frequency=sampling_frequency)