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:
lonpandas.core.series.Series

Longitude in a spherical coordinate

latpandas.core.series.Series

Latitude in a spherical coordinate

unitstr

Unit of the input (and output) angles - “deg”, “degree”, “rad” or “radian” are allowed

weightspandas.core.series.Series

Weights for the input directions

Returns:
lon_meanpandas.core.series.Series

Longitude of the mean direction

lat_meanpandas.core.series.Series

Latitude of the mean direction