Skip to content

Commit 47b0c63

Browse files
committed
Remove Angle.lst_to_hour_angle and hour_angle_to_lst functions (see astropy#1385)
1 parent 28c2d43 commit 47b0c63

2 files changed

Lines changed: 1 addition & 68 deletions

File tree

‎astropy/coordinates/angles.py‎

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@
1717
from ..utils import deprecated
1818

1919

20-
__all__ = ['Angle', 'AngularSeparation', 'Latitude', 'Longitude',
21-
'hour_angle_to_lst', 'lst_to_hour_angle']
20+
__all__ = ['Angle', 'AngularSeparation', 'Latitude', 'Longitude']
2221

2322

2423
TWOPI = math.pi * 2.0 # no need to calculate this all the time
@@ -795,52 +794,3 @@ def angle_axis(matrix, unit=None):
795794
if unit is None:
796795
unit = u.degree
797796
return angle.to(unit), axis
798-
799-
800-
def lst_to_hour_angle(ra, lst):
801-
"""
802-
Computes the hour angle for this RA given a local sidereal
803-
time (LST).
804-
805-
Parameters
806-
----------
807-
lst : `~astropy.coordinates.angle.Angle` or equivalent, `~astropy.time.Time`
808-
A local sidereal time (LST).
809-
810-
Returns
811-
-------
812-
hour_angle : `~astropy.coordinates.angle.Angle`
813-
The hour angle for this RA at the LST.
814-
"""
815-
if not isinstance(ra, Angle):
816-
ra = Angle(ra)
817-
if hasattr(lst, 'mjd'):
818-
lst = Angle(np.remainder(lst.mjd, 1), unit=u.hour)
819-
else:
820-
lst = Angle(lst)
821-
822-
return np.mod(lst - ra, 24. * u.hourangle)
823-
824-
825-
def hour_angle_to_lst(ra, hour_angle):
826-
"""
827-
Calculates the local sidereal time (LST) if this RA is at a
828-
particular hour angle.
829-
830-
Parameters
831-
----------
832-
ra : `astropy.coordinates.angle.Angle` or equivalent
833-
hour_angle : `~astropy.coordinates.angle.Angle` or equivalent
834-
An hour angle.
835-
836-
Returns
837-
-------
838-
lst : `~astropy.coordinates.angle.Angle`
839-
The local siderial time for this RA and hour_angle as an angle.
840-
"""
841-
if not isinstance(ra, Angle):
842-
ra = Angle(ra)
843-
if not isinstance(hour_angle, Angle):
844-
hour_angle = Angle(hour_angle)
845-
846-
return np.mod(hour_angle + ra, 24 * u.hourangle)

‎astropy/coordinates/tests/test_angles.py‎

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -220,20 +220,3 @@ def test_is_within_bounds():
220220
assert a.is_within_bounds('0d', '360d') is False
221221
assert a.is_within_bounds(None, '360d') is True
222222
assert a.is_within_bounds(-30 * u.deg, None) is True
223-
224-
225-
def test_lst_to_hour_angle():
226-
from ...time import Time
227-
ra = '1:00:00h'
228-
ha1 = lst_to_hour_angle(ra, Angle(1.5, u.hour))
229-
assert isinstance(ha1, Angle)
230-
npt.assert_almost_equal(ha1.hour, 0.5)
231-
232-
ha2 = lst_to_hour_angle(ra, Time('2012-1-1 3:00:00', scale='utc'))
233-
npt.assert_almost_equal(ha2.hour, 23.125)
234-
235-
236-
def test_hour_angle_to_lst():
237-
lst = hour_angle_to_lst('1:00:00h', Angle(1.5, u.hour))
238-
assert isinstance(lst, Angle)
239-
npt.assert_almost_equal(lst.hour, 2.5)

0 commit comments

Comments
 (0)