spiketools.utils.timestamps.create_bin_times¶
- spiketools.utils.timestamps.create_bin_times(bins)[source]¶
Create a timepoints definition for a set of time bins.
- Parameters:
- bins1d array
Time bins.
- Returns:
- bin_times1d array
Time values corresponding to the bin definition.
Notes
The bin timepoints are defined as the center point of each bin. This function works for evenly spaced and uneven bin definitions.
Examples
Create bin times:
>>> bins = np.array([0, 1, 2, 3, 4, 5]) >>> create_bin_times(bins) array([0.5, 1.5, 2.5, 3.5, 4.5])