예제 #1
0
    def plot_star(self, obj, image=None):
        if not image:
            image = self.fitsimage.get_image()
        x, y = image.radectopix(obj['ra_deg'], obj['dec_deg'])
        #print "STAR at %d,%d" % (x, y)
        # TODO: auto-pick a decent radius
        radius = 10
        color = self.table.get_color(obj)
        #print "color is %s" % str(color)
        circle = CanvasTypes.Circle(x, y, radius, color=color)
        point = CanvasTypes.Point(x, y, radius, color=color)
        ## What is this from?
        if obj.has_key('pick'):
            # Some objects returned from the Gen2 star catalog are marked
            # with the attribute 'pick'.  If present then we show the
            # star with or without the cross, otherwise we always show the
            # cross
            if not obj['pick']:
                star = CanvasTypes.Canvas(circle, point)
            else:
                star = CanvasTypes.Canvas(circle)
        else:
            star = CanvasTypes.Canvas(circle, point)
        star.set_data(star=obj)
        obj.canvobj = star

        self.canvas.add(star, tagpfx='star', redraw=False)
예제 #2
0
    def highlight_object(self, obj, tag, color, redraw=True):
        x = obj.objects[0].x
        y = obj.objects[0].y
        delta = 10
        radius = obj.objects[0].radius + delta

        hilite = CanvasTypes.Circle(x, y, radius, linewidth=4, color=color)
        obj.add(hilite, tag=tag, redraw=redraw)