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 Member Functions | List of all members
lsst.afw.display.virtualDevice.DisplayImpl Class Reference
Inheritance diagram for lsst.afw.display.virtualDevice.DisplayImpl:

Public Member Functions

def __init__
 Initialise the display. More...
 
def __del__
 

Public Attributes

 display
 
 verbose
 

Private Member Functions

def _close
 Close the display, cleaning up any allocated resources. More...
 
def _buffer
 Enable or disable buffering of writes to the display. More...
 
def _dot
 Draw symbol a symbol at (c, r) More...
 
def _drawLines
 Draw line defined by the list points. More...
 
def _erase
 Erase all glyphs drawn on display. More...
 
def _flush
 Flush any I/O buffers. More...
 
def _setCallback
 
def _getEvent
 
def _getMaskTransparency
 
def _mtv
 
def _setMaskTransparency
 
def _scale
 
def _show
 
def _pan
 
def _zoom
 

Detailed Description

Definition at line 27 of file virtualDevice.py.

Constructor & Destructor Documentation

def lsst.afw.display.virtualDevice.DisplayImpl.__init__ (   self,
  display,
  verbose = False 
)

Initialise the display.

Parameters
displayThe display object that we're providing the implementation for
framean identifier for this display
verbosebe chatty?

Definition at line 28 of file virtualDevice.py.

28 
29  def __init__(self, display, verbose=False):
30  """! Initialise the display
31  \param display The display object that we're providing the implementation for
32  \param frame an identifier for this display
33  \param verbose be chatty?
34  """
35  self.display = display
36  self.verbose = verbose
def __init__
Initialise the display.
def lsst.afw.display.virtualDevice.DisplayImpl.__del__ (   self)

Definition at line 37 of file virtualDevice.py.

37 
38  def __del__(self):
39  self._close()
def _close
Close the display, cleaning up any allocated resources.

Member Function Documentation

def lsst.afw.display.virtualDevice.DisplayImpl._buffer (   self,
  enable = True 
)
private

Enable or disable buffering of writes to the display.

Parameters
enableTrue or False, as appropriate

Definition at line 45 of file virtualDevice.py.

45 
46  def _buffer(self, enable=True):
47  """!Enable or disable buffering of writes to the display
48  \param enable True or False, as appropriate
49  """
50  if self.verbose:
51  print "virtual[%s]._buffer(%s)" % (self.display.frame, enable)
def _buffer
Enable or disable buffering of writes to the display.
def lsst.afw.display.virtualDevice.DisplayImpl._close (   self)
private

Close the display, cleaning up any allocated resources.

Definition at line 40 of file virtualDevice.py.

40 
41  def _close(self):
42  """!Close the display, cleaning up any allocated resources"""
43  if self.verbose:
44  print "virtual[%s]._close()" % (self.display.frame)
def _close
Close the display, cleaning up any allocated resources.
def lsst.afw.display.virtualDevice.DisplayImpl._dot (   self,
  symb,
  c,
  r,
  size,
  ctype,
  args,
  kwargs 
)
private

Draw symbol a symbol at (c, r)

Parameters
symbThe desired symbol. See dot() for details
c(x) column position
r(y) row position
sizeSize of symbol, in pixels
ctypeThe desired colour, either e.g. afw.display.RED or a colour name known to X11

Definition at line 52 of file virtualDevice.py.

52 
53  def _dot(self, symb, c, r, size, ctype, *args, **kwargs):
54  """!Draw symbol a symbol at (c, r)
55  \param symb The desired symbol. See dot() for details
56  \param c (x) column position
57  \param r (y) row position
58  \param size Size of symbol, in pixels
59  \param ctype The desired colour, either e.g. afw.display.RED or a colour name known to X11
60  """
61  if self.verbose:
62  print "virtual[%s]._dot('%s', %.2f, %.2f, size=%g, ctype=%s, %s, %s)" % \
63  (self.display.frame, symb, c, r, size, ctype, args, kwargs)
def _dot
Draw symbol a symbol at (c, r)
def lsst.afw.display.virtualDevice.DisplayImpl._drawLines (   self,
  points,
  ctype 
)
private

Draw line defined by the list points.

Parameters
symbA list of 0-indexed positions (x, y)
ctypeThe desired colour, either e.g. afw.display.RED or a colour name known to X11

Definition at line 64 of file virtualDevice.py.

64 
65  def _drawLines(self, points, ctype):
66  """!Draw line defined by the list points
67  \param symb A list of 0-indexed positions (x, y)
68  \param ctype The desired colour, either e.g. afw.display.RED or a colour name known to X11
69  """
70  if self.verbose:
71  print "virtual[%s]._drawLines(%s, ctype=%s)" % (self.display.frame, points, ctype)
def _drawLines
Draw line defined by the list points.
def lsst.afw.display.virtualDevice.DisplayImpl._erase (   self)
private

Erase all glyphs drawn on display.

Definition at line 72 of file virtualDevice.py.

72 
73  def _erase(self):
74  """!Erase all glyphs drawn on display
75  """
76  if self.verbose:
77  print "virtual[%s]._erase()" % (self.display.frame)
def _erase
Erase all glyphs drawn on display.
def lsst.afw.display.virtualDevice.DisplayImpl._flush (   self)
private

Flush any I/O buffers.

Definition at line 78 of file virtualDevice.py.

78 
79  def _flush(self):
80  """!Flush any I/O buffers
81  """
82  if self.verbose:
83  print "virtual[%s]._flush()" % self.display.frame
def lsst.afw.display.virtualDevice.DisplayImpl._getEvent (   self)
private
Return an event generated by a keypress or mouse click

Definition at line 88 of file virtualDevice.py.

88 
89  def _getEvent(self):
90  """Return an event generated by a keypress or mouse click
91  """
92  from interface import Event
93  ev = Event("q")
94 
95  if self.verbose:
96  print "virtual[%s]._getEvent() -> %s" % (self.display.frame, ev)
97 
98  return ev
A class to handle events such as key presses in image display windows.
Definition: interface.py:577
def lsst.afw.display.virtualDevice.DisplayImpl._getMaskTransparency (   self)
private
Return the mask transparency for a display

Definition at line 99 of file virtualDevice.py.

99 
100  def _getMaskTransparency(self):
101  """Return the mask transparency for a display
102  """
103  if self.verbose:
104  print "virtual[%s]._getMaskTransparency()" % self.display.frame
def lsst.afw.display.virtualDevice.DisplayImpl._mtv (   self,
  image,
  wcs = None,
  mask = None,
  title = "" 
)
private
Display an image and maybe a mask overlay on a display
\param image afwImage.Image to display
\param mask afwImage.Mask to display
\param wcs A Wcs to associate with data
\param title Name to display with the data

Definition at line 105 of file virtualDevice.py.

106  def _mtv(self, image, wcs=None, mask=None, title=""):
107  """Display an image and maybe a mask overlay on a display
108  \param image afwImage.Image to display
109  \param mask afwImage.Mask to display
110  \param wcs A Wcs to associate with data
111  \param title Name to display with the data
112  """
113  if self.verbose:
114  print "virtual[%s]._mtv(image=%s, mask=%s, wcs=%s, title=\"%s\")" % \
115  (self.display.frame, "Image" if image else None,
116  "Mask" if mask else None, "Wcs" if wcs else None, title)
def lsst.afw.display.virtualDevice.DisplayImpl._pan (   self,
  r,
  c 
)
private
Pan to (colc, rowc)
\param c Desired column (x) position
\param r Desired row (y) position

Definition at line 144 of file virtualDevice.py.

145  def _pan(self, r, c):
146  """Pan to (colc, rowc)
147  \param c Desired column (x) position
148  \param r Desired row (y) position
149  """
150  if self.verbose:
151  print "virtual[%s]._pan(%.2f, %.2f)" % (self.display.frame, r, c)
def lsst.afw.display.virtualDevice.DisplayImpl._scale (   self,
  algorithm,
  min,
  max,
  unit = None,
  args,
  kwargs 
)
private
Set the scaling from DN to displayed pixels
\param algorithm Scaling algorithm (e.g. linear)
\param min  The minimum value of the stretch (or "zscale" or "minmax")
\param max  The maximum value of the stretch
\param unit Units for min and max (e.g. Percent, Absolute, Sigma)
\param *args Optional arguments
\param **kwargs Optional keyword arguments

Definition at line 125 of file virtualDevice.py.

126  def _scale(self, algorithm, min, max, unit=None, *args, **kwargs):
127  """Set the scaling from DN to displayed pixels
128  \param algorithm Scaling algorithm (e.g. linear)
129  \param min The minimum value of the stretch (or "zscale" or "minmax")
130  \param max The maximum value of the stretch
131  \param unit Units for min and max (e.g. Percent, Absolute, Sigma)
132  \param *args Optional arguments
133  \param **kwargs Optional keyword arguments
134  """
135  if self.verbose:
136  print "virtual[%s]._scale(%s, %s, %s, %s, %s, %s)" % (self.display.frame, algorithm,
137  min, max, unit, args, kwargs)
def lsst.afw.display.virtualDevice.DisplayImpl._setCallback (   self,
  what,
  func 
)
private

Definition at line 84 of file virtualDevice.py.

84 
85  def _setCallback(self, what, func):
86  if self.verbose > 1:
87  print "setCallback %s -> %s" % (what, func)
def lsst.afw.display.virtualDevice.DisplayImpl._setMaskTransparency (   self,
  transparency,
  maskplane 
)
private
Set the transparency of a maskplane
\param transparency The desired transparency, in the range [0, 100]
\param maskplane The maskplane to set (None: all)

Definition at line 117 of file virtualDevice.py.

118  def _setMaskTransparency(self, transparency, maskplane):
119  """Set the transparency of a maskplane
120  \param transparency The desired transparency, in the range [0, 100]
121  \param maskplane The maskplane to set (None: all)
122  """
123  if self.verbose:
124  print "virtual[%s]._setMaskTransparency(%g, maskplane=\"%s\")" % (self.display.frame, transparency, maskplane)
def lsst.afw.display.virtualDevice.DisplayImpl._show (   self)
private
Show the requested display

Definition at line 138 of file virtualDevice.py.

139  def _show(self):
140  """Show the requested display
141  """
142  if self.verbose:
143  print "virtual[%s]._show()" % self.display.frame
def lsst.afw.display.virtualDevice.DisplayImpl._zoom (   self,
  zoomfac 
)
private
Set the zoom
\param zoomfac  Zoom factor to use

Definition at line 152 of file virtualDevice.py.

153  def _zoom(self, zoomfac):
154  """Set the zoom
155  \param zoomfac Zoom factor to use
156  """
157  if self.verbose:
158  print "virtual[%s]._zoom(%g)" % (self.display.frame, zoomfac)

Member Data Documentation

lsst.afw.display.virtualDevice.DisplayImpl.display

Definition at line 34 of file virtualDevice.py.

lsst.afw.display.virtualDevice.DisplayImpl.verbose

Definition at line 35 of file virtualDevice.py.


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