def cal_sun_loc(self): sun=Sun() sun.cal(self.days_0) self.planets['Sun']=sun
if __name__ == '__main__': import time from sun import Sun from moon import Moon tm = time.localtime() yx = tm.tm_year mx = tm.tm_mon dx = tm.tm_mday dxd = tm.tm_hour / 24.0 + tm.tm_min / (24.0 * 60) + tm.tm_sec / (24.0 * 60 * 60) d = 367 * yx - 7 * (yx + (mx + 9) / 12) / 4 + 275 * mx / 9 + dx - 730530 + dxd sun = Sun() sun.cal(d) print('Sun:') print('Ra:', sun.RA) print('Dec:', sun.Dec) print('lon:', sun.lon) for pn in [ Mercury(), Venus(), Mars(), Jupiter(), Saturn(), Uranus(), Neptune(), Pluto(), Moon()