lsurf.detectors.analysis.compute_angular_distribution
- lsurf.detectors.analysis.compute_angular_distribution(events, reference_direction, num_bins=50)[source]
Compute angular distribution histogram.
- Parameters:
events (list of DetectionEvent) – Detection events to analyze.
reference_direction (ndarray, shape (3,)) – Reference direction for angle calculation.
num_bins (int, optional) – Number of histogram bins. Default is 50.
- Returns:
bin_centers (ndarray, shape (num_bins,)) – Bin centers in degrees.
counts (ndarray, shape (num_bins,)) – Number of events in each bin.
- Return type:
tuple[ndarray[tuple[Any, …], dtype[float64]], ndarray[tuple[Any, …], dtype[int64]]]
Examples
>>> angles, counts = compute_angular_distribution( ... detector.events, ... reference_direction=np.array([0, 0, 1]), ... num_bins=90 # 2-degree bins ... ) >>> import matplotlib.pyplot as plt >>> plt.bar(angles, counts, width=2) >>> plt.xlabel('Angle (degrees)') >>> plt.ylabel('Count')