27 def dot(symb, c, r, size, ctype=None, fontFamily="helvetica", textAngle=None):
28 """Draw a symbol onto the specified DS9 frame.
44 Draw an ellipse with moments (Mxx, Mxy, Myy) (argument size is ignored)
45 `lsst.afw.geom.ellipses.BaseCore`
46 Draw the ellipse (argument size is ignored). N.b. objects
47 derived from `~lsst.afw.geom.ellipses.BaseCore` include
48 `~lsst.afw.geom.ellipses.Axes` and `~lsst.afw.geom.ellipses.Quadrupole`.
50 Interpreted as a string to be drawn. Strings obey the ``fontFamily``
51 (which may be extended with other characteristics, e.g. "times
52 bold italic". Text will be drawn rotated by ``textAngle``
53 (textAngle is ignored otherwise).
55 Zero-based coordinates at which to draw the symbol
58 the name of the desired color (e.g. 'red', 'orchid')
65 color =
' # color=%s' % ctype
71 if isinstance(symb, afwGeom.ellipses.Axes):
72 regions.append(
'ellipse %g %g %gi %gi %g%s' % (c, r, symb.getA(), symb.getB(),
73 math.degrees(symb.getTheta()), color))
75 regions.append(
'line %g %g %g %g%s' % (c, r+size, c, r-size, color))
76 regions.append(
'line %g %g %g %g%s' % (c-size, r, c+size, r, color))
78 size = size/math.sqrt(2)
79 regions.append(
'line %g %g %g %g%s' %
80 (c+size, r+size, c-size, r-size, color))
81 regions.append(
'line %g %g %g %g%s' %
82 (c-size, r+size, c+size, r-size, color))
85 size60 = 0.5*math.sqrt(3)*size
86 regions.append(
'line %g %g %g %g%s' % (c+size, r, c-size, r, color))
87 regions.append(
'line %g %g %g %g%s' %
88 (c-size30, r+size60, c+size30, r-size60, color))
89 regions.append(
'line %g %g %g %g%s' %
90 (c+size30, r+size60, c-size30, r-size60, color))
92 regions.append(
'circle %g %g %gi%s' % (c, r, size, color))
94 color = re.sub(
"^ # ",
"", color)
97 if textAngle
is not None:
98 angle +=
" textangle=%.1f"%(textAngle)
101 if size != 2
or fontFamily !=
"helvetica":
102 fontFamily = fontFamily.split()
103 font +=
' font="%s %d' % (fontFamily.pop(0),
104 int(10*size/2.0 + 0.5))
107 fontFamily = [
"normal"]
108 font +=
" " +
" ".join(fontFamily)
111 if color
or angle
or font:
117 regions.append(
'text %g %g \"%s\"%s' % (c, r, symb, extra))
123 """Draw a line by connecting the points
127 points : `list` of `tuple` of `float`
130 the name of the desired color (e.g. 'red', 'orchid')
136 color = f
"# color={ctype}"
143 for (c, r)
in points[1:]:
146 regions.append(
'line %g %g %g %g %s' % (c0, r0, c, r, color))
def drawLines(points, ctype=None)
def dot(symb, c, r, size, ctype=None, fontFamily="helvetica", textAngle=None)