Skip to content

Commit

Permalink
Using circmean to get circular mean
Browse files Browse the repository at this point in the history
  • Loading branch information
steob92 committed Jun 7, 2024
1 parent ee2a5fc commit 04617c5
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pyV2DL3/eventdisplay/fillEVENTS.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
getRunQuality,
produce_tel_list,
)
from scipy.stats import circmean

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -198,12 +199,7 @@ def __get_average_pointing(file, runNumber):
"""
pointingDataReduced = file[
f"run_{runNumber}/stereo/pointingDataReduced"].arrays(library="np")
avRA = np.rad2deg(
np.arctan2(
np.sum(np.sin(pointingDataReduced["TelRAJ2000"])),
np.sum(np.cos(pointingDataReduced["TelRAJ2000"])),
)
)
avRA = np.rad2deg(circmean(pointingDataReduced["TelRAJ2000"]))
avDec = np.mean(np.rad2deg(pointingDataReduced["TelDecJ2000"]))

return avRA, avDec
Expand Down

0 comments on commit 04617c5

Please sign in to comment.