LSSTApplications  10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
interface.py
Go to the documentation of this file.
1 #
2 # LSST Data Management System
3 # Copyright 2008, 2009, 2010, 2015 LSST Corporation.
4 #
5 # This product includes software developed by the
6 # LSST Project (http://www.lsst.org/).
7 #
8 # This program is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation, either version 3 of the License, or
11 # (at your option) any later version.
12 #
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
17 #
18 # You should have received a copy of the LSST License Statement and
19 # the GNU General Public License along with this program. If not,
20 # see <http://www.lsstcorp.org/LegalNotices/>.
21 #
22 
23 ##
24 ## \file
25 ## \brief Support for talking to image displays from python
26 
27 import re
28 import sys
29 import importlib
30 import lsst.afw.geom as afwGeom
31 import lsst.afw.image as afwImage
32 
33 __all__ = (
34  "WHITE", "BLACK", "RED", "GREEN", "BLUE", "CYAN", "MAGENTA", "YELLOW", "ORANGE",
35  "Display", "Event", "noop_callback", "h_callback",
36  "setDefaultBackend", "getDefaultBackend",
37  "setDefaultFrame", "getDefaultFrame", "incrDefaultFrame",
38  "setDefaultMaskTransparency", "setDefaultMaskPlaneColor",
39  "getDisplay", "delAllDisplays",
40 )
41 
42 #
43 # Symbolic names for mask/line colours. N.b. ds9 supports any X11 colour for masks
44 #
45 WHITE = "white"
46 BLACK = "black"
47 RED = "red"
48 GREEN = "green"
49 BLUE = "blue"
50 CYAN = "cyan"
51 MAGENTA = "magenta"
52 YELLOW = "yellow"
53 ORANGE = "orange"
54 
55 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
56 
57 def _makeDisplayImpl(display, backend, *args, **kwargs):
58  """!Return the DisplayImpl for the named backend
59 
60  \param backend Name of device. Should be importable, either absolutely or relative to lsst.display
61  \param frame Identifier for this instance of the backend
62  \param args Arguments passed to DisplayImpl.__init__
63  \param kwrgs Keywords arguments passed to DisplayImpl.__init__
64 
65  E.g.
66  import lsst.afw.display as afwDisplay
67  display = afwDisplay.Display("ds9", frame=1)
68  would call
69  _makeDisplayImpl(..., "ds9", 1)
70  and import the ds9 implementation of DisplayImpl from lsst.display.ds9
71  """
72  _disp = None
73  for dt in (backend, ".%s" % backend, "lsst.afw.display.%s" % backend):
74  try:
75  _disp = importlib.import_module(dt, package="lsst.display")
76  break
77  except ImportError as e:
78  pass
79 
80  if not _disp:
81  raise e
82 
83  return _disp.DisplayImpl(display, *args, **kwargs)
84 
85 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
86 
87 class Display(object):
88  _displays = {}
89  _defaultBackend = None
90  _defaultFrame = 0
91  _defaultMaskPlaneColor = dict(
92  BAD=RED,
93  CR=MAGENTA,
94  EDGE=YELLOW,
95  INTERPOLATED=GREEN,
96  SATURATED=GREEN,
97  DETECTED=BLUE,
98  DETECTED_NEGATIVE=CYAN,
99  SUSPECT=YELLOW,
100  NO_DATA=ORANGE,
101  # deprecated names
102  INTRP=GREEN,
103  SAT=GREEN,
104  )
105  _defaultMaskTransparency = {}
106 
107  def __init__(self, frame, backend=None, *args, **kwargs):
108  """!Create an object able to display images and overplot glyphs
109 
110  \param frame An identifier for the display
111  \param backend The backend to use (defaults to value set by setDefaultBackend())
112  \param args Arguments to pass to the backend
113  \param kwargs Arguments to pass to the backend
114  """
115  if backend is None:
116  if Display._defaultBackend is None:
117  try:
118  setDefaultBackend("ds9")
119  except RuntimeError:
120  setDefaultBackend("virtualDevice")
121 
122  backend = Display._defaultBackend
123 
124  self.frame = frame
125  self._impl = _makeDisplayImpl(self, backend, *args, **kwargs)
126 
127  self._xy0 = None # the data displayed on the frame's XY0
128  self.setMaskTransparency(Display._defaultMaskTransparency)
130  self.setMaskPlaneColor(Display._defaultMaskPlaneColor)
131 
132  self._callbacks = {}
133 
134  for ik in range(ord('a'), ord('z') + 1):
135  k = "%c" % ik
136  self.setCallback(k, noRaise=True)
137  self.setCallback(k.upper(), noRaise=True)
138 
139  for k in ('Return', 'Shift_L', 'Shift_R'):
140  self.setCallback(k)
141 
142  for k in ('q', 'Escape'):
143  self.setCallback(k, lambda k, x, y: True)
144 
145  def _h_callback(k, x, y):
146  h_callback(k, x, y)
147 
148  for k in sorted(self._callbacks.keys()):
149  doc = self._callbacks[k].__doc__
150  print " %-6s %s" % (k, doc.split("\n")[0] if doc else "???")
151 
152  self.setCallback('h', _h_callback)
153 
154  def __enter__(self):
155  """!Support for python's with statement"""
156  return self
157 
158  def __exit__(self, *args):
159  """!Support for python's with statement"""
160  self.close()
161 
162  def __del__(self):
163  self.close()
164 
165  def close(self):
166  if self._impl:
167  del self._impl
168  self._impl = None
169 
170  if self.frame in Display._displays:
171  del Display._displays[self.frame]
172 
173  @property
174  def verbose(self):
175  """!The backend's verbosity"""
176  return self._impl.verbose
177 
178  @verbose.setter
179  def verbose(self, value):
180  if self._impl:
181  self._impl.verbose = value
182 
183  def __str__(self):
184  return "Display[%s]" % (self.frame)
185 
186  #
187  # Handle Displays, including the default one (the frame to use when a user specifies None)
188  #
189  @staticmethod
190  def setDefaultBackend(backend):
191  try:
192  _makeDisplayImpl(None, backend)
193  except Exception as e:
194  raise RuntimeError("Unable to set backend to %s: \"%s\"" % (backend, e))
195 
196  Display._defaultBackend = backend
197 
198  @staticmethod
200  return Display._defaultBackend
201 
202  @staticmethod
203  def setDefaultFrame(frame=0):
204  """Set the default frame for display"""
205  Display._defaultFrame = frame
206 
207  @staticmethod
209  """Get the default frame for display"""
210  return Display._defaultFrame
211 
212  @staticmethod
214  """Increment the default frame for display"""
215  Display._defaultFrame += 1
216  return Display._defaultFrame
217 
218  @staticmethod
219  def setDefaultMaskTransparency(maskPlaneTransparency={}):
220  if hasattr(maskPlaneTransparency, "copy"):
221  maskPlaneTransparency = maskPlaneTransparency.copy()
222 
223  Display._defaultMaskTransparency = maskPlaneTransparency
224 
225  @staticmethod
226  def setDefaultMaskPlaneColor(name=None, color=None):
227  """!Set the default mapping from mask plane names to colours
228  \param name name of mask plane, or a dict mapping names to colours
229  \param color Desired color, or None if name is a dict
230 
231  If name is None, use the hard-coded default dictionary
232  """
233 
234  if name is None:
235  name = Display._defaultMaskPlaneColor
236 
237  if isinstance(name, dict):
238  assert color == None
239  for k, v in name.items():
241  return
242  #
243  # Set the individual colour values
244  #
245  Display._defaultMaskPlaneColor[name] = color
246 
247  @staticmethod
248  def getDisplay(frame=None, backend=None, create=True, verbose=False, *args, **kwargs):
249  """!Return the Display indexed by frame, creating it if needs be
250 
251  \param frame The desired frame (None => use defaultFrame (see setDefaultFrame))
252  \param backend create the specified frame using this backend (or the default if None) \
253  if it doesn't already exist. If backend == "", it's an error to specify a non-existent frame
254  \param create create the display if it doesn't already exist.
255  \param verbose Allow backend to be chatty
256  \param args arguments passed to Display constructor
257  \param kwargs keyword arguments passed to Display constructor
258  """
259 
260  if frame is None:
261  frame = Display._defaultFrame
262 
263  if not frame in Display._displays:
264  if backend == "":
265  raise RuntimeError("Frame %s does not exist" % frame)
266 
267  Display._displays[frame] = Display(frame, backend, verbose=verbose, *args, **kwargs)
268 
269  Display._displays[frame].verbose = verbose
270  return Display._displays[frame]
271 
272  @staticmethod
274  """!Delete and close all known display
275  """
276  for disp in Display._displays.values():
277  disp.close()
278  Display._displays = {}
279 
280  def maskColorGenerator(self, omitBW=True):
281  """!A generator for "standard" colours
282 
283  \param omitBW Don't include Black and White
284 
285  e.g.
286  colorGenerator = interface.maskColorGenerator(omitBW=True)
287  for p in planeList:
288  print p, next(colorGenerator)
289  """
290  _maskColors = [WHITE, BLACK, RED, GREEN, BLUE, CYAN, MAGENTA, YELLOW, ORANGE]
291 
292  i = -1
293  while True:
294  i += 1
295  color = _maskColors[i%len(_maskColors)]
296  if omitBW and color in (BLACK, WHITE):
297  continue
298 
299  yield color
300 
301  def setMaskPlaneColor(self, name, color=None):
302  """!Request that mask plane name be displayed as color
303 
304  \param name Name of mask plane or a dictionary of name -> colourName
305  \param color The name of the colour to use (must be None if name is a dict)
306 
307  Colours may be specified as any X11-compliant string (e.g. <tt>"orchid"</tt>), or by one
308  of the following constants defined in \c afwDisplay: \c BLACK, \c WHITE, \c RED, \c BLUE,
309  \c GREEN, \c CYAN, \c MAGENTA, \c YELLOW.
310 
311  The advantage of using the symbolic names is that the python interpreter can detect typos.
312 
313  """
314 
315  if isinstance(name, dict):
316  assert color == None
317  for k, v in name.items():
318  self.setMaskPlaneColor(k, v)
319  return
320 
321  self._maskPlaneColors[name] = color
322 
323  def getMaskPlaneColor(self, name):
324  """!Return the colour associated with the specified mask plane name"""
325 
326  return self._maskPlaneColors.get(name)
327 
328  def setMaskTransparency(self, transparency=None, name=None):
329  """!Specify display's mask transparency (percent); or None to not set it when loading masks"""
330 
331  if isinstance(transparency, dict):
332  assert name == None
333  for k, v in transparency.items():
334  self.setMaskTransparency(k, v)
335  return
336 
337  if transparency is not None and (transparency < 0 or transparency > 100):
338  print >> sys.stderr, "Mask transparency should be in the range [0, 100]; clipping"
339  if transparency < 0:
340  transparency = 0
341  else:
342  transparency = 100
343 
344  if transparency is not None:
345  self._impl._setMaskTransparency(transparency, name)
346 
347  def getMaskTransparency(self, name=None):
348  """!Return the current display's mask transparency"""
349 
350  self._impl._getMaskTransparency(name)
351 
352  def show(self):
353  """!Uniconify and Raise display. N.b. throws an exception if frame doesn't exit"""
354  self._impl._show()
355 
356  def mtv(self, data, title="", wcs=None):
357  """!Display an Image or Mask on a DISPLAY display
358 
359  Historical note: the name "mtv" comes from Jim Gunn's forth imageprocessing
360  system, Mirella (named after Mirella Freni); The "m" stands for Mirella.
361  """
362  if hasattr(data, "getXY0"):
363  self._xy0 = data.getXY0()
364  else:
365  self._xy0 = None
366 
367  if re.search("::Exposure<", repr(data)): # it's an Exposure; display the MaskedImage with the WCS
368  if wcs:
369  raise RuntimeError, "You may not specify a wcs with an Exposure"
370  data, wcs = data.getMaskedImage(), data.getWcs()
371  elif re.search("::DecoratedImage<", repr(data)): # it's a DecoratedImage; display it
372  data, wcs = data.getImage(), afwImage.makeWcs(data.getMetadata())
373  self._xy0 = data.getXY0() # DecoratedImage doesn't have getXY0()
374 
375  if re.search("::Image<", repr(data)): # it's an Image; display it
376  self._impl._mtv(data, None, wcs, title)
377  elif re.search("::Mask<", repr(data)): # it's a Mask; display it, bitplane by bitplane
378  #
379  # Some displays can't display a Mask without an image; so display an Image too,
380  # with pixel values set to the mask
381  #
382  self._impl._mtv(afwImage.ImageU(data.getArray()), data, wcs, title)
383  elif re.search("::MaskedImage<", repr(data)): # it's a MaskedImage; display Image and overlay Mask
384  self._impl._mtv(data.getImage(), data.getMask(True), wcs, title)
385  else:
386  raise RuntimeError, "Unsupported type %s" % repr(data)
387  #
388  # Graphics commands
389  #
390  class _Buffering(object):
391  """A class intended to be used with python's with statement"""
392  def __init__(self, _impl):
393  self._impl = _impl
394  def __enter__(self):
395  self._impl._buffer(True)
396  def __exit__(self, *args):
397  self._impl._buffer(False)
398  self._impl._flush()
399 
400  def Buffering(self):
401  """Return a class intended to be used with python's with statement
402  E.g.
403  with display.Buffering():
404  display.dot("+", xc, yc)
405  """
406  return self._Buffering(self._impl)
407 
408  def flush(self):
409  """!Flush the buffers"""
410  self._impl._flush()
411 
412  def erase(self):
413  """!Erase the specified DISPLAY frame
414  """
415  self._impl._erase()
416 
417  def dot(self, symb, c, r, size=2, ctype=None, origin=afwImage.PARENT, *args, **kwargs):
418  """!Draw a symbol onto the specified DISPLAY frame at (col,row) = (c,r) [0-based coordinates]
419 
420  Possible values are:
421  + Draw a +
422  x Draw an x
423  * Draw a *
424  o Draw a circle
425  @:Mxx,Mxy,Myy Draw an ellipse with moments (Mxx, Mxy, Myy) (argument size is ignored)
426  An object derived from afwGeom.ellipses.BaseCore Draw the ellipse (argument size is ignored)
427  Any other value is interpreted as a string to be drawn. Strings obey the fontFamily (which may be extended
428  with other characteristics, e.g. "times bold italic". Text will be drawn rotated by textAngle (textAngle is
429  ignored otherwise).
430 
431  N.b. objects derived from BaseCore include Axes and Quadrupole.
432  """
433  if isinstance(symb, int):
434  symb = "%d" % (symb)
435 
436  if origin == afwImage.PARENT and self._xy0 is not None:
437  x0, y0 = self._xy0
438  r -= x0
439  c -= y0
440 
441  if isinstance(symb, afwGeom.ellipses.BaseCore) or re.search(r"^@:", symb):
442  try:
443  mat = re.search(r"^@:([^,]+),([^,]+),([^,]+)", symb)
444  except TypeError:
445  pass
446  else:
447  if mat:
448  mxx, mxy, myy = [float(_) for _ in mat.groups()]
449  symb = afwGeom.ellipses.Quadrupole(mxx, myy, mxy)
450 
451  symb = afwGeom.ellipses.Axes(symb)
452 
453  self._impl._dot(symb, c, r, size, ctype, **kwargs)
454 
455  def line(self, points, origin=afwImage.PARENT, symbs=False, ctype=None, size=0.5):
456  """!Draw a set of symbols or connect the points, a list of (col,row)
457  If symbs is True, draw points at the specified points using the desired symbol,
458  otherwise connect the dots. Ctype is the name of a colour (e.g. 'red')
459 
460  If symbs supports indexing (which includes a string -- caveat emptor) the elements are used to label the points
461  """
462  if symbs:
463  try:
464  symbs[1]
465  except:
466  symbs = len(points)*list(symbs)
467 
468  for i, xy in enumerate(points):
469  self.dot(symbs[i], *xy, size=size, ctype=ctype)
470  else:
471  if len(points) > 0:
472  if origin == afwImage.PARENT and self._xy0 is not None:
473  x0, y0 = self._xy0
474  _points = list(points) # make a mutable copy
475  for i, p in enumerate(points):
476  _points[i] = (p[0] - x0, p[1] - y0)
477  points = _points
478 
479  self._impl._drawLines(points, ctype)
480  #
481  # Set gray scale
482  #
483  def scale(self, algorithm, min, max=None, unit=None, *args, **kwargs):
484  """!Set the range of the scaling from DN in the image to the image display
485  \param algorithm Desired scaling (e.g. "linear" or "asinh")
486  \param min Minimum value, or "minmax" or "zscale"
487  \param max Maximum value (must be None for minmax|zscale)
488  \param unit Units for min and max (e.g. Percent, Absolute, Sigma; None if min==minmax|zscale)
489  \param *args Optional arguments
490  \param **kwargs Optional keyword arguments
491  """
492  if min in ("minmax", "zscale"):
493  assert max == None, "You may not specify \"%s\" and max" % min
494  assert unit == None, "You may not specify \"%s\" and unit" % min
495  elif max is None:
496  raise RuntimeError("Please specify max")
497 
498  self._impl._scale(algorithm, min, max, unit, *args, **kwargs)
499  #
500  # Zoom and Pan
501  #
502  def zoom(self, zoomfac=None, colc=None, rowc=None, origin=afwImage.PARENT):
503  """!Zoom frame by specified amount, optionally panning also"""
504 
505  if (rowc and colc is None) or (colc and rowc is None):
506  raise RuntimeError, "Please specify row and column center to pan about"
507 
508  if rowc is not None:
509  if origin == afwImage.PARENT and self._xy0 is not None:
510  x0, y0 = self._xy0
511  rowc -= x0
512  colc -= y0
513 
514  self._impl._pan(colc, rowc)
515 
516  if zoomfac == None and rowc == None:
517  zoomfac = 2
518 
519  if zoomfac is not None:
520  self._impl._zoom(zoomfac)
521 
522  def pan(self, colc=None, rowc=None, origin=afwImage.PARENT):
523  """!Pan to (rowc, colc); see also zoom"""
524 
525  self.zoom(None, colc, rowc, origin)
526 
527  def interact(self):
528  """!Enter an interactive loop, listening for key presses in display and firing callbacks.
529 
530  Exit with q, \c CR, or \c ESC
531  """
532 
533  while True:
534  ev = self._impl._getEvent()
535  if not ev:
536  continue
537  k, x, y = ev.k, ev.x, ev.y # for now
538 
539  try:
540  if self.callbacks[k](k, x, y):
541  break
542  except KeyError:
543  print >> sys.stderr, "No callback is registered for %s" % k
544  except Exception, e:
545  print >> sys.stderr, "Display.callbacks[%s](%s, %s, %s) failed: %s" % \
546  (k, k, x, y, e)
547 
548  def setCallback(self, k, func=None, noRaise=False):
549  """!Set the callback for key k to be func, returning the old callback
550  """
551 
552  if k in "f":
553  if noRaise:
554  return
555  raise RuntimeError(
556  "Key '%s' is already in use by display, so I can't add a callback for it" % k)
557 
558  ofunc = self._callbacks.get(k)
559  self._callbacks[k] = func if func else noop_callback
560 
561  self._impl._setCallback(k, self._callbacks[k])
562 
563  return ofunc
564 
565  def getActiveCallbackKeys(self, onlyActive=True):
566  """!Return all callback keys
567  \param onlyActive If true only return keys that do something
568  """
569 
570  return sorted([k for k, func in self._callbacks.items() if
571  not (onlyActive and func == noop_callback)])
572 
573 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
574 #
575 # Callbacks for display events
576 #
577 class Event(object):
578  """!A class to handle events such as key presses in image display windows"""
579  def __init__(self, k, x=float('nan'), y=float('nan')):
580  self.k = k
581  self.x = x
582  self.y = y
583 
584  def __str__(self):
585  return "%s (%.2f, %.2f)" % (self.k, self.x, self.y)
586 #
587 # Default fallback function
588 #
589 def noop_callback(k, x, y):
590  """!Callback function: arguments key, x, y"""
591  return False
592 
593 def h_callback(k, x, y):
594  print "Enter q or <ESC> to leave interactive mode, h for this help, or a letter to fire a callback"
595  return False
596 
597 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
598 #
599 # Handle Displays, including the default one (the frame to use when a user specifies None)
600 #
601 # If the default frame is None, image display is disabled
602 #
603 def setDefaultBackend(backend):
604  Display.setDefaultBackend(backend)
605 
607  return Display.getDefaultBackend()
608 
609 def setDefaultFrame(frame=0):
610  return Display.setDefaultFrame(frame)
611 
613  """Get the default frame for display"""
614  return Display.getDefaultFrame()
615 
617  """Increment the default frame for display"""
618  return Display.incrDefaultFrame()
619 
620 def setDefaultMaskTransparency(maskPlaneTransparency={}):
621  return Display.setDefaultMaskTransparency(maskPlaneTransparency)
622 
623 def setDefaultMaskPlaneColor(name=None, color=None):
624  """!Set the default mapping from mask plane names to colours
625  \param name name of mask plane, or a dict mapping names to colours
626  \param color Desired color, or None if name is a dict
627 
628  If name is None, use the hard-coded default dictionary
629  """
630 
631  return Display.setDefaultMaskPlaneColor(name, color)
632 
633 def getDisplay(frame=None, backend=None, create=True, verbose=False, *args, **kwargs):
634  """!Return the Display indexed by frame, creating it if needs be
635 
636  See Display.getDisplay
637 
638  \param frame The desired frame (None => use defaultFrame (see setDefaultFrame))
639  \param backend create the specified frame using this backend (or the default if None) \
640  if it doesn't already exist. If backend == "", it's an error to specify a non-existent frame
641  \param create create the display if it doesn't already exist.
642  \param verbose Allow backend to be chatty
643  \param args arguments passed to Display constructor
644  \param kwargs keyword arguments passed to Display constructor
645  """
646 
647  return Display.getDisplay(frame, backend, create, verbose, *args, **kwargs)
648 
650  """!Delete and close all known display
651  """
652  return Display.delAllDisplays()
def getMaskTransparency
Return the current display&#39;s mask transparency.
Definition: interface.py:347
def getDisplay
Return the Display indexed by frame, creating it if needs be.
Definition: interface.py:248
def setMaskTransparency
Specify display&#39;s mask transparency (percent); or None to not set it when loading masks...
Definition: interface.py:328
def interact
Enter an interactive loop, listening for key presses in display and firing callbacks.
Definition: interface.py:527
def setMaskPlaneColor
Request that mask plane name be displayed as color.
Definition: interface.py:301
def zoom
Zoom frame by specified amount, optionally panning also.
Definition: interface.py:502
def delAllDisplays
Delete and close all known display.
Definition: interface.py:273
def mtv
Display an Image or Mask on a DISPLAY display.
Definition: interface.py:356
def __enter__
Support for python&#39;s with statement.
Definition: interface.py:154
def pan
Pan to (rowc, colc); see also zoom.
Definition: interface.py:522
def verbose
The backend&#39;s verbosity.
Definition: interface.py:174
def __init__
Create an object able to display images and overplot glyphs.
Definition: interface.py:107
def getMaskPlaneColor
Return the colour associated with the specified mask plane name.
Definition: interface.py:323
A class to handle events such as key presses in image display windows.
Definition: interface.py:577
def dot
Draw a symbol onto the specified DISPLAY frame at (col,row) = (c,r) [0-based coordinates].
Definition: interface.py:417
def _makeDisplayImpl
Return the DisplayImpl for the named backend.
Definition: interface.py:57
Wcs::Ptr makeWcs(coord::Coord const &crval, geom::Point2D const &crpix, double CD11, double CD12, double CD21, double CD22)
Create a Wcs object from crval, crpix, CD, using CD elements (useful from python) ...
Definition: makeWcs.cc:141
def scale
Set the range of the scaling from DN in the image to the image display.
Definition: interface.py:483
def delAllDisplays
Delete and close all known display.
Definition: interface.py:649
def show
Uniconify and Raise display.
Definition: interface.py:352
def line
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.
Definition: interface.py:455
def setCallback
Set the callback for key k to be func, returning the old callback.
Definition: interface.py:548
def erase
Erase the specified DISPLAY frame.
Definition: interface.py:412
def getDisplay
Return the Display indexed by frame, creating it if needs be.
Definition: interface.py:633
def flush
Flush the buffers.
Definition: interface.py:408
def __exit__
Support for python&#39;s with statement.
Definition: interface.py:158
def getActiveCallbackKeys
Return all callback keys.
Definition: interface.py:565
def noop_callback
Callback function: arguments key, x, y.
Definition: interface.py:589
def maskColorGenerator
A generator for &quot;standard&quot; colours.
Definition: interface.py:280
def setDefaultMaskPlaneColor
Set the default mapping from mask plane names to colours.
Definition: interface.py:623
def setDefaultMaskPlaneColor
Set the default mapping from mask plane names to colours.
Definition: interface.py:226