2121def test_against_hor2eq ():
2222 """Check that Astropy gives consistent results with an IDL hor2eq example.
2323
24- See EXAMPLE input and output here:
25- http://idlastro.gsfc.nasa.gov/ftp/pro/astro/hor2eq.pro
24+ See : http://idlastro.gsfc.nasa.gov/ftp/pro/astro/hor2eq.pro
25+
26+ Test is against these run outputs, run at 2000-01-01T12:00:00:
27+
28+ # NORMAL ATMOSPHERE CASE
29+ IDL> hor2eq, ten(37,54,41), ten(264,55,06), 2451545.0d, ra, dec, /verb, obs='kpno', pres=781.0, temp=273.0
30+ Latitude = +31 57 48.0 Longitude = *** 36 00.0
31+ Julian Date = 2451545.000000
32+ Az, El = 17 39 40.4 +37 54 41 (Observer Coords)
33+ Az, El = 17 39 40.4 +37 53 40 (Apparent Coords)
34+ LMST = +11 15 26.5
35+ LAST = +11 15 25.7
36+ Hour Angle = +03 38 30.1 (hh:mm:ss)
37+ Ra, Dec: 07 36 55.6 +15 25 02 (Apparent Coords)
38+ Ra, Dec: 07 36 55.2 +15 25 08 (J2000.0000)
39+ Ra, Dec: 07 36 55.2 +15 25 08 (J2000)
40+ IDL> print, ra, dec
41+ 114.23004 15.418818
42+
43+ # NO PRESSURE CASE
44+ IDL> hor2eq, ten(37,54,41), ten(264,55,06), 2451545.0d, ra, dec, /verb, obs='kpno', pres=0.0, temp=273.0
45+ Latitude = +31 57 48.0 Longitude = *** 36 00.0
46+ Julian Date = 2451545.000000
47+ Az, El = 17 39 40.4 +37 54 41 (Observer Coords)
48+ Az, El = 17 39 40.4 +37 54 41 (Apparent Coords)
49+ LMST = +11 15 26.5
50+ LAST = +11 15 25.7
51+ Hour Angle = +03 38 26.4 (hh:mm:ss)
52+ Ra, Dec: 07 36 59.3 +15 25 31 (Apparent Coords)
53+ Ra, Dec: 07 36 58.9 +15 25 37 (J2000.0000)
54+ Ra, Dec: 07 36 58.9 +15 25 37 (J2000)
55+ IDL> print, ra, dec
56+ 114.24554 15.427022
2657 """
2758 # Observatory position for `kpno` from here:
2859 # http://idlastro.gsfc.nasa.gov/ftp/pro/astro/observatory.pro
2960 location = EarthLocation (lon = Angle ('-111d36.0m' ),
3061 lat = Angle ('31d57.8m' ),
3162 height = 2120. * u .m )
3263
33- # obstime = Time('2041-12-26 05:00:00')
34- obstime = Time (2466879.7083333 , format = 'jd' )
35- # obstime += TimeDelta(-2, format='sec')
64+ obstime = Time (2451545.0 , format = 'jd' , scale = 'ut1' )
3665
3766 altaz_frame = AltAz (obstime = obstime , location = location ,
3867 temperature = 0 * u .deg_C , pressure = 0.781 * u .bar )
@@ -43,22 +72,19 @@ def test_against_hor2eq():
4372
4473 radec_frame = 'icrs'
4574
46- # The following transformation throws a warning about precision problems
47- # because the observation date is in the future
48- with catch_warnings () as _ :
49- radec_actual = altaz .transform_to (radec_frame )
50- radec_actual_noatm = altaz_noatm .transform_to (radec_frame )
75+ radec_actual = altaz .transform_to (radec_frame )
76+ radec_actual_noatm = altaz_noatm .transform_to (radec_frame )
5177
52- radec_expected = SkyCoord ('00h13m14.1s +15d11m0.3s ' , frame = radec_frame )
78+ radec_expected = SkyCoord ('07h36m55.2s +15d25m08s ' , frame = radec_frame )
5379 distance = radec_actual .separation (radec_expected ).to ('arcsec' )
5480
5581 # this comes from running the example hor2eq but with the pressure set to 0
56- radec_expected_noatm = SkyCoord ('00h13m17.8s +15d11m30s ' , frame = radec_frame )
82+ radec_expected_noatm = SkyCoord ('07h36m58.9s +15d25m37s ' , frame = radec_frame )
5783 distance_noatm = radec_actual_noatm .separation (radec_expected_noatm ).to ('arcsec' )
5884
59- # the baseline difference is ~2.6285 arcsec as of when this was lest updated.
60- # the difference is mainly due to the somewhat different atmospheric model
61- # that hor2eq assumes. This is confirmed by the second test which has the
85+ # The baseline difference is ~2.3 arcsec with one atm of pressure. The
86+ # difference is mainly due to the somewhat different atmospheric model that
87+ # hor2eq assumes. This is confirmed by the second test which has the
6288 # atmosphere "off" - the residual difference is small enough to be embedded
6389 # in the assumptions about "J2000" or rounding errors.
6490 assert distance < 5 * u .arcsec
0 commit comments