28 def dot(symb, c, r, size, ctype=None, fontFamily="helvetica", textAngle=None):
29 """Draw a symbol onto the specified DS9 frame.
45 Draw an ellipse with moments (Mxx, Mxy, Myy) (argument size is ignored)
46 `lsst.afw.geom.ellipses.BaseCore`
47 Draw the ellipse (argument size is ignored). N.b. objects
48 derived from `~lsst.afw.geom.ellipses.BaseCore` include
49 `~lsst.afw.geom.ellipses.Axes` and `~lsst.afw.geom.ellipses.Quadrupole`.
51 Interpreted as a string to be drawn. Strings obey the ``fontFamily``
52 (which may be extended with other characteristics, e.g. "times
53 bold italic". Text will be drawn rotated by ``textAngle``
54 (textAngle is ignored otherwise).
56 Zero-based coordinates at which to draw the symbol
59 the name of the desired color (e.g. 'red', 'orchid')
66 color =
' # color=%s' % ctype
72 if isinstance(symb, afwGeom.ellipses.Axes):
73 regions.append(
'ellipse %g %g %gi %gi %g%s' % (c, r, symb.getA(), symb.getB(),
74 math.degrees(symb.getTheta()), color))
76 regions.append(
'line %g %g %g %g%s' % (c, r+size, c, r-size, color))
77 regions.append(
'line %g %g %g %g%s' % (c-size, r, c+size, r, color))
79 size = size/math.sqrt(2)
80 regions.append(
'line %g %g %g %g%s' %
81 (c+size, r+size, c-size, r-size, color))
82 regions.append(
'line %g %g %g %g%s' %
83 (c-size, r+size, c+size, r-size, color))
86 size60 = 0.5*math.sqrt(3)*size
87 regions.append(
'line %g %g %g %g%s' % (c+size, r, c-size, r, color))
88 regions.append(
'line %g %g %g %g%s' %
89 (c-size30, r+size60, c+size30, r-size60, color))
90 regions.append(
'line %g %g %g %g%s' %
91 (c+size30, r+size60, c-size30, r-size60, color))
93 regions.append(
'circle %g %g %gi%s' % (c, r, size, color))
95 color = re.sub(
"^ # ",
"", color)
98 if textAngle
is not None:
99 angle +=
" textangle=%.1f"%(textAngle)
102 if size != 2
or fontFamily !=
"helvetica":
103 fontFamily = fontFamily.split()
104 font +=
' font="%s %d' % (fontFamily.pop(0),
105 int(10*size/2.0 + 0.5))
108 fontFamily = [
"normal"]
109 font +=
" " +
" ".join(fontFamily)
112 if color
or angle
or font:
118 regions.append(
'text %g %g \"%s\"%s' % (c, r, symb, extra))
124 """Draw a line by connecting the points
128 points : `list` of `tuple` of `float`
131 the name of the desired color (e.g. 'red', 'orchid')
137 color = f
"# color={ctype}"
144 for (c, r)
in points[1:]:
147 regions.append(
'line %g %g %g %g %s' % (c0, r0, c, r, color))