LSST Applications  21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
Public Member Functions | Public Attributes | List of all members
lsst.afw.geom.ellipses.EllipseMatplotlibInterface Class Reference

Public Member Functions

def __init__ (self, ellipse, scale=1.0, **kwds)
 
def __getattr__ (self, name)
 
def update (self, show=True, rescale=True)
 

Public Attributes

 scale
 
 patch
 

Detailed Description

An interface for drawing the ellipse using matplotlib.

This is typically initiated by calling Ellipse.plot(), which
returns an instance of this class.

Definition at line 42 of file __init__.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 49 of file __init__.py.

49  def __init__(self, ellipse, scale=1.0, **kwds):
50  import matplotlib.patches
51  import weakref
52  import numpy as np
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 / np.pi,
60  **kwds
61  )
62 

Member Function Documentation

◆ __getattr__()

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

Definition at line 63 of file __init__.py.

63  def __getattr__(self, name):
64  return getattr(self.patch, name)
65 

◆ update()

def lsst.afw.geom.ellipses.EllipseMatplotlibInterface.update (   self,
  show = True,
  rescale = True 
)
Update the matplotlib representation to the current ellipse parameters.

Definition at line 66 of file __init__.py.

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

Member Data Documentation

◆ patch

lsst.afw.geom.ellipses.EllipseMatplotlibInterface.patch

Definition at line 57 of file __init__.py.

◆ scale

lsst.afw.geom.ellipses.EllipseMatplotlibInterface.scale

Definition at line 54 of file __init__.py.


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