LSST Applications g0265f82a02+0e5473021a,g02d81e74bb+f5613e8b4f,g1470d8bcf6+190ad2ba91,g14a832a312+311607e4ab,g2079a07aa2+86d27d4dc4,g2305ad1205+a8e3196225,g295015adf3+b67ee847e5,g2bbee38e9b+0e5473021a,g337abbeb29+0e5473021a,g3ddfee87b4+a761f810f3,g487adcacf7+17c8fdbcbd,g50ff169b8f+96c6868917,g52b1c1532d+585e252eca,g591dd9f2cf+65b5bd823e,g5a732f18d5+53520f316c,g64a986408d+f5613e8b4f,g6c1bc301e9+51106c2951,g858d7b2824+f5613e8b4f,g8a8a8dda67+585e252eca,g99cad8db69+6729933424,g9ddcbc5298+9a081db1e4,ga1e77700b3+15fc3df1f7,ga8c6da7877+ef4e3a5875,gb0e22166c9+60f28cb32d,gb6a65358fc+0e5473021a,gba4ed39666+c2a2e4ac27,gbb8dafda3b+e9bba80f27,gc120e1dc64+eee469a5e5,gc28159a63d+0e5473021a,gcf0d15dbbd+a761f810f3,gdaeeff99f8+f9a426f77a,ge6526c86ff+d4c1d4bfef,ge79ae78c31+0e5473021a,gee10cc3b42+585e252eca,gf1cff7945b+f5613e8b4f,w.2024.16
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | List of all members
lsst.afw.display.virtualDevice.DisplayImpl Class Reference

Public Member Functions

 __init__ (self, display, verbose=False)
 
 __del__ (self)
 

Public Attributes

 display
 
 verbose
 
 frame
 

Protected Member Functions

 _close (self)
 
 _buffer (self, enable=True)
 
 _dot (self, symb, c, r, size, ctype, *args, **kwargs)
 
 _drawLines (self, points, ctype)
 
 _erase (self)
 
 _flush (self)
 
 _setCallback (self, what, func)
 
 _getEvent (self)
 
 _getMaskTransparency (self)
 
 _mtv (self, image, wcs=None, mask=None, title="")
 
 _setImageColormap (self, cmap)
 
 _setMaskTransparency (self, transparency, maskplane)
 
 _scale (self, algorithm, min, max, *args, unit=None, **kwargs)
 
 _show (self)
 
 _pan (self, r, c)
 
 _zoom (self, zoomfac)
 

Detailed Description

Back-end for display objects.

Parameters
----------
display
    The display object that we're providing the implementation for
verbose : `bool`
    be chatty?

Definition at line 23 of file virtualDevice.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 33 of file virtualDevice.py.

33 def __init__(self, display, verbose=False):
34 self.display = display
35 self.verbose = verbose
36

◆ __del__()

lsst.afw.display.virtualDevice.DisplayImpl.__del__ ( self)

Definition at line 37 of file virtualDevice.py.

37 def __del__(self):
38 self._close()
39

Member Function Documentation

◆ _buffer()

lsst.afw.display.virtualDevice.DisplayImpl._buffer ( self,
enable = True )
protected
Enable or disable buffering of writes to the display

Parameters
----------
enable : `bool`
    `True` or `False`, as appropriate

Definition at line 46 of file virtualDevice.py.

46 def _buffer(self, enable=True):
47 """Enable or disable buffering of writes to the display
48
49 Parameters
50 ----------
51 enable : `bool`
52 `True` or `False`, as appropriate
53 """
54 if self.verbose:
55 print("virtual[%s]._buffer(%s)" % (self.frame, enable))
56

◆ _close()

lsst.afw.display.virtualDevice.DisplayImpl._close ( self)
protected
Close the display, cleaning up any allocated resources

Definition at line 40 of file virtualDevice.py.

40 def _close(self):
41 """Close the display, cleaning up any allocated resources
42 """
43 if hasattr(self, "verbose") and self.verbose and hasattr(self, "display"):
44 print("virtual[%s]._close()" % (self.frame))
45

◆ _dot()

lsst.afw.display.virtualDevice.DisplayImpl._dot ( self,
symb,
c,
r,
size,
ctype,
* args,
** kwargs )
protected
Draw a symbol at (c, r)

Parameters
----------
symb
    The desired symbol. See `dot` for details
c : `float`
    (x) column position
r : `float`
    (y) row position
size : `int`
    Size of symbol, in pixels
ctype : `str`
    The desired color, either e.g. `lsst.afw.display.RED` or a color name known to X11
*args
    Extra arguments to backend
**kwargs
    Extra keyword arguments to backend

Definition at line 57 of file virtualDevice.py.

57 def _dot(self, symb, c, r, size, ctype, *args, **kwargs):
58 """Draw a symbol at (c, r)
59
60 Parameters
61 ----------
62 symb
63 The desired symbol. See `dot` for details
64 c : `float`
65 (x) column position
66 r : `float`
67 (y) row position
68 size : `int`
69 Size of symbol, in pixels
70 ctype : `str`
71 The desired color, either e.g. `lsst.afw.display.RED` or a color name known to X11
72 *args
73 Extra arguments to backend
74 **kwargs
75 Extra keyword arguments to backend
76 """
77 if self.verbose:
78 print("virtual[%s]._dot('%s', %.2f, %.2f, size=%g, ctype=%s, %s, %s)" %
79 (self.frame, symb, c, r, size, ctype, args, kwargs))
80

◆ _drawLines()

lsst.afw.display.virtualDevice.DisplayImpl._drawLines ( self,
points,
ctype )
protected
Draw line defined by the list points

Parameters
----------
points : `list` of `tuple` of `float`
    A list of 0-indexed positions [(x, y), (x, y), ...]
ctype : `str`
    The desired color, either e.g. `lsst.afw.display.RED` or a color name known to X11

Definition at line 81 of file virtualDevice.py.

81 def _drawLines(self, points, ctype):
82 """Draw line defined by the list points
83
84 Parameters
85 ----------
86 points : `list` of `tuple` of `float`
87 A list of 0-indexed positions [(x, y), (x, y), ...]
88 ctype : `str`
89 The desired color, either e.g. `lsst.afw.display.RED` or a color name known to X11
90 """
91 if self.verbose:
92 print("virtual[%s]._drawLines(%s, ctype=%s)" %
93 (self.frame, points, ctype))
94

◆ _erase()

lsst.afw.display.virtualDevice.DisplayImpl._erase ( self)
protected
Erase all glyphs drawn on display

Definition at line 95 of file virtualDevice.py.

95 def _erase(self):
96 """Erase all glyphs drawn on display
97 """
98 if self.verbose:
99 print("virtual[%s]._erase()" % (self.frame))
100

◆ _flush()

lsst.afw.display.virtualDevice.DisplayImpl._flush ( self)
protected
Flush any I/O buffers

Definition at line 101 of file virtualDevice.py.

101 def _flush(self):
102 """Flush any I/O buffers
103 """
104 if self.verbose:
105 print("virtual[%s]._flush()" % self.frame)
106

◆ _getEvent()

lsst.afw.display.virtualDevice.DisplayImpl._getEvent ( self)
protected
Return an event generated by a keypress or mouse click

Definition at line 111 of file virtualDevice.py.

111 def _getEvent(self):
112 """Return an event generated by a keypress or mouse click
113 """
114 from .interface import Event
115 ev = Event("q")
116
117 if self.verbose:
118 print("virtual[%s]._getEvent() -> %s" % (self.frame, ev))
119
120 return ev
121

◆ _getMaskTransparency()

lsst.afw.display.virtualDevice.DisplayImpl._getMaskTransparency ( self)
protected
Return the mask transparency for a display

Definition at line 122 of file virtualDevice.py.

122 def _getMaskTransparency(self):
123 """Return the mask transparency for a display
124 """
125 if self.verbose:
126 print("virtual[%s]._getMaskTransparency()" % self.frame)
127

◆ _mtv()

lsst.afw.display.virtualDevice.DisplayImpl._mtv ( self,
image,
wcs = None,
mask = None,
title = "" )
protected
Display an image and maybe a mask overlay on a display

Parameters
----------
image : `lsst.afw.image.Image`
    `~lsst.afw.image.Image` to display
mask : `lsst.afw.image.Mask`
    `~lsst.afw.image.Mask` to display
wcs : `lsst.afw.geom.SkyWcs`
    A Wcs to associate with data
title : `str`
    Name to display with the data

Definition at line 128 of file virtualDevice.py.

128 def _mtv(self, image, wcs=None, mask=None, title=""):
129 """Display an image and maybe a mask overlay on a display
130
131 Parameters
132 ----------
133 image : `lsst.afw.image.Image`
134 `~lsst.afw.image.Image` to display
135 mask : `lsst.afw.image.Mask`
136 `~lsst.afw.image.Mask` to display
137 wcs : `lsst.afw.geom.SkyWcs`
138 A Wcs to associate with data
139 title : `str`
140 Name to display with the data
141 """
142 if self.verbose:
143 print("virtual[%s]._mtv(image=%s, mask=%s, wcs=%s, title=\"%s\")" %
144 (self.frame, "Image" if image else None,
145 "Mask" if mask else None, "Wcs" if wcs else None, title))
146

◆ _pan()

lsst.afw.display.virtualDevice.DisplayImpl._pan ( self,
r,
c )
protected
Pan to a row and column

Parameters
----------
c : `float`
    Desired column (x) position
r : `float`
    Desired row (y) position

Definition at line 200 of file virtualDevice.py.

200 def _pan(self, r, c):
201 """Pan to a row and column
202
203 Parameters
204 ----------
205 c : `float`
206 Desired column (x) position
207 r : `float`
208 Desired row (y) position
209 """
210 if self.verbose:
211 print("virtual[%s]._pan(%.2f, %.2f)" % (self.frame, r, c))
212

◆ _scale()

lsst.afw.display.virtualDevice.DisplayImpl._scale ( self,
algorithm,
min,
max,
* args,
unit = None,
** kwargs )
protected
Set the scaling from DN to displayed pixels

Parameters
----------
algorithm
    Scaling algorithm (e.g. linear)
min
    The minimum value of the stretch (or "zscale" or "minmax")
max
    The maximum value of the stretch
unit
    Units for min and max (e.g. Percent, Absolute, Sigma)
*args
    Optional arguments to the backend
**kwargs
    Optional keyword arguments to the backend

Definition at line 172 of file virtualDevice.py.

172 def _scale(self, algorithm, min, max, *args, unit=None, **kwargs):
173 """Set the scaling from DN to displayed pixels
174
175 Parameters
176 ----------
177 algorithm
178 Scaling algorithm (e.g. linear)
179 min
180 The minimum value of the stretch (or "zscale" or "minmax")
181 max
182 The maximum value of the stretch
183 unit
184 Units for min and max (e.g. Percent, Absolute, Sigma)
185 *args
186 Optional arguments to the backend
187 **kwargs
188 Optional keyword arguments to the backend
189 """
190 if self.verbose:
191 print("virtual[%s]._scale(%s, %s, %s, %s, %s, %s)" % (self.frame, algorithm,
192 min, max, unit, args, kwargs))
193

◆ _setCallback()

lsst.afw.display.virtualDevice.DisplayImpl._setCallback ( self,
what,
func )
protected

Definition at line 107 of file virtualDevice.py.

107 def _setCallback(self, what, func):
108 if self.verbose > 1:
109 print("setCallback %s -> %s" % (what, func))
110

◆ _setImageColormap()

lsst.afw.display.virtualDevice.DisplayImpl._setImageColormap ( self,
cmap )
protected
Set the desired colormap

Parameters
----------
cmap : `str`
    the name of a colormap (e.g. "gray") or a backend-specific object

Definition at line 147 of file virtualDevice.py.

147 def _setImageColormap(self, cmap):
148 """Set the desired colormap
149
150 Parameters
151 ----------
152 cmap : `str`
153 the name of a colormap (e.g. "gray") or a backend-specific object
154 """
155 if self.verbose:
156 print("virtual[%s]._setImageColormap(cmap=\"%s\")" % (self.frame, cmap))
157

◆ _setMaskTransparency()

lsst.afw.display.virtualDevice.DisplayImpl._setMaskTransparency ( self,
transparency,
maskplane )
protected
Set the transparency of a maskplane

Parameters
----------
transparency : `float`
    The desired transparency, in the range [0, 100]
maskplane
    The maskplane to set (None: all)

Definition at line 158 of file virtualDevice.py.

158 def _setMaskTransparency(self, transparency, maskplane):
159 """Set the transparency of a maskplane
160
161 Parameters
162 ----------
163 transparency : `float`
164 The desired transparency, in the range [0, 100]
165 maskplane
166 The maskplane to set (None: all)
167 """
168 if self.verbose:
169 print("virtual[%s]._setMaskTransparency(%g, maskplane=\"%s\")" %
170 (self.frame, transparency, maskplane))
171

◆ _show()

lsst.afw.display.virtualDevice.DisplayImpl._show ( self)
protected
Show the requested display

Definition at line 194 of file virtualDevice.py.

194 def _show(self):
195 """Show the requested display
196 """
197 if self.verbose:
198 print("virtual[%s]._show()" % self.frame)
199

◆ _zoom()

lsst.afw.display.virtualDevice.DisplayImpl._zoom ( self,
zoomfac )
protected
Set the zoom

Parameters
----------
zoomfac : `float`
    Zoom factor to use

Definition at line 213 of file virtualDevice.py.

213 def _zoom(self, zoomfac):
214 """Set the zoom
215
216 Parameters
217 ----------
218 zoomfac : `float`
219 Zoom factor to use
220 """
221 if self.verbose:
222 print("virtual[%s]._zoom(%g)" % (self.frame, zoomfac))

Member Data Documentation

◆ display

lsst.afw.display.virtualDevice.DisplayImpl.display

Definition at line 34 of file virtualDevice.py.

◆ frame

lsst.afw.display.virtualDevice.DisplayImpl.frame

Definition at line 44 of file virtualDevice.py.

◆ verbose

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: