@@ -77,53 +77,53 @@ def test_TLETarget():
7777 # Single time (Below Horizon)
7878 ra_dec1 = tle_target1 .coord (time ) # '08h29m26.00003243s +07d31m36.65950907s'
7979 ra_dec2 = tle_target2 .coord (time )
80+ assert ra_dec1 .to_string ('hmsdms' ) == ra_dec2 .to_string ('hmsdms' )
8081
8182 # Comparison with the JPL Horizons System
8283 ra_dec_horizon_icrf = SkyCoord ("08h29m27.029117s +07d31m28.35610s" )
8384 # ICRF: Compensated for the down-leg light-time delay aberration
84- # ra_dec1.separation(ra_dec_horizon_icrf).to( u.arcsec) # Difference: 17.41″
85- # ~ 2 * tan(17,41/2/3600) * 11801,56 = 57 km
85+ assert ra_dec1 .separation (ra_dec_horizon_icrf ) < 20 * u .arcsec # 17.41″
86+ # Distance estimation: ~ 2 * tan(17,41/2/3600) * 11801,56 = 57 km
8687
8788 ra_dec_horizon_ref_apparent = SkyCoord ("08h30m54.567398s +08d05m32.72764s" )
8889 # Refracted Apparent: In an equatorial coordinate system with all compensations
89- # ra_dec1.separation(ra_dec_horizon_ref_apparent).to( u.arcsec) # Difference: 2424.44″
90+ assert ra_dec1 .separation (ra_dec_horizon_ref_apparent ) > 2000 * u .arcsec # 2424.44″
9091
9192 ra_dec_horizon_icrf_ref_apparent = SkyCoord ("08h29m37.373866s +08d10m14.78811s" )
9293 # ICRF Refracted Apparent: In the ICRF reference frame with all compensations
93- # ra_dec1.separation(ra_dec_horizon_icrf_ref_apparent).to( u.arcsec) # Difference: 2324.28″
94+ assert ra_dec1 .separation (ra_dec_horizon_icrf_ref_apparent ) > 2000 * u .arcsec # 2324.28″
9495
9596 # Skyfield appears to use no compensations. According to this, it's not even recommended to
9697 # compensate for light travel time. Compensating changes the difference to ra_dec_horizon_icrf
9798 # to 20.05 arcsec.
9899 # https://rhodesmill.org/skyfield/earth-satellites.html#avoid-calling-the-observe-method
99100
100- assert ra_dec1 .separation (ra_dec_horizon_icrf ) < 20 * u .arcsec
101- assert ra_dec1 .to_string ('hmsdms' ) == ra_dec2 .to_string ('hmsdms' )
102-
103101 # Single time (Above Horizon)
104102 time_ah = Time ("2023-08-02 07:20" , scale = 'utc' )
105103 ra_dec_ah = tle_target1 .coord (time_ah ) # '11h19m48.53631001s +44d49m45.22194611s'
106104
107- ra_dec_ah_horizon_icrf = SkyCoord ("11h19m49.660349s +44d49m34.65875s" ) # 15.95″
108- ra_dec_ah_horizon_ref_apparent = SkyCoord ("11h21m34.102381s +44d43m40.06899s" ) # 1181.84″
109- ra_dec_ah_horizon_icrf_ref_apparent = SkyCoord ("11h20m16.627261s +44d51m24.25337s" ) # 314.75″
105+ ra_dec_ah_horizon_icrf = SkyCoord ("11h19m49.660349s +44d49m34.65875s" )
106+ assert ra_dec_ah .separation (ra_dec_ah_horizon_icrf ) < 20 * u .arcsec # 15.95″
107+ ra_dec_ah_horizon_ref_apparent = SkyCoord ("11h21m34.102381s +44d43m40.06899s" )
108+ assert ra_dec_ah .separation (ra_dec_ah_horizon_ref_apparent ) > 1000 * u .arcsec # 1181.84″
109+ ra_dec_ah_horizon_icrf_ref_apparent = SkyCoord ("11h20m16.627261s +44d51m24.25337s" )
110+ assert ra_dec_ah .separation (ra_dec_ah_horizon_icrf_ref_apparent ) > 300 * u .arcsec # 314.75″
110111
111112 # Default is WGS72 for Skyfield. Coordinates with WGS84 gravity model that Horizon uses:
112113 # '11h19m48.28084569s +44d49m46.33649241s' - 18.75″
113114 # See 'Build a satellite with a specific gravity model' in Skyfield's Earth Satellites docu
114115
115116 # There are many potential sources of inaccuracies, and it's not all super precise.
116117 # Should the accuracy be better than < 25*u.arcsec when compared to the JPL Horizons System?
117- assert ra_dec_ah .separation (ra_dec_ah_horizon_icrf ) < 20 * u .arcsec
118118
119119 # Multiple times
120120 ra_dec1 = tle_target1 .coord (times )
121121 ra_dec2 = tle_target2 .coord (times )
122- ra_dec_from_horizon = SkyCoord (["08h29m27.029117s +07d31m28.35610s" , # 17.41″
123- "06h25m46.672661s -54d32m16.77533s" , # 22.05″
124- "13h52m08.854291s +04d26m49.56432s" , # 3.20″
125- "09h20m04.872215s -00d51m21.17432s" ]) # 17.55″
126-
122+ ra_dec_from_horizon = SkyCoord (["08h29m27.029117s +07d31m28.35610s" ,
123+ "06h25m46.672661s -54d32m16.77533s" ,
124+ "13h52m08.854291s +04d26m49.56432s" ,
125+ "09h20m04.872215s -00d51m21.17432s" ])
126+ # 17.41″, 22.05″, 3.20″, 17.55″
127127 assert all (list (ra_dec1 .separation (ra_dec_from_horizon ) < 25 * u .arcsec ))
128128 assert ra_dec1 .to_string ('hmsdms' ) == ra_dec2 .to_string ('hmsdms' )
129129
0 commit comments