33 def dot(symb, c, r, size, ctype=None, fontFamily="helvetica", textAngle=None):
34 """Draw a symbol onto the specified DS9 frame at (col,row) = (c,r) [0-based coordinates]
40 @:Mxx,Mxy,Myy Draw an ellipse with moments (Mxx, Mxy, Myy) (argument size is ignored)
41 An object derived from afwGeom.ellipses.BaseCore Draw the ellipse (argument size is ignored)
42 Any other value is interpreted as a string to be drawn. Strings obey the fontFamily (which may be extended
43 with other characteristics, e.g. "times bold italic". Text will be drawn rotated by textAngle (textAngle is
46 N.b. objects derived from BaseCore include Axes and Quadrupole.
51 color =
' # color=%s' % ctype
57 if isinstance(symb, afwGeom.ellipses.Axes):
58 regions.append(
'ellipse %g %g %gi %gi %g%s' % (c, r, symb.getA(), symb.getB(),
59 math.degrees(symb.getTheta()), color))
61 regions.append(
'line %g %g %g %g%s' % (c, r+size, c, r-size, color))
62 regions.append(
'line %g %g %g %g%s' % (c-size, r, c+size, r, color))
64 size = size/math.sqrt(2)
65 regions.append(
'line %g %g %g %g%s' % (c+size, r+size, c-size, r-size, color))
66 regions.append(
'line %g %g %g %g%s' % (c-size, r+size, c+size, r-size, color))
69 size60 = 0.5*math.sqrt(3)*size
70 regions.append(
'line %g %g %g %g%s' % (c+size, r, c-size, r, color))
71 regions.append(
'line %g %g %g %g%s' % (c-size30, r+size60, c+size30, r-size60, color))
72 regions.append(
'line %g %g %g %g%s' % (c+size30, r+size60, c-size30, r-size60, color))
74 regions.append(
'circle %g %g %gi%s' % (c, r, size, color))
76 color = re.sub(
"^ # ",
"", color)
79 if textAngle
is not None:
80 angle +=
" textangle=%.1f"%(textAngle)
83 if size != 2
or fontFamily !=
"helvetica":
84 fontFamily = fontFamily.split()
85 font +=
' font="%s %d' % (fontFamily.pop(0), int(10*size/2.0 + 0.5))
87 fontFamily = [
"normal"]
88 font +=
" %s" %
" ".join(fontFamily)
91 if color
or angle
or font:
97 regions.append(
'text %g %g \"%s\"%s' % (c, r, symb, extra))
102 """!Draw a line by connecting the points
103 \param points a list of (col,row)
104 \param ctype the name of the desired colour (e.g. 'red', 'orchid')
110 color =
"# color=%s" % ctype
117 for (c, r)
in points[1:]:
120 regions.append(
'line %g %g %g %g %s' % (c0, r0, c, r, color))
def drawLines
Draw a line by connecting the points.