lsst.afw  16.0-51-gb4b4a8566+2
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
lsst.afw.display.interface.Display Class Reference

Classes

class  _Buffering
 

Public Member Functions

def __init__ (self, frame=None, backend=None, args, kwargs)
 Create an object able to display images and overplot glyphs. More...
 
def __enter__ (self)
 Support for python's with statement. More...
 
def __exit__ (self, args)
 Support for python's with statement. More...
 
def __del__ (self)
 
def __getattr__ (self, name)
 
def close (self)
 
def verbose (self)
 The backend's verbosity. More...
 
def verbose (self, value)
 
def __str__ (self)
 
def setImageColormap (self, cmap)
 Set the colourmap to use for images. More...
 
def maskColorGenerator (self, omitBW=True)
 A generator for "standard" colours. More...
 
def setMaskPlaneColor (self, name, color=None)
 Request that mask plane name be displayed as color. More...
 
def getMaskPlaneColor (self, name=None)
 Return the colour associated with the specified mask plane name. More...
 
def setMaskTransparency (self, transparency=None, name=None)
 Specify display's mask transparency (percent); or None to not set it when loading masks. More...
 
def getMaskTransparency (self, name=None)
 Return the current display's mask transparency. More...
 
def show (self)
 Uniconify and Raise display. More...
 
def mtv (self, data, title="", wcs=None)
 Display an Image or Mask on a DISPLAY display. More...
 
def Buffering (self)
 
def flush (self)
 Flush the buffers. More...
 
def erase (self)
 Erase the specified DISPLAY frame. More...
 
def dot (self, symb, c, r, size=2, ctype=None, origin=afwImage.PARENT, args, kwargs)
 Draw a symbol onto the specified DISPLAY frame at (col,row) = (c,r) [0-based coordinates]. More...
 
def line (self, points, origin=afwImage.PARENT, symbs=False, ctype=None, size=0.5)
 Draw a set of symbols or connect the points, a list of (col,row) If symbs is True, draw points at the specified points using the desired symbol, otherwise connect the dots. More...
 
def scale (self, algorithm, min, max=None, unit=None, args, kwargs)
 Set the range of the scaling from DN in the image to the image display. More...
 
def zoom (self, zoomfac=None, colc=None, rowc=None, origin=afwImage.PARENT)
 Zoom frame by specified amount, optionally panning also. More...
 
def pan (self, colc=None, rowc=None, origin=afwImage.PARENT)
 Pan to (rowc, colc); see also zoom. More...
 
def interact (self)
 Enter an interactive loop, listening for key presses in display and firing callbacks. More...
 
def setCallback (self, k, func=None, noRaise=False)
 Set the callback for key k to be func, returning the old callback. More...
 
def getActiveCallbackKeys (self, onlyActive=True)
 Return all callback keys. More...
 

Static Public Member Functions

def setDefaultBackend (backend)
 
def getDefaultBackend ()
 
def setDefaultFrame (frame=0)
 
def getDefaultFrame ()
 
def incrDefaultFrame ()
 
def setDefaultMaskTransparency (maskPlaneTransparency={})
 
def setDefaultMaskPlaneColor (name=None, color=None)
 Set the default mapping from mask plane names to colours. More...
 
def setDefaultImageColormap (cmap)
 Set the default colourmap for images. More...
 
def getDisplay (frame=None, backend=None, create=True, verbose=False, args, kwargs)
 Return the Display indexed by frame, creating it if needs be. More...
 
def delAllDisplays ()
 Delete and close all known display. More...
 

Public Attributes

 frame
 
 name
 

Detailed Description

Definition at line 110 of file interface.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.afw.display.interface.Display.__init__ (   self,
  frame = None,
  backend = None,
  args,
  kwargs 
)

Create an object able to display images and overplot glyphs.

Parameters
frameAn identifier for the display
backendThe backend to use (defaults to value set by setDefaultBackend())
argsArguments to pass to the backend
kwargsArguments to pass to the backend

Definition at line 131 of file interface.py.

◆ __del__()

def lsst.afw.display.interface.Display.__del__ (   self)

Definition at line 193 of file interface.py.

Member Function Documentation

◆ __enter__()

def lsst.afw.display.interface.Display.__enter__ (   self)

Support for python's with statement.

Definition at line 185 of file interface.py.

◆ __exit__()

def lsst.afw.display.interface.Display.__exit__ (   self,
  args 
)

Support for python's with statement.

Definition at line 189 of file interface.py.

◆ __getattr__()

def lsst.afw.display.interface.Display.__getattr__ (   self,
  name 
)
Return the attribute of self._impl, or ._impl if it is requested
Parameters:
-----------
    name : string
name of the attribute requested
Returns:
--------
    attribute : object
the attribute of self._impl for the requested name

Definition at line 196 of file interface.py.

◆ __str__()

def lsst.afw.display.interface.Display.__str__ (   self)

Definition at line 239 of file interface.py.

◆ Buffering()

def lsst.afw.display.interface.Display.Buffering (   self)
Return a class intended to be used with python's with statement
    E.g.
with display.Buffering():
    display.dot("+", xc, yc)

Definition at line 502 of file interface.py.

◆ close()

def lsst.afw.display.interface.Display.close (   self)

Definition at line 220 of file interface.py.

◆ delAllDisplays()

def lsst.afw.display.interface.Display.delAllDisplays ( )
static

Delete and close all known display.

Definition at line 352 of file interface.py.

◆ dot()

def lsst.afw.display.interface.Display.dot (   self,
  symb,
  c,
  r,
  size = 2,
  ctype = None,
  origin = afwImage.PARENT,
  args,
  kwargs 
)

Draw a symbol onto the specified DISPLAY frame 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 object derived from afwGeom.ellipses.BaseCore 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).

N.b. objects derived from BaseCore include Axes and Quadrupole.

Definition at line 519 of file interface.py.

◆ erase()

def lsst.afw.display.interface.Display.erase (   self)

Erase the specified DISPLAY frame.

Definition at line 514 of file interface.py.

◆ flush()

def lsst.afw.display.interface.Display.flush (   self)

Flush the buffers.

Definition at line 510 of file interface.py.

◆ getActiveCallbackKeys()

def lsst.afw.display.interface.Display.getActiveCallbackKeys (   self,
  onlyActive = True 
)

Return all callback keys.

Parameters
onlyActiveIf true only return keys that do something

Definition at line 672 of file interface.py.

◆ getDefaultBackend()

def lsst.afw.display.interface.Display.getDefaultBackend ( )
static

Definition at line 256 of file interface.py.

◆ getDefaultFrame()

def lsst.afw.display.interface.Display.getDefaultFrame ( )
static
Get the default frame for display

Definition at line 265 of file interface.py.

◆ getDisplay()

def lsst.afw.display.interface.Display.getDisplay (   frame = None,
  backend = None,
  create = True,
  verbose = False,
  args,
  kwargs 
)
static

Return the Display indexed by frame, creating it if needs be.

Parameters
frameThe desired frame (None => use defaultFrame (see setDefaultFrame))
backendcreate the specified frame using this backend (or the default if None) \ if it doesn't already exist. If backend == "", it's an error to specify a non-existent frame
createcreate the display if it doesn't already exist.
verboseAllow backend to be chatty
argsarguments passed to Display constructor
kwargskeyword arguments passed to Display constructor

Definition at line 326 of file interface.py.

◆ getMaskPlaneColor()

def lsst.afw.display.interface.Display.getMaskPlaneColor (   self,
  name = None 
)

Return the colour associated with the specified mask plane name.

Parameters
nameDesired mask plane; if None, return entire dict

Definition at line 405 of file interface.py.

◆ getMaskTransparency()

def lsst.afw.display.interface.Display.getMaskTransparency (   self,
  name = None 
)

Return the current display's mask transparency.

Definition at line 436 of file interface.py.

◆ incrDefaultFrame()

def lsst.afw.display.interface.Display.incrDefaultFrame ( )
static
Increment the default frame for display

Definition at line 270 of file interface.py.

◆ interact()

def lsst.afw.display.interface.Display.interact (   self)

Enter an interactive loop, listening for key presses in display and firing callbacks.

Exit with q, CR, ESC, or any other callback function that returns a True value.

Definition at line 634 of file interface.py.

◆ line()

def lsst.afw.display.interface.Display.line (   self,
  points,
  origin = afwImage.PARENT,
  symbs = False,
  ctype = None,
  size = 0.5 
)

Draw a set of symbols or connect the points, a list of (col,row) If symbs is True, draw points at the specified points using the desired symbol, otherwise connect the dots.

Ctype is the name of a colour (e.g. 'red')

If symbs supports indexing (which includes a string – caveat emptor) the elements are used to label the points

Definition at line 558 of file interface.py.

◆ maskColorGenerator()

def lsst.afw.display.interface.Display.maskColorGenerator (   self,
  omitBW = True 
)

A generator for "standard" colours.

Parameters
omitBWDon't include Black and White

e.g. colorGenerator = interface.maskColorGenerator(omitBW=True) for p in planeList: print p, next(colorGenerator)

Definition at line 359 of file interface.py.

◆ mtv()

def lsst.afw.display.interface.Display.mtv (   self,
  data,
  title = "",
  wcs = None 
)

Display an Image or Mask on a DISPLAY display.

Historical note: the name "mtv" comes from Jim Gunn's forth imageprocessing system, Mirella (named after Mirella Freni); The "m" stands for Mirella.

Definition at line 445 of file interface.py.

◆ pan()

def lsst.afw.display.interface.Display.pan (   self,
  colc = None,
  rowc = None,
  origin = afwImage.PARENT 
)

Pan to (rowc, colc); see also zoom.

Definition at line 629 of file interface.py.

◆ scale()

def lsst.afw.display.interface.Display.scale (   self,
  algorithm,
  min,
  max = None,
  unit = None,
  args,
  kwargs 
)

Set the range of the scaling from DN in the image to the image display.

Parameters
algorithmDesired scaling (e.g. "linear" or "asinh")
minMinimum value, or "minmax" or "zscale"
maxMaximum value (must be None for minmax|zscale)
unitUnits for min and max (e.g. Percent, Absolute, Sigma; None if min==minmax|zscale)
*argsOptional arguments
**kwargsOptional keyword arguments

Definition at line 588 of file interface.py.

◆ setCallback()

def lsst.afw.display.interface.Display.setCallback (   self,
  k,
  func = None,
  noRaise = False 
)

Set the callback for key k to be func, returning the old callback.

Definition at line 655 of file interface.py.

◆ setDefaultBackend()

def lsst.afw.display.interface.Display.setDefaultBackend (   backend)
static

Definition at line 246 of file interface.py.

◆ setDefaultFrame()

def lsst.afw.display.interface.Display.setDefaultFrame (   frame = 0)
static
Set the default frame for display

Definition at line 260 of file interface.py.

◆ setDefaultImageColormap()

def lsst.afw.display.interface.Display.setDefaultImageColormap (   cmap)
static

Set the default colourmap for images.

Parameters
cmapName of colourmap, as interpreted by the backend

The only colourmaps that all backends are required to honour (if they pay any attention to setImageColormap) are "gray" and "grey"

Definition at line 305 of file interface.py.

◆ setDefaultMaskPlaneColor()

def lsst.afw.display.interface.Display.setDefaultMaskPlaneColor (   name = None,
  color = None 
)
static

Set the default mapping from mask plane names to colours.

Parameters
namename of mask plane, or a dict mapping names to colours
colorDesired color, or None if name is a dict

If name is None, use the hard-coded default dictionary

Definition at line 283 of file interface.py.

◆ setDefaultMaskTransparency()

def lsst.afw.display.interface.Display.setDefaultMaskTransparency (   maskPlaneTransparency = {})
static

Definition at line 276 of file interface.py.

◆ setImageColormap()

def lsst.afw.display.interface.Display.setImageColormap (   self,
  cmap 
)

Set the colourmap to use for images.

Parameters
cmapName of colourmap, as interpreted by the backend

The only colourmaps that all backends are required to honour (if they pay any attention to setImageColormap) are "gray" and "grey"

Definition at line 315 of file interface.py.

◆ setMaskPlaneColor()

def lsst.afw.display.interface.Display.setMaskPlaneColor (   self,
  name,
  color = None 
)

Request that mask plane name be displayed as color.

Parameters
nameName of mask plane or a dictionary of name -> colourName
colorThe name of the colour to use (must be None if name is a dict)

Colours may be specified as any X11-compliant string (e.g. "orchid"), or by one of the following constants defined in afwDisplay: BLACK, WHITE, RED, BLUE, GREEN, CYAN, MAGENTA, YELLOW.

If the colour is "ignore" (or IGNORE) then that mask plane is not displayed

The advantage of using the symbolic names is that the python interpreter can detect typos.

Definition at line 381 of file interface.py.

◆ setMaskTransparency()

def lsst.afw.display.interface.Display.setMaskTransparency (   self,
  transparency = None,
  name = None 
)

Specify display's mask transparency (percent); or None to not set it when loading masks.

Definition at line 416 of file interface.py.

◆ show()

def lsst.afw.display.interface.Display.show (   self)

Uniconify and Raise display.

N.b. throws an exception if frame doesn't exit

Definition at line 441 of file interface.py.

◆ verbose() [1/2]

def lsst.afw.display.interface.Display.verbose (   self)

The backend's verbosity.

Definition at line 230 of file interface.py.

◆ verbose() [2/2]

def lsst.afw.display.interface.Display.verbose (   self,
  value 
)

Definition at line 235 of file interface.py.

◆ zoom()

def lsst.afw.display.interface.Display.zoom (   self,
  zoomfac = None,
  colc = None,
  rowc = None,
  origin = afwImage.PARENT 
)

Zoom frame by specified amount, optionally panning also.

Definition at line 608 of file interface.py.

Member Data Documentation

◆ frame

lsst.afw.display.interface.Display.frame

Definition at line 151 of file interface.py.

◆ name

lsst.afw.display.interface.Display.name

Definition at line 153 of file interface.py.


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