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
Classes | Functions | Variables
lsst.afw.display.interface Namespace Reference

Classes

class  Display
 
class  Event
 A class to handle events such as key presses in image display windows. More...
 

Functions

def _makeDisplayImpl
 Return the DisplayImpl for the named backend. More...
 
def noop_callback
 Callback function: arguments key, x, y. More...
 
def h_callback
 
def setDefaultBackend
 
def getDefaultBackend
 
def setDefaultFrame
 
def getDefaultFrame
 
def incrDefaultFrame
 
def setDefaultMaskTransparency
 
def setDefaultMaskPlaneColor
 Set the default mapping from mask plane names to colours. More...
 
def getDisplay
 Return the Display indexed by frame, creating it if needs be. More...
 
def delAllDisplays
 Delete and close all known display. More...
 

Variables

tuple __all__
 
string WHITE = "white"
 
string BLACK = "black"
 
string RED = "red"
 
string GREEN = "green"
 
string BLUE = "blue"
 
string CYAN = "cyan"
 
string MAGENTA = "magenta"
 
string YELLOW = "yellow"
 
string ORANGE = "orange"
 

Function Documentation

def lsst.afw.display.interface._makeDisplayImpl (   display,
  backend,
  args,
  kwargs 
)
private

Return the DisplayImpl for the named backend.

Parameters
backendName of device. Should be importable, either absolutely or relative to lsst.display
frameIdentifier for this instance of the backend
argsArguments passed to DisplayImpl.__init__
kwrgsKeywords arguments passed to DisplayImpl.__init__

E.g. import lsst.afw.display as afwDisplay display = afwDisplay.Display("ds9", frame=1) would call _makeDisplayImpl(..., "ds9", 1) and import the ds9 implementation of DisplayImpl from lsst.display.ds9

Definition at line 57 of file interface.py.

57 
58 def _makeDisplayImpl(display, backend, *args, **kwargs):
59  """!Return the DisplayImpl for the named backend
60 
61  \param backend Name of device. Should be importable, either absolutely or relative to lsst.display
62  \param frame Identifier for this instance of the backend
63  \param args Arguments passed to DisplayImpl.__init__
64  \param kwrgs Keywords arguments passed to DisplayImpl.__init__
65 
66  E.g.
67  import lsst.afw.display as afwDisplay
68  display = afwDisplay.Display("ds9", frame=1)
69  would call
70  _makeDisplayImpl(..., "ds9", 1)
71  and import the ds9 implementation of DisplayImpl from lsst.display.ds9
72  """
73  _disp = None
74  for dt in (backend, ".%s" % backend, "lsst.afw.display.%s" % backend):
75  try:
76  _disp = importlib.import_module(dt, package="lsst.display")
77  break
78  except ImportError as e:
79  pass
80 
81  if not _disp:
82  raise e
83 
84  return _disp.DisplayImpl(display, *args, **kwargs)
85 
86 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
def _makeDisplayImpl
Return the DisplayImpl for the named backend.
Definition: interface.py:57
def lsst.afw.display.interface.delAllDisplays ( )

Delete and close all known display.

Definition at line 649 of file interface.py.

650 def delAllDisplays():
651  """!Delete and close all known display
652  """
653  return Display.delAllDisplays()
def delAllDisplays
Delete and close all known display.
Definition: interface.py:649
def lsst.afw.display.interface.getDefaultBackend ( )

Definition at line 606 of file interface.py.

607 def getDefaultBackend():
608  return Display.getDefaultBackend()
def lsst.afw.display.interface.getDefaultFrame ( )
Get the default frame for display

Definition at line 612 of file interface.py.

613 def getDefaultFrame():
614  """Get the default frame for display"""
615  return Display.getDefaultFrame()
def lsst.afw.display.interface.getDisplay (   frame = None,
  backend = None,
  create = True,
  verbose = False,
  args,
  kwargs 
)

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

See Display.getDisplay

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 633 of file interface.py.

634 def getDisplay(frame=None, backend=None, create=True, verbose=False, *args, **kwargs):
635  """!Return the Display indexed by frame, creating it if needs be
636 
637  See Display.getDisplay
638 
639  \param frame The desired frame (None => use defaultFrame (see setDefaultFrame))
640  \param backend create the specified frame using this backend (or the default if None) \
641  if it doesn't already exist. If backend == "", it's an error to specify a non-existent frame
642  \param create create the display if it doesn't already exist.
643  \param verbose Allow backend to be chatty
644  \param args arguments passed to Display constructor
645  \param kwargs keyword arguments passed to Display constructor
646  """
647 
648  return Display.getDisplay(frame, backend, create, verbose, *args, **kwargs)
def getDisplay
Return the Display indexed by frame, creating it if needs be.
Definition: interface.py:633
def lsst.afw.display.interface.h_callback (   k,
  x,
  y 
)

Definition at line 593 of file interface.py.

594 def h_callback(k, x, y):
595  print "Enter q or <ESC> to leave interactive mode, h for this help, or a letter to fire a callback"
596  return False
597 
598 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
599 #
600 # Handle Displays, including the default one (the frame to use when a user specifies None)
601 #
602 # If the default frame is None, image display is disabled
#
def lsst.afw.display.interface.incrDefaultFrame ( )
Increment the default frame for display

Definition at line 616 of file interface.py.

617 def incrDefaultFrame():
618  """Increment the default frame for display"""
619  return Display.incrDefaultFrame()
def lsst.afw.display.interface.noop_callback (   k,
  x,
  y 
)

Callback function: arguments key, x, y.

Definition at line 589 of file interface.py.

590 def noop_callback(k, x, y):
591  """!Callback function: arguments key, x, y"""
592  return False
def noop_callback
Callback function: arguments key, x, y.
Definition: interface.py:589
def lsst.afw.display.interface.setDefaultBackend (   backend)

Definition at line 603 of file interface.py.

604 def setDefaultBackend(backend):
605  Display.setDefaultBackend(backend)
def lsst.afw.display.interface.setDefaultFrame (   frame = 0)

Definition at line 609 of file interface.py.

610 def setDefaultFrame(frame=0):
611  return Display.setDefaultFrame(frame)
def lsst.afw.display.interface.setDefaultMaskPlaneColor (   name = None,
  color = None 
)

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 623 of file interface.py.

624 def setDefaultMaskPlaneColor(name=None, color=None):
625  """!Set the default mapping from mask plane names to colours
626  \param name name of mask plane, or a dict mapping names to colours
627  \param color Desired color, or None if name is a dict
628 
629  If name is None, use the hard-coded default dictionary
630  """
631 
632  return Display.setDefaultMaskPlaneColor(name, color)
def setDefaultMaskPlaneColor
Set the default mapping from mask plane names to colours.
Definition: interface.py:623
def lsst.afw.display.interface.setDefaultMaskTransparency (   maskPlaneTransparency = {})

Definition at line 620 of file interface.py.

621 def setDefaultMaskTransparency(maskPlaneTransparency={}):
622  return Display.setDefaultMaskTransparency(maskPlaneTransparency)

Variable Documentation

tuple lsst.afw.display.interface.__all__
Initial value:
1 = (
2  "WHITE", "BLACK", "RED", "GREEN", "BLUE", "CYAN", "MAGENTA", "YELLOW", "ORANGE",
3  "Display", "Event", "noop_callback", "h_callback",
4  "setDefaultBackend", "getDefaultBackend",
5  "setDefaultFrame", "getDefaultFrame", "incrDefaultFrame",
6  "setDefaultMaskTransparency", "setDefaultMaskPlaneColor",
7  "getDisplay", "delAllDisplays",
8 )

Definition at line 33 of file interface.py.

string lsst.afw.display.interface.BLACK = "black"

Definition at line 46 of file interface.py.

string lsst.afw.display.interface.BLUE = "blue"

Definition at line 49 of file interface.py.

string lsst.afw.display.interface.CYAN = "cyan"

Definition at line 50 of file interface.py.

string lsst.afw.display.interface.GREEN = "green"

Definition at line 48 of file interface.py.

string lsst.afw.display.interface.MAGENTA = "magenta"

Definition at line 51 of file interface.py.

string lsst.afw.display.interface.ORANGE = "orange"

Definition at line 53 of file interface.py.

string lsst.afw.display.interface.RED = "red"

Definition at line 47 of file interface.py.

string lsst.afw.display.interface.WHITE = "white"

Definition at line 45 of file interface.py.

string lsst.afw.display.interface.YELLOW = "yellow"

Definition at line 52 of file interface.py.