def helio_grid(self,event): import MOPcoord,math,ephem (ra,dec)=self.c2p((self.canvasx(event.x),self.canvasy(event.y))) p = MOPcoord.coord((ra,dec)) for i in range(0,360): a=math.radians(i/1.0) t = MOPcoord.coord((a,p.eb),system='ecliptic') self.create_point(t.ra,t.dec,size=1,color='magenta') for i in range(-90,90): b=math.radians(i/1.0) t = MOPcoord.coord((p.el,b),system='ecliptic') self.create_point(t.ra,t.dec,size=1,color='grey')
def __init__(self,root,width=640,height=480,background='white'): import math,time,ephem,MOPcoord import Tkinter self.heliocentric=Tkinter.StringVar() self.heliocentric.set("00:00:00.00 +00:00:00.0") self.equatorial=Tkinter.StringVar() self.equatorial.set("00:00:00.00 +00:00:00.0") self.elongation=Tkinter.StringVar() self.ObjInfo=Tkinter.StringVar() self.elongation.set("0.0") self.SearchVar=Tkinter.StringVar() self.FilterVar=Tkinter.StringVar() self.FilterVar.set("") self.camera=Tkinter.StringVar() self.show_ellipse=Tkinter.IntVar() self.show_ellipse.set(1) self.pointing_format=Tkinter.StringVar() self.pointing_format.set('CFHT PH') self.show_labels=Tkinter.IntVar() self.show_labels.set(1) self.date=Tkinter.StringVar() self.date.set(time.strftime('%Y/%m/%d')) self.plabel=Tkinter.StringVar() self.plabel.set("P0") sun=ephem.Sun() sun.compute(self.date.get()) self.sun=MOPcoord.coord((sun.ra,sun.dec)) self.width=width self.unit=Tkinter.StringVar() self.unit.set('elong') self.height=height Tkinter.Canvas.__init__(self,root,width=width,height=height,background=background) self.tk_focusFollowsMouse()
def reset(self): """Expand to the full scale""" import ephem, MOPcoord sun=ephem.Sun() sun.compute(self.date.get()) self.sun=MOPcoord.coord((sun.ra,sun.dec)) doplot(kbos) self.plot_pointings()
def pos_update(self,event): from math import sin from math import cos import math, MOPcoord s=self.sun (ra,dec)=self.c2p((self.canvasx(event.x),self.canvasy(event.y))) p=MOPcoord.coord((ra,dec)) elong=math.fabs(p.el-s.el) if elong>math.pi: elong=2.0*math.pi-elong p.set_system('ecliptic') self.heliocentric.set(str(p)) p.set_system('ICRS') self.equatorial.set(str(p)) self.elongation.set("%6.2f" % (math.degrees(elong)))