lsurf.detectors.analysis.compute_time_distribution
- lsurf.detectors.analysis.compute_time_distribution(events, num_bins=50, time_range=None)[source]
Compute arrival time distribution histogram.
- Parameters:
events (list of DetectionEvent) – Detection events to analyze.
num_bins (int, optional) – Number of histogram bins. Default is 50.
time_range (tuple of float, optional) – (min, max) time range for histogram. If None, uses data range.
- Returns:
bin_centers (ndarray, shape (N,)) – Bin centers in seconds.
counts (ndarray, shape (N,)) – Number of events in each bin.
- Return type:
tuple[ndarray[tuple[Any, …], dtype[float64]], ndarray[tuple[Any, …], dtype[int64]]]
Notes
Automatically handles cases where all times are very similar by reducing the number of bins to avoid empty histograms.
Examples
>>> times, counts = compute_time_distribution( ... detector.events, ... num_bins=100 ... ) >>> print(f"Time spread: {times.max() - times.min():.3e} s")