allensdk.brain_observatory.behavior.event_detection module¶
- allensdk.brain_observatory.behavior.event_detection.filter_events_array(arr: ndarray, scale: float = 2, n_time_steps: int = 20) ndarray [source]¶
Convolve the trace array with a 1d causal half-gaussian filter to smooth it for visualization
Uses a halfnorm distribution as weights to the filter
Modified from initial implementation by Nick Ponvert
- Parameters:
- arr: np.ndarray
Trace matrix of dimension n traces x n frames
- scale: float
std deviation of halfnorm distribution in units of timesteps
- n_time_steps: int
number of time steps to use for the convolution operation
- Returns:
- np.ndarray:
Output of the convolution operation