lsst.afw  22.0.1-27-ga185acb71+cd0c1e0a06
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)
 
def __enter__ (self)
 
def __exit__ (self, *args)
 
def __del__ (self)
 
def __getattr__ (self, name)
 
def close (self)
 
def verbose (self)
 
def verbose (self, value)
 
def __str__ (self)
 
def setImageColormap (self, cmap)
 
def maskColorGenerator (self, omitBW=True)
 
def setMaskPlaneColor (self, name, color=None)
 
def getMaskPlaneColor (self, name=None)
 
def setMaskTransparency (self, transparency=None, name=None)
 
def getMaskTransparency (self, name=None)
 
def show (self)
 
def mtv (self, data, title="", wcs=None)
 
def Buffering (self)
 
def flush (self)
 
def erase (self)
 
def dot (self, symb, c, r, size=2, ctype=None, origin=afwImage.PARENT, *args, **kwargs)
 
def line (self, points, origin=afwImage.PARENT, symbs=False, ctype=None, size=0.5)
 
def scale (self, algorithm, min, max=None, unit=None, *args, **kwargs)
 
def zoom (self, zoomfac=None, colc=None, rowc=None, origin=afwImage.PARENT)
 
def pan (self, colc=None, rowc=None, origin=afwImage.PARENT)
 
def interact (self)
 
def setCallback (self, k, func=None, noRaise=False)
 
def getActiveCallbackKeys (self, onlyActive=True)
 

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)
 
def setDefaultImageColormap (cmap)
 
def getDisplay (frame=None, backend=None, create=True, verbose=False, *args, **kwargs)
 
def delAllDisplays ()
 

Public Attributes

 frame
 
 name
 

Detailed Description

Create an object able to display images and overplot glyphs

Parameters
----------
frame
    An identifier for the display
backend : `str`
    The backend to use (defaults to value set by setDefaultBackend())
*args
    Arguments to pass to the backend
**kwargs
    Arguments to pass to the backend

Definition at line 118 of file interface.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 152 of file interface.py.

◆ __del__()

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

Definition at line 209 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 199 of file interface.py.

◆ __exit__()

def lsst.afw.display.interface.Display.__exit__ (   self,
args 
)
Support for python's with statement

Definition at line 204 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 : `str`
    name of the attribute requested

Returns:
--------
attribute : `object`
    the attribute of self._impl for the requested name

Definition at line 212 of file interface.py.

◆ __str__()

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

Definition at line 258 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

Examples
--------
.. code-block:: py

   with display.Buffering():
       display.dot("+", xc, yc)

Definition at line 572 of file interface.py.

◆ close()

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

Definition at line 238 of file interface.py.

◆ delAllDisplays()

def lsst.afw.display.interface.Display.delAllDisplays ( )
static
Delete and close all known displays

Definition at line 399 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

Parameters
----------
symb
    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)
        `lsst.afw.geom.ellipses.BaseCore`
            Draw the ellipse (argument size is ignored). N.b. objects
            derived from `~lsst.afw.geom.ellipses.BaseCore` include
            `~lsst.afw.geom.ellipses.Axes` and `~lsst.afw.geom.ellipses.Quadrupole`.
        Any other value
            Interpreted as a string to be drawn.
c, r
    The column and row where the symbol is drawn [0-based coordinates]
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
origin : `lsst.afw.image.ImageOrigin`
    Coordinate system for the given positions.
*args
    Extra arguments to backend
**kwargs
    Extra keyword arguments to backend

Definition at line 594 of file interface.py.

◆ erase()

def lsst.afw.display.interface.Display.erase (   self)
Erase the specified display frame

Definition at line 589 of file interface.py.

◆ flush()

def lsst.afw.display.interface.Display.flush (   self)
Flush the buffers

Definition at line 584 of file interface.py.

◆ getActiveCallbackKeys()

def lsst.afw.display.interface.Display.getActiveCallbackKeys (   self,
  onlyActive = True 
)
Return all callback keys

Parameters
----------
onlyActive : `bool`
    If `True` only return keys that do something

Definition at line 814 of file interface.py.

◆ getDefaultBackend()

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

Definition at line 275 of file interface.py.

◆ getDefaultFrame()

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

Definition at line 285 of file interface.py.

◆ getDisplay()

def lsst.afw.display.interface.Display.getDisplay (   frame = None,
  backend = None,
  create = True,
  verbose = False,
args,
**  kwargs 
)
static
Return a specific `Display`, creating it if need be

Parameters
----------
frame
    The desired frame (`None` => use defaultFrame (see `~Display.setDefaultFrame`))
backend : `str`
    create 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``.
create : `bool`
    create the display if it doesn't already exist.
verbose : `bool`
    Allow backend to be chatty
*args
    arguments passed to `Display` constructor
**kwargs
    keyword arguments passed to `Display` constructor

Definition at line 364 of file interface.py.

◆ getMaskPlaneColor()

def lsst.afw.display.interface.Display.getMaskPlaneColor (   self,
  name = None 
)
Return the color associated with the specified mask plane name

Parameters
----------
name : `str`
    Desired mask plane; if `None`, return entire dict

Definition at line 462 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 497 of file interface.py.

◆ incrDefaultFrame()

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

Definition at line 291 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 762 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 points

Parameters
----------
points : `list`
    a list of (col, row)
origin : `lsst.afw.image.ImageOrigin`
    Coordinate system for the given positions.
symbs : `bool` or sequence
    If ``symbs`` is `True`, draw points at the specified points using the desired symbol,
    otherwise connect the dots.

    If ``symbs`` supports indexing (which includes a string -- caveat emptor) the
    elements are used to label the points
ctype : `str`
    ``ctype`` is the name of a color (e.g. 'red')
size : `float`

Definition at line 653 of file interface.py.

◆ maskColorGenerator()

def lsst.afw.display.interface.Display.maskColorGenerator (   self,
  omitBW = True 
)
A generator for "standard" colors

Parameters
----------
omitBW : `bool`
    Don't include `BLACK` and `WHITE`

Examples
--------

.. code-block:: py

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

Definition at line 406 of file interface.py.

◆ mtv()

def lsst.afw.display.interface.Display.mtv (   self,
  data,
  title = "",
  wcs = None 
)
Display an `~lsst.afw.image.Image` or `~lsst.afw.image.Mask` on a display

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

◆ pan()

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

Parameters
----------
colc, rowc
    the coordinates to pan to
origin : `lsst.afw.image.ImageOrigin`
    Coordinate system for the given positions.

See also
--------
Display.zoom

Definition at line 745 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
----------
algorithm : `str`
    Desired scaling (e.g. "linear" or "asinh")
min
    Minimum value, or "minmax" or "zscale"
max
    Maximum value (must be `None` for minmax|zscale)
unit
    Units for min and max (e.g. Percent, Absolute, Sigma; `None` if min==minmax|zscale)
*args
    Optional arguments to the backend
**kwargs
    Optional keyword arguments to the backend

Definition at line 694 of file interface.py.

◆ setCallback()

def lsst.afw.display.interface.Display.setCallback (   self,
  k,
  func = None,
  noRaise = False 
)
Set the callback for a key

Parameters
----------
k
    The key to assign the callback to
func : callable
    The callback assigned to ``k``
noRaise : `bool`

Returns
-------
oldFunc : callable
    The callback previously assigned to ``k``.

Definition at line 784 of file interface.py.

◆ setDefaultBackend()

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

Definition at line 265 of file interface.py.

◆ setDefaultFrame()

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

Definition at line 279 of file interface.py.

◆ setDefaultImageColormap()

def lsst.afw.display.interface.Display.setDefaultImageColormap (   cmap)
static
Set the default colormap for images

Parameters
----------
cmap : `str`
    Name of colormap, as interpreted by the backend

Notes
-----
The only colormaps that all backends are required to honor
(if they pay any attention to setImageColormap) are "gray" and "grey"

Definition at line 331 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 colors

Parameters
----------
name : `str` or `dict`
    name of mask plane, or a dict mapping names to colors
    If name is `None`, use the hard-coded default dictionary
color
    Desired color, or `None` if name is a dict

Definition at line 305 of file interface.py.

◆ setDefaultMaskTransparency()

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

Definition at line 298 of file interface.py.

◆ setImageColormap()

def lsst.afw.display.interface.Display.setImageColormap (   self,
  cmap 
)
Set the colormap to use for images

 Parameters
----------
cmap : `str`
    Name of colormap, as interpreted by the backend

Notes
-----
The only colormaps that all backends are required to honor
(if they pay any attention to setImageColormap) are "gray" and "grey"

Definition at line 347 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
----------
name : `str` or `dict`
    Name of mask plane or a dictionary of name -> colorName
color : `str`
    The name of the color to use (must be `None` if ``name`` is a `dict`)

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

    If the color 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 435 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 476 of file interface.py.

◆ show()

def lsst.afw.display.interface.Display.show (   self)
Uniconify and Raise display.

Notes
-----
Throws an exception if frame doesn't exit

Definition at line 503 of file interface.py.

◆ verbose() [1/2]

def lsst.afw.display.interface.Display.verbose (   self)
The backend's verbosity

Definition at line 248 of file interface.py.

◆ verbose() [2/2]

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

Definition at line 254 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 723 of file interface.py.

Member Data Documentation

◆ frame

lsst.afw.display.interface.Display.frame

Definition at line 165 of file interface.py.

◆ name

lsst.afw.display.interface.Display.name

Definition at line 167 of file interface.py.


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