LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Public Member Functions | Public Attributes | Private Attributes | List of all members
lsst.afw.geom.ellipses.EllipseMatplotlibInterface Class Reference
Inheritance diagram for lsst.afw.geom.ellipses.EllipseMatplotlibInterface:

Public Member Functions

def __init__
 
def __getattr__
 
def update
 

Public Attributes

 scale
 
 patch
 

Private Attributes

 __ellipse
 

Detailed Description

An interface for drawing the ellipse using matplotlib.

This is typically initiated by calling Ellipse.plot(), which
adds the interface as the matplotlib attribute of the ellipse
object (this can be deleted later if desired).

Definition at line 42 of file __init__.py.

Constructor & Destructor Documentation

def lsst.afw.geom.ellipses.EllipseMatplotlibInterface.__init__ (   self,
  ellipse,
  scale = 1.0,
  kwds 
)

Definition at line 50 of file __init__.py.

50 
51  def __init__(self, ellipse, scale=1.0, **kwds):
52  import matplotlib.patches
53  self.__ellipse = weakref.proxy(ellipse)
54  self.scale = float(scale)
55  core = Axes(self.__ellipse.getCore())
56  core.scale(2.0 * scale)
57  self.patch = matplotlib.patches.Ellipse(
58  (self.__ellipse.getCenter().getX(), self.__ellipse.getCenter().getY()),
59  core.getA(), core.getB(), core.getTheta() * 180.0 / numpy.pi,
60  **kwds
61  )
An ellipse core for the semimajor/semiminor axis and position angle parametrization (a...
Definition: Axes.h:45

Member Function Documentation

def lsst.afw.geom.ellipses.EllipseMatplotlibInterface.__getattr__ (   self,
  name 
)

Definition at line 62 of file __init__.py.

62 
63  def __getattr__(self, name):
64  return getattr(self.patch, name)
def lsst.afw.geom.ellipses.EllipseMatplotlibInterface.update (   self,
  show = True,
  rescale = True 
)
Update the matplotlib representation to the current ellipse parameters.

Definition at line 65 of file __init__.py.

65 
66  def update(self, show=True, rescale=True):
67  """Update the matplotlib representation to the current ellipse parameters.
68  """
69  import matplotlib.patches
70  core = _agl.Axes(self.__ellipse.getCore())
71  core.scale(2.0 * scale)
72  new_patch = matplotlib.patches.Ellipse(
73  (self.__ellipse.getCenter().getX(), self.__ellipse.getCenter().getY()),
74  core.a, core.b, core.theta * 180.0 / numpy.pi
75  )
76  new_patch.update_from(self.patch)
77  axes = self.patch.get_axes()
78  if axes is not None:
79  self.patch.remove()
80  axes.add_patch(new_patch)
81  self.patch = new_patch
82  if axes is not None:
83  if rescale: axes.autoscale_view()
84  if show: axes.figure.canvas.draw()

Member Data Documentation

lsst.afw.geom.ellipses.EllipseMatplotlibInterface.__ellipse
private

Definition at line 52 of file __init__.py.

lsst.afw.geom.ellipses.EllipseMatplotlibInterface.patch

Definition at line 56 of file __init__.py.

lsst.afw.geom.ellipses.EllipseMatplotlibInterface.scale

Definition at line 53 of file __init__.py.


The documentation for this class was generated from the following file: