calculate_mean_direction#
- magicctapipe.utils.calculate_mean_direction(lon, lat, unit, weights=None)[source]#
Calculates the mean direction per shower event.
Please note that the input is supposed to be the pandas Series with the multi index (obs_id, event_id) to group telescope events.
- Parameters:
- lon
pandas.Series Longitude in a spherical coordinate
- lat
pandas.Series Latitude in a spherical coordinate
- unit
str Unit of the input (and output) angles - “deg”, “degree”, “rad” or “radian” are allowed
- weights
pandas.Series Weights for the input directions
- lon
- Returns:
- lon_mean
pandas.Series Longitude of the mean direction
- lat_mean
pandas.Series Latitude of the mean direction
- lon_mean