27def 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)
46 Draw the ellipse (argument size
is ignored). N.b. objects
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))
An ellipse core for the semimajor/semiminor axis and position angle parametrization (a,...
A base class for parametrizations of the "core" of an ellipse - the ellipticity and size.
An ellipse core with quadrupole moments as parameters.
def drawLines(points, ctype=None)
def dot(symb, c, r, size, ctype=None, fontFamily="helvetica", textAngle=None)