Skip to content

Commit

Permalink
Make sure HillasReconstructor az is in [0, 360)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxnoe committed Sep 23, 2022
1 parent 91dd16a commit 20b2e05
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ctapipe/reco/hillas_reconstructor.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
TooFewTelescopesException,
)



__all__ = ["HillasReconstructor"]


Expand All @@ -39,6 +37,9 @@
)


_two_pi = 2 * np.pi


def angle(v1, v2):
"""computes the angle between two vectors
assuming cartesian coordinates
Expand Down Expand Up @@ -188,9 +189,11 @@ def __call__(self, event):
# estimate max height of shower
h_max = self.estimate_h_max(cog_cartesian, telescope_positions)

# convert lon to az keeping az in [0, 360]
az = u.Quantity(_two_pi - lon.to_value(u.rad), u.rad)
return ReconstructedGeometryContainer(
alt=lat,
az=-lon, # az is clockwise, lon counter-clockwise
az=az, # az is clockwise, lon counter-clockwise
core_x=core_pos_ground.x,
core_y=core_pos_ground.y,
core_tilted_x=core_pos_tilted.x,
Expand Down

0 comments on commit 20b2e05

Please sign in to comment.