Skip to content

Commit

Permalink
Do not create wrap_angle each time
Browse files Browse the repository at this point in the history
  • Loading branch information
maxnoe committed Jul 22, 2022
1 parent 2bd0411 commit 46be9e6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ctapipe/coordinates/telescope_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
__all__ = ["TelescopeFrame"]


_wrap_angle = Angle(180, unit=u.deg)


class TelescopeFrame(BaseCoordinateFrame):
"""
Telescope coordinate frame.
Expand Down Expand Up @@ -73,7 +76,7 @@ def __init__(self, *args, **kwargs):

# make sure telescope coordinate is in range [-180°, 180°]
if isinstance(self._data, UnitSphericalRepresentation):
self._data.lon.wrap_angle = Angle(180, unit=u.deg)
self._data.lon.wrap_angle = _wrap_angle


@frame_transform_graph.transform(FunctionTransform, TelescopeFrame, TelescopeFrame)
Expand Down

0 comments on commit 46be9e6

Please sign in to comment.