def test_topo_position_vs_pycraf(self): from astropy.coordinates import EarthLocation from astropy import time from pycraf import satellite tle_string = '\n'.join(self.tle_tup) location = EarthLocation.from_geodetic(*self.effbg_tup_m, 'WGS72') sat_obs = satellite.SatelliteObserver(location) dt = datetime.datetime(*self.dt_tup) obstime = time.Time(dt) gmst = obstime.sidereal_time('mean', 'greenwich').rad lmst = gmst + location.lon.rad print(obstime) print(gmst, lmst) az, el, dist = sat_obs.azel_from_sat(tle_string, obstime) az, el, dist = az.value, el.value, dist.value az %= 360. print(az, el, dist) sat = Satellite(self.tle, self.effbg_observer, self.pydt) # sat.mjd = self.mjd # print(sat.pydt) eci_pos = sat.eci_pos() topo_pos = sat.topo_pos() print(eci_pos.pydt) print(eci_pos.pydt.gmst(), eci_pos.pydt.lmst(self.effbg_tup[0])) print(topo_pos.az, topo_pos.el, topo_pos.dist) assert_allclose(topo_pos.az, az, atol=1e-3) assert_allclose(topo_pos.el, el, atol=1e-3) assert_allclose(topo_pos.dist, dist, atol=2e-2)
def lsst_location(): site = Site('LSST') obs_loc_lsst = EarthLocation(lat=site.latitude, lon=site.longitude, height=site.height) sat_obs_lsst = satellite.SatelliteObserver(obs_loc_lsst) return sat_obs_lsst
day = 30 utch = 2 utcm = 22 utcs = 0 print('\n Prediction date: ', year, month, day) print(' Prediction time: ', utch, utcm, utcs, ' UTC') dt = datetime.datetime(year, month, day, utch, utcm, utcs) obstime = time.Time(dt) # define observer location Lambda = 15.0650 Phi = 37.0328 H = 370.0 location = EarthLocation(Lambda, Phi, H) # create a SatelliteObserver instance sat_obs = satellite.SatelliteObserver(location) # az, el, dist = sat_obs.azel_from_sat(tle_string, obstime) print('\n Observer location: Lambda=', Lambda, 'deg Phi=', Phi, 'deg H=', H, ' m') print(' Azimuth : {:.5f}'.format(az)) print(' Elevation: {:.5f}'.format(el)) print(' Distance : {:.3f}'.format(dist)) # EOF azel_TLE.py ---------- ''' Sat Name = Object A (Starlink) Sat Epoch= 2019-05-27 13:22:30.208511 Sat Numb = 44235 Prediction date: 2019 5 30 Prediction time: 2 22 0 UTC