def compute(self, cobs, cdate='2013-10-10', ctime='0:0:0'): cat = novas.Cat() cat.catalog = 'FK6' cat.starname = self.name cat.starnumber = 1 cat.ra = self.ra cat.dec = self.dec cat.promora = 0.0 cat.promodec = 0.0 cat.parallax = 0.0 cat.radialvelocity = 0.0 JD, mjd = self.ephem.convert_date(cdate, ctime) tt, deltat, ut1offset = self.ephem.delta_t(JD) jd_tt = JD + tt / 86400 jd_ut1 = JD + ut1offset / 86400. loc = novas.On_surface() # Emmen, The Netherlands loc.latitude = float(cobs.latitude) loc.longitude = float(cobs.longitude) loc.height = float(cobs.altitude) loc.temperature = 10.0 loc.pressure = 1010.0 # AppPlanet returns a tuple (RA (h), Decl (deg), Dist (AU)) # See almanac.py eqeq = self.ephem.eq_of_equinox(jd_tt) #fpath = os.path.split(os.path.realpath(__file__))[0] #fpath = os.path.join(self.ephem.env.get_home_dir()+'/data','JPLEPH') # print "FPATH:", fpath fil = novas.EphemOpen() # TopoPlanet returns a tuple (RA (h), Decl (deg), Dist (AU)) obj_tupapp = novas.AppStar(jd_tt, cat, 0) obj_tuptopo = novas.TopoStar(jd_tt, deltat, cat, loc, 0) gast = novas.SiderealTime(jd_ut1, 0.0, deltat, 1, 1, 0) last = gast + float(cobs.longitude) / 15.0 if (last >= 24.0): last -= 24.0 if (last < 0.0): last += 24.0 #theta = era (jd_ut1,0.0); novas.EphemClose() return JD, deltat, eqeq, obj_tupapp, obj_tuptopo, gast, last
def _compute_GCRS(self, jd): """Compute where satellite is in space on a given date.""" rTEME, vTEME, error = self._position_and_velocity_TEME_km(jd) rTEME /= AU_KM vTEME /= AU_KM vTEME *= DAY_S rITRF, vITRF = TEME_to_ITRF(jd.ut1, rTEME, vTEME) #print "RITRF:", rITRF, rITRF.shape a = rITRF.tolist() print "ITRF" print a rUz = novas.Ter2Cel(jd.ut1, 0.0, jd.delta_t, 1, 0, 1, 0, 0, a[0], a[1], a[2]) #print rUz, len(rUz) print "TER" print rUz stat, ra, dec = novas.Vector2Radec(rUz[1], rUz[2], rUz[3]) print "RE: ITRS" stat, b1, b2, b3 = novas.Cel2Ter(jd.ut1, 0, jd.delta_t, 1, 0, 0, 0, 0, rUz[1], rUz[2], rUz[3]) print b1, b2, b3 #stat, raequ, decequ = novas.GCRS2Equ (jd.tt, 1, 0, ra, dec) #print raequ, decequ # stat, lon, lat = novas.Equ2Ecl (jd.tt, 2, 0, ra, dec) # # print lon, lat 102.7972, 25.0299, 1991.83 loc = novas.On_surface() # Emmen, The Netherlands loc.latitude = 25.0299 loc.longitude = 102.7972 loc.height = 1991.83 loc.temperature = 0.0 loc.pressure = 0 # print novas.Equ2Hor (jd.ut1, jd.delta_t, 0, 0,0, # loc, raequ, decequ, 0) print novas.Vector2Radec(b1, b2, b3) return ra, dec
def compute(self, cobs, cdate='2013-10-10', ctime='0:0:0'): cat = novas.Cat() cat.catalog = 'STAR' cat.starname = self.name cat.starnumber = 1 cat.ra = self.ra cat.dec = self.dec cat.promora = self.promotionra cat.promodec = self.promotiondec cat.parallax = self.parallax cat.radialvelocity = self.radialvelocity JD, mjd = self.ephem.convert_date(cdate, ctime) tt, deltat, ut1offset = self.ephem.delta_t(JD) jd_tt = JD + tt / 86400 jd_ut1 = JD + ut1offset / 86400. loc = novas.On_surface() # Emmen, The Netherlands loc.latitude = float(cobs.latitude) loc.longitude = float(cobs.longitude) loc.height = float(cobs.altitude) loc.temperature = 10.0 loc.pressure = 1010.0 # AppPlanet returns a tuple (RA (h), Decl (deg), Dist (AU)) # See almanac.py eqeq = self.ephem.eq_of_equinox(jd_tt) # TopoPlanet returns a tuple (RA (h), Decl (deg), Dist (AU)) obj_tupapp = novas.AppStar(jd_tt, cat, 0) obj_tuptopo = novas.TopoStar(jd_tt, cat, deltat, loc, 0) gast = novas.SiderealTime(jd_ut1, 0.0, deltat, 1, 1, 0) last = gast + float(cobs.longitude) / 15.0 if (last >= 24.0): last -= 24.0 if (last < 0.0): last += 24.0 #theta = era (jd_ut1,0.0); return JD, deltat, eqeq, obj_tupapp, obj_tuptopo, gast, last
leapsec = novas.GetLeapSec('leapsec.tab', mjd, 0) print 'leapsec:', leapsec cat = novas.Cat() cat.catalog = 'xxx' cat.starname = 'DUMMY' cat.starnumber = 0 cat.ra = 0.0 cat.dec = 0.0 cat.promora = 0.0 cat.promodec = 0.0 cat.parallax = 0.0 cat.radialvelocity = 0.0 loc = novas.On_surface() # Emmen, The Netherlands loc.latitude = 42.0 loc.longitude = -70. loc.height = 0.0 loc.temperature = 10.0 loc.pressure = 1010.0 # Moon moon = novas.Object() moon.type = 0 moon.number = 11 moon.name = "Moon" moon.star = cat #moon.radius = 1737.4
def compute(self, cobs, cdate='2013-10-10', ctime='0:0:0'): try: cat = novas.Cat() cat.catalog = 'xxx' cat.starname = 'DUMMY' cat.starnumber = 0 cat.ra = 0.0 cat.dec = 0.0 cat.promora = 0.0 cat.promodec = 0.0 cat.parallax = 0.0 cat.radialvelocity = 0.0 fil = novas.EphemOpen() JD, mjd = self.ephem.convert_date(cdate, ctime) tt, deltat, ut1offset = self.ephem.delta_t(JD) jd_tt = JD + tt / 86400 jd_ut1 = JD + ut1offset / 86400. loc = novas.On_surface() # Emmen, The Netherlands loc.latitude = float(cobs.latitude) loc.longitude = float(cobs.longitude) loc.height = float(cobs.altitude) loc.temperature = 10.0 loc.pressure = 1010.0 # Sun sun = novas.Object() sun.type = 0 #print 'NAME:', self.name sun.number = planetmember[self.name.lower()] sun.name = self.name.upper() sun.star = cat # AppPlanet returns a tuple (RA (h), Decl (deg), Dist (AU)) # See almanac.py eqeq = self.ephem.eq_of_equinox(jd_tt) #obj_tup = novas.AppPlanet(tjd, sun, 0) #print obj_tup #sha = 360.0 - obj_tup[0] * 15.0 #eadst = (0.0 + obj_tup[2]) # TopoPlanet returns a tuple (RA (h), Decl (deg), Dist (AU)) obj_tupapp = novas.AppPlanet(jd_tt, sun, 0) obj_tuptopo = novas.TopoPlanet(jd_tt, sun, deltat, loc, 0) gast = novas.SiderealTime(jd_ut1, 0.0, deltat, 1, 1, 0) last = gast + float(cobs.longitude) / 15.0 if (last >= 24.0): last -= 24.0 if (last < 0.0): last += 24.0 #theta = era (jd_ut1,0.0); finally: novas.EphemClose() return JD, deltat, eqeq, obj_tupapp, obj_tuptopo, gast, last