import ephem ceres = "1 Ceres,e,10.5935,80.3099,73.1153,2.767046,0.2141309,0.07553468,352.2305,03/23.0/2018,2000,H 3.34,0.12" gatech = ephem.Observer() gatech.epoch = ephem.B1950 gatech.lon = '149.066111' gatech.lat = '-31.2768056' gatech.pressure = 0 date = ephem.Date(35614.18378677219) # print (date) date2 = date + 2415020 print(date2) gatech.date = date gatech.date -= ephem.delta_t() * ephem.second test = ephem.readdb(ceres) test.compute(gatech) print(test.a_ra, test.a_dec)
#!/usr/bin/python import ephem e = ephem.Observer() e.date = '2013/01/01 00:00:00' moon = ephem.Moon() moon.compute(e) print moon.ra, moon.dec e.date -= ephem.delta_t(e.date) * ephem.second print e moon.compute(e) print moon.ra, moon.dec die moon, e = ephem.Moon(), ephem.Observer() e.date = '2013/01/01 00:00:00' moon.compute(e) print moon.a_ra / ephem.degree, moon.a_dec / ephem.degree # print ephem.delta_t()*ephem.second # quit # e = ephem.Observer(); # print e.next_rising(ephem.Saturn());
j.compute('1986/2/8') print j.ra, j.dec j.compute('1986/2/9', epoch='1950') print j.a_ra, j.a_dec gatech = ephem.Observer() gatech.lon = '-84.39733' gatech.lat = '33.775867' gatech.elevation = 320 gatech.date = '1984/5/30 16:22:56' v = ephem.Venus(gatech) print v.alt, v.az m = ephem.Moon('1980/6/1') print ephem.constellation(m) print ephem.delta_t('1980') ephem.julian_date('2000/1/1') print ephem.previous_new_moon(ephem.now()) print ephem.next_new_moon(ephem.now()) # localtime print ephem.localtime(ephem.next_new_moon(ephem.now())) print ephem.previous_full_moon(ephem.now()) print ephem.next_full_moon(ephem.now()) # localtime print ephem.localtime(ephem.next_full_moon(ephem.now())) rigel = ephem.star('Rigel') print rigel._ra, rigel._dec
date_obs_UT_sec = float( date_obs.second) + float('0.' + "%06i" % date_obs.microsecond) #### Sidereal time #### song_site = ephem.Observer() song_site.lat = m_conf.lat_obs song_site.long = m_conf.lon_obs song_site.elev = m_conf.elev_obs song_site.date = midtime_UT sidereal_time = song_site.sidereal_time() ############ Barycentric time ############# # The BJD-2400000 for the midtime of the exposure. # The barycentric velocity correction for the midtime of the exposure. (km/s) leap_s = ephem.delta_t("%i/%i/%i" % (date_obs.year, date_obs.month, date_obs.day)) # try: # BJD, BVC = barcor_song_mfa.getbar_song2(epoch, ra_h, ra_m, ra_s, dec_d, dec_arcm, dec_arcs, site_lon, site_lat, site_elev, int(date_obs.year), int(date_obs.month), int(date_obs.day), int(date_obs.hour), int(date_obs.minute), float(date_obs_UT_sec), float(exptime), float(leap_s), 1,1 ) # except Exception, e: # print e # BJD = 0 # BVC = 0 ############################### Here values for object, Sun and Moon is calculated #################################### moon_handle = song_star_checker.moon_pos(site=site_value) sun_handle = song_star_checker.sun_pos(site=site_value) star_handle = song_star_checker.star_pos(site=site_value) moon_alt = moon_handle.moon_alt() moon_az = moon_handle.moon_az()
#!/usr/bin/python import ephem; e = ephem.Observer(); e.date = '2013/01/01 00:00:00'; moon = ephem.Moon(); moon.compute(e); print moon.ra, moon.dec e.date -= ephem.delta_t(e.date) * ephem.second print e moon.compute(e); print moon.ra, moon.dec die moon, e = ephem.Moon(), ephem.Observer() e.date = '2013/01/01 00:00:00' moon.compute(e) print moon.a_ra / ephem.degree, moon.a_dec / ephem.degree # print ephem.delta_t()*ephem.second # quit # e = ephem.Observer();
month = str(t.gmtime().tm_mon) day = str(t.gmtime().tm_mday) date_str = year + "/" + month + "/" + day hour = str(t.gmtime().tm_hour) min = str(t.gmtime().tm_min) sec = str(t.gmtime().tm_sec) time_str = hour + ":" + min + ":" + sec print "Date Time now = %s" % date_str + " " + time_str import ephem d = ephem.Date(date_str + " " + time_str) print "Ephem Date Time now = %s" % d #~ print "Ephem Seconds now:", d.tuple()[5] print "Ephem Julian Date now = %f" % ephem.julian_date() print "Delta t now = %f" % ephem.delta_t() gm = ephem.Observer() gm.lon = '0.0' print "GA Sidereal Time now = %s" % gm.sidereal_time() print "%f" % (gm.sidereal_time() * 180.0 / ephem.pi) here = ephem.Observer() here.lon = '-88.7431' print "LA Sidereal Time now = %s" % here.sidereal_time() print "%f" % (here.sidereal_time() * 180.0 / ephem.pi) here.lat = '41.9475' here.elevation = 278 sid_time_dif = (gm.sidereal_time() - here.sidereal_time()) * 180.0 / ephem.pi print sid_time_dif / 15.0 here.compute_pressure()