Public Member Functions | |
| __init__ (self, display, verbose=False, interpretMaskBits=True, mtvOrigin=afwImage.PARENT, fastMaskDisplay=False, reopenPlot=False, useSexagesimal=False, dpi=None, *args, **kwargs) | |
| savefig (self, *args, **kwargs) | |
| show_colorbar (self, show=True, where="right", axSize="5%", axPad=None, **kwargs) | |
| useSexagesimal (self, useSexagesimal) | |
| wait (self, prompt="[c(ontinue) p(db)] :", allowPdb=True) | |
Protected Member Functions | |
| _close (self) | |
| Close the display, cleaning up any allocated resources. | |
| _show (self) | |
| _setMaskTransparency (self, transparency, maskplane) | |
| _getMaskTransparency (self, maskplane=None) | |
| _mtv (self, image, mask=None, wcs=None, title="", metadata=None) | |
| _i_mtv (self, data, wcs, title, isMask) | |
| _i_setImage (self, image, mask=None, wcs=None) | |
| _setImageColormap (self, cmap) | |
| _buffer (self, enable=True) | |
| _flush (self) | |
| _erase (self) | |
| _dot (self, symb, c, r, size, ctype, fontFamily="helvetica", textAngle=None) | |
| _drawLines (self, points, ctype) | |
| _scale (self, algorithm, minval, maxval, unit, *args, **kwargs) | |
| _i_scale (self, algorithm, minval, maxval, unit, *args, **kwargs) | |
| _zoom (self, zoomfac) | |
| _pan (self, colc, rowc) | |
| _getEvent (self, timeout=-1) | |
Protected Attributes | |
| _figure = figure | |
| _display = display | |
| dict | _maskTransparency = {None: 0.7} |
| _interpretMaskBits = interpretMaskBits | |
| # we draw each bitplane separately | _fastMaskDisplay = fastMaskDisplay |
| list | _useSexagesimal = [useSexagesimal] |
| _mtvOrigin = mtvOrigin | |
| tuple | _mappable_ax = None |
| _colorbar_ax = None | |
| _image_colormap = matplotlib.cm.gray | |
| _scaleArgs = dict() | |
| _normalize = None | |
| _image = None | |
| _mask = None | |
| _wcs = None | |
| _title = title | |
| _xy0 = self._image.getXY0() if self._image else (0, 0) | |
| # avoid min | _zoomfac = None |
| _width | |
| int | _height = 0, 0 |
| float | _xcen = 0.5*self._width |
| float | _ycen = 0.5*self._height |
Provide a matplotlib backend for afwDisplay Recommended backends in notebooks are: %matplotlib notebook or %matplotlib ipympl or %matplotlib qt %gui qt or %matplotlib inline or %matplotlib osx Apparently only qt supports Display.interact(); the list of interactive backends is given by lsst.display.matplotlib.interactiveBackends
| lsst.display.matplotlib.matplotlib.DisplayImpl.__init__ | ( | self, | |
| display, | |||
| verbose = False, | |||
| interpretMaskBits = True, | |||
| mtvOrigin = afwImage.PARENT, | |||
| fastMaskDisplay = False, | |||
| reopenPlot = False, | |||
| useSexagesimal = False, | |||
| dpi = None, | |||
| * | args, | ||
| ** | kwargs ) |
Initialise a matplotlib display
@param fastMaskDisplay If True only show the first bitplane that's
set in each pixel
(e.g. if (SATURATED & DETECTED)
ignore DETECTED)
Not really what we want, but a bit faster
@param interpretMaskBits Interpret the mask value under the cursor
@param mtvOrigin Display pixel coordinates with LOCAL origin
(bottom left == 0,0 not XY0)
@param reopenPlot If true, close the plot before opening it.
(useful with e.g. %ipympl)
@param useSexagesimal If True, display coordinates in sexagesimal
E.g. hh:mm:ss.ss (default:False)
May be changed by calling
display.useSexagesimal()
@param dpi Number of dpi (passed to pyplot.figure)
The `frame` argument to `Display` may be a matplotlib figure; this
permits code such as
fig, axes = plt.subplots(1, 2)
disp = afwDisplay.Display(fig)
disp.scale('asinh', 'zscale', Q=0.5)
for axis, exp in zip(axes, exps):
fig.sca(axis) # make axis active
disp.mtv(exp)
|
protected |
Draw a symbol at (col,row) = (c,r) [0-based coordinates]
Possible values are:
+ Draw a +
x Draw an x
* Draw a *
o Draw a circle
@:Mxx,Mxy,Myy Draw an ellipse with moments
(Mxx, Mxy, Myy) (argument size is ignored)
An afwGeom.ellipses.Axes Draw the ellipse (argument size is
ignored)
Any other value is interpreted as a string to be drawn. Strings obey the
fontFamily (which may be extended with other characteristics, e.g.
"times bold italic". Text will be drawn rotated by textAngle
(textAngle is ignored otherwise).
|
protected |
Connect the points, a list of (col,row) Ctype is the name of a colour (e.g. 'red')
|
protected |
Erase the display
|
protected |
Listen for a key press, returning (key, x, y)
|
protected |
Return the current mask transparency
|
protected |
Internal routine to display an Image or Mask on a DS9 display
|
protected |
Save the current image, mask, wcs, and XY0
|
protected |
Display an Image and/or Mask on a matplotlib display
|
protected |
Pan to (colc, rowc)
|
protected |
Set gray scale
N.b. Supports extra arguments:
@param maskedPixels List of names of mask bits to ignore
E.g. ["BAD", "INTERP"].
A single name is also supported
|
protected |
Set the colormap used for the image cmap should be either the name of an attribute of matplotlib.cm or an mpColors.Colormap (e.g. "gray" or matplotlib.cm.gray)
|
protected |
Specify mask transparency (percent)
|
protected |
Put the plot at the top of the window stacking order
|
protected |
Zoom by specified amount
| lsst.display.matplotlib.matplotlib.DisplayImpl.savefig | ( | self, | |
| * | args, | ||
| ** | kwargs ) |
Defer to figure.savefig() Parameters ---------- args : `list` Passed through to figure.savefig() kwargs : `dict` Passed through to figure.savefig()
| lsst.display.matplotlib.matplotlib.DisplayImpl.show_colorbar | ( | self, | |
| show = True, | |||
| where = "right", | |||
| axSize = "5%", | |||
| axPad = None, | |||
| ** | kwargs ) |
Show (or hide) the colour bar Parameters ---------- show : `bool` Should I show the colour bar? where : `str` Location of colour bar: "right" or "bottom" axSize : `float` or `str` Size of axes to hold the colour bar; fraction of current x-size axPad : `float` or `str` Padding between axes and colour bar; fraction of current x-size args : `list` Passed through to colorbar() kwargs : `dict` Passed through to colorbar() We set the default padding to put the colourbar in a reasonable place for roughly square plots, but you may need to fiddle for plots with extreme axis ratios. You can only configure the colorbar when it isn't yet visible, but as you can easily remove it this is not in practice a difficulty.
| lsst.display.matplotlib.matplotlib.DisplayImpl.useSexagesimal | ( | self, | |
| useSexagesimal ) |
Control the formatting coordinates as HH:MM:SS.ss Parameters ---------- useSexagesimal : `bool` Print coordinates as e.g. HH:MM:SS.ss iff True N.b. can also be set in Display's ctor
Are we formatting coordinates as HH:MM:SS.ss?
| lsst.display.matplotlib.matplotlib.DisplayImpl.wait | ( | self, | |
| prompt = "[c(ontinue) p(db)] :", | |||
| allowPdb = True ) |
Wait for keyboard input Parameters ---------- prompt : `str` The prompt string. allowPdb : `bool` If true, entering a 'p' or 'pdb' puts you into pdb Returns the string you entered Useful when plotting from a programme that exits such as a processCcd Any key except 'p' continues; 'p' puts you into pdb (unless allowPdb is False)