Пример #1
0
 def __init__(self,
              x1,
              y1,
              x2,
              y2,
              color='green',
              color2='yellow',
              alpha=1.0,
              linewidth=1,
              linestyle='solid',
              showcap=True,
              showplumb=True,
              units='arcmin',
              font='Sans Serif',
              fontsize=None,
              **kwdargs):
     self.kind = 'ruler'
     CanvasObjectBase.__init__(self,
                               color=color,
                               color2=color2,
                               alpha=alpha,
                               units=units,
                               showplumb=showplumb,
                               linewidth=linewidth,
                               showcap=showcap,
                               linestyle=linestyle,
                               x1=x1,
                               y1=y1,
                               x2=x2,
                               y2=y2,
                               font=font,
                               fontsize=fontsize,
                               **kwdargs)
     TwoPointMixin.__init__(self)
Пример #2
0
 def __init__(self,
              x,
              y,
              radius,
              color='skyblue',
              linewidth=1,
              fontsize=None,
              font='Sans Serif',
              alpha=1.0,
              linestyle='solid',
              showcap=True,
              **kwdargs):
     self.kind = 'compass'
     CanvasObjectBase.__init__(self,
                               color=color,
                               alpha=alpha,
                               linewidth=linewidth,
                               showcap=showcap,
                               linestyle=linestyle,
                               x=x,
                               y=y,
                               radius=radius,
                               font=font,
                               fontsize=fontsize,
                               **kwdargs)
     OnePointOneRadiusMixin.__init__(self)
Пример #3
0
 def __init__(self,
              x1,
              y1,
              x2,
              y2,
              color='green',
              color2='yellow',
              alpha=1.0,
              linewidth=1,
              linestyle='solid',
              showcap=True,
              showplumb=True,
              units='arcmin',
              font='Sans Serif',
              fontsize=None,
              **kwdargs):
     self.kind = 'ruler'
     points = np.asarray([(x1, y1), (x2, y2)], dtype=np.float)
     CanvasObjectBase.__init__(self,
                               color=color,
                               color2=color2,
                               alpha=alpha,
                               units=units,
                               showplumb=showplumb,
                               linewidth=linewidth,
                               showcap=showcap,
                               linestyle=linestyle,
                               points=points,
                               font=font,
                               fontsize=fontsize,
                               **kwdargs)
     TwoPointMixin.__init__(self)
Пример #4
0
 def __init__(self,
              x,
              y,
              radius,
              ctype='wcs',
              color='skyblue',
              linewidth=1,
              fontsize=None,
              font='Sans Serif',
              alpha=1.0,
              linestyle='solid',
              showcap=True,
              **kwdargs):
     self.kind = 'compass'
     points = np.asarray([(x, y)], dtype=np.float)
     CanvasObjectBase.__init__(self,
                               ctype=ctype,
                               color=color,
                               alpha=alpha,
                               linewidth=linewidth,
                               showcap=showcap,
                               linestyle=linestyle,
                               points=points,
                               radius=radius,
                               font=font,
                               fontsize=fontsize,
                               **kwdargs)
     OnePointOneRadiusMixin.__init__(self)
Пример #5
0
 def __init__(self,
              x,
              y,
              color='green',
              linewidth=1,
              alpha=1.0,
              linestyle='solid',
              text=None,
              textcolor='yellow',
              fontsize=None,
              font='Sans Serif',
              format='xy',
              **kwdargs):
     self.kind = 'crosshair'
     points = np.asarray([(x, y)], dtype=np.float)
     CanvasObjectBase.__init__(self,
                               color=color,
                               alpha=alpha,
                               linewidth=linewidth,
                               linestyle=linestyle,
                               text=text,
                               textcolor=textcolor,
                               fontsize=fontsize,
                               font=font,
                               points=points,
                               format=format,
                               **kwdargs)
     OnePointMixin.__init__(self)
Пример #6
0
    def __init__(self, x, y, radius, width=None,
                 atype='circle', color='yellow',
                 linewidth=1, linestyle='solid', alpha=1.0,
                 **kwdargs):

        if width is None:
            width = 0.15 * radius
        oradius = radius + width

        if oradius < radius:
            raise ValueError('Outer boundary < inner boundary')

        CanvasObjectBase.__init__(self, x=x, y=y, radius=radius,
                                  width=width, color=color,
                                  linewidth=linewidth, linestyle=linestyle,
                                  alpha=alpha, **kwdargs)

        klass = get_canvas_type(atype)
        obj1 = klass(x, y, radius, color=color,
                     linewidth=linewidth,
                     linestyle=linestyle, alpha=alpha)
        obj1.editable = False

        obj2 = klass(x, y, oradius, color=color,
                     linewidth=linewidth,
                     linestyle=linestyle, alpha=alpha)
        obj2.editable = False

        CompoundObject.__init__(self, obj1, obj2)
        OnePointOneRadiusMixin.__init__(self)

        self.editable = True
        self.opaque = True
        self.kind = 'annulus'
Пример #7
0
 def __init__(self,
              x,
              y,
              color='green',
              linewidth=1,
              alpha=1.0,
              linestyle='solid',
              text=None,
              textcolor='yellow',
              fontsize=None,
              font='Sans Serif',
              format='xy',
              **kwdargs):
     self.kind = 'crosshair'
     CanvasObjectBase.__init__(self,
                               color=color,
                               alpha=alpha,
                               linewidth=linewidth,
                               linestyle=linestyle,
                               text=text,
                               textcolor=textcolor,
                               fontsize=fontsize,
                               font=font,
                               x=x,
                               y=y,
                               format=format,
                               **kwdargs)
Пример #8
0
    def __init__(self, *objects):
        CanvasObjectBase.__init__(self)
        CompoundMixin.__init__(self)
        self.objects = list(objects)
        self.logger = get_logger('foo', log_stderr=True, level=10)

        self.kind = 'compound'
        self.editable = False
Пример #9
0
    def __init__(self, *objects):
        CanvasObjectBase.__init__(self)
        CompoundMixin.__init__(self)
        self.objects = list(objects)
        self.logger = get_logger('foo', log_stderr=True, level=10)

        self.kind = 'compound'
        self.editable = False
Пример #10
0
    def __init__(self, *objects, **kwdargs):
        CanvasObjectBase.__init__(self, **kwdargs)
        CompoundMixin.__init__(self)
        self.objects = list(objects)
        self.logger = get_logger("foo", log_stderr=True, level=10)

        self.kind = "compound"
        self.editable = False
Пример #11
0
    def __init__(self,
                 x,
                 y,
                 radius,
                 width=None,
                 atype='circle',
                 color='yellow',
                 linewidth=1,
                 linestyle='solid',
                 alpha=1.0,
                 **kwdargs):

        if width is None:
            width = 0.15 * radius
        oradius = radius + width

        if oradius < radius:
            raise ValueError('Outer boundary < inner boundary')

        CanvasObjectBase.__init__(self,
                                  x=x,
                                  y=y,
                                  radius=radius,
                                  width=width,
                                  color=color,
                                  linewidth=linewidth,
                                  linestyle=linestyle,
                                  alpha=alpha,
                                  **kwdargs)

        klass = get_canvas_type(atype)
        obj1 = klass(x,
                     y,
                     radius,
                     color=color,
                     linewidth=linewidth,
                     linestyle=linestyle,
                     alpha=alpha)
        obj1.editable = False

        obj2 = klass(x,
                     y,
                     oradius,
                     color=color,
                     linewidth=linewidth,
                     linestyle=linestyle,
                     alpha=alpha)
        obj2.editable = False

        CompoundObject.__init__(self, obj1, obj2)
        OnePointOneRadiusMixin.__init__(self)

        self.editable = True
        self.opaque = True
        self.kind = 'annulus'
Пример #12
0
 def __init__(self, x, y, radius, color='skyblue',
              linewidth=1, fontsize=None, font='Sans Serif',
              alpha=1.0, linestyle='solid', showcap=True, **kwdargs):
     self.kind = 'compass'
     CanvasObjectBase.__init__(self, color=color, alpha=alpha,
                               linewidth=linewidth, showcap=showcap,
                               linestyle=linestyle,
                               x=x, y=y, radius=radius,
                               font=font, fontsize=fontsize,
                               **kwdargs)
     OnePointOneRadiusMixin.__init__(self)
Пример #13
0
 def __init__(self, x, y, color='green',
              linewidth=1, alpha=1.0, linestyle='solid',
              text=None, textcolor='yellow',
              fontsize=None, font='Sans Serif', format='xy',
              **kwdargs):
     self.kind = 'crosshair'
     CanvasObjectBase.__init__(self, color=color, alpha=alpha,
                               linewidth=linewidth, linestyle=linestyle,
                               text=text, textcolor=textcolor,
                               fontsize=fontsize, font=font,
                               x=x, y=y, format=format, **kwdargs)
Пример #14
0
 def __init__(self, x, y, radius, ctype='wcs', color='skyblue',
              linewidth=1, fontsize=None, font='Sans Serif',
              alpha=1.0, linestyle='solid', showcap=True, **kwdargs):
     self.kind = 'compass'
     points = np.asarray([(x, y)], dtype=np.float)
     CanvasObjectBase.__init__(self, ctype=ctype, color=color, alpha=alpha,
                               linewidth=linewidth, showcap=showcap,
                               linestyle=linestyle,
                               points=points, radius=radius,
                               font=font, fontsize=fontsize,
                               **kwdargs)
     OnePointOneRadiusMixin.__init__(self)
Пример #15
0
 def __init__(self, x, y, color='green',
              linewidth=1, alpha=1.0, linestyle='solid',
              text=None, textcolor='yellow',
              fontsize=None, font='Sans Serif', format='xy',
              **kwdargs):
     self.kind = 'crosshair'
     points = np.asarray([(x, y)], dtype=np.float)
     CanvasObjectBase.__init__(self, color=color, alpha=alpha,
                               linewidth=linewidth, linestyle=linestyle,
                               text=text, textcolor=textcolor,
                               fontsize=fontsize, font=font,
                               points=points, format=format, **kwdargs)
     OnePointMixin.__init__(self)
Пример #16
0
 def __init__(self, x1, y1, x2, y2, color='green', color2='yellow',
              alpha=1.0, linewidth=1, linestyle='solid',
              showcap=True, showplumb=True, units='arcmin',
              font='Sans Serif', fontsize=None, **kwdargs):
     self.kind = 'ruler'
     CanvasObjectBase.__init__(self, color=color, color2=color2,
                               alpha=alpha, units=units,
                               showplumb=showplumb,
                               linewidth=linewidth, showcap=showcap,
                               linestyle=linestyle,
                               x1=x1, y1=y1, x2=x2, y2=y2,
                               font=font, fontsize=fontsize,
                               **kwdargs)
     TwoPointMixin.__init__(self)
Пример #17
0
 def __init__(self, x1, y1, x2, y2, color='green', color2='skyblue',
              alpha=1.0, linewidth=1, linestyle='solid',
              showcap=True, showplumb=True, showends=False, units='arcmin',
              font='Sans Serif', fontsize=None, **kwdargs):
     self.kind = 'ruler'
     points = np.asarray([(x1, y1), (x2, y2)], dtype=np.float)
     CanvasObjectBase.__init__(self, color=color, color2=color2,
                               alpha=alpha, units=units,
                               showplumb=showplumb, showends=showends,
                               linewidth=linewidth, showcap=showcap,
                               linestyle=linestyle, points=points,
                               font=font, fontsize=fontsize,
                               **kwdargs)
     TwoPointMixin.__init__(self)
Пример #18
0
    def __init__(self,
                 x,
                 y,
                 image,
                 alpha=1.0,
                 scale_x=1.0,
                 scale_y=1.0,
                 interpolation='basic',
                 linewidth=0,
                 linestyle='solid',
                 color='lightgreen',
                 showcap=False,
                 flipy=False,
                 optimize=True,
                 **kwdargs):
        self.kind = 'image'
        CanvasObjectBase.__init__(self,
                                  x=x,
                                  y=y,
                                  image=image,
                                  alpha=alpha,
                                  scale_x=scale_x,
                                  scale_y=scale_y,
                                  interpolation=interpolation,
                                  linewidth=linewidth,
                                  linestyle=linestyle,
                                  color=color,
                                  showcap=showcap,
                                  flipy=flipy,
                                  optimize=optimize,
                                  **kwdargs)
        OnePointMixin.__init__(self)

        # The cache holds intermediate step results by viewer.
        # Depending on value of `whence` they may not need to be recomputed.
        self._cache = {}
        self._zorder = 0
        # images are not editable by default
        self.editable = False

        self.enable_callback('image-set')
Пример #19
0
    def __init__(self, x, y, image, alpha=1.0, scale_x=1.0, scale_y=1.0,
                 interpolation='basic',
                 linewidth=0, linestyle='solid', color='lightgreen',
                 showcap=False, flipy=False, optimize=True,
                 **kwdargs):
        self.kind = 'image'
        CanvasObjectBase.__init__(self, x=x, y=y, image=image, alpha=alpha,
                                  scale_x=scale_x, scale_y=scale_y,
                                  interpolation=interpolation,
                                  linewidth=linewidth, linestyle=linestyle,
                                  color=color, showcap=showcap,
                                  flipy=flipy, optimize=optimize,
                                  **kwdargs)
        OnePointMixin.__init__(self)

        # The cache holds intermediate step results by viewer.
        # Depending on value of `whence` they may not need to be recomputed.
        self._cache = {}
        self._zorder = 0
        # images are not editable by default
        self.editable = False

        self.enable_callback('image-set')