lsst.afw  14.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Public Attributes | List of all members
lsst.afw.display.utils.Mosaic Class Reference
Inheritance diagram for lsst.afw.display.utils.Mosaic:

Public Member Functions

def __init__
 
def reset
 
def append
 
def makeMosaic
 
def setGutter
 
def setBackground
 
def setMode
 
def getBBox
 
def drawLabels
 
def nImage
 

Public Attributes

 gutter
 
 background
 
 xsize
 
 ysize
 
 images
 
 labels
 
 nImage
 
 ny
 
 mode
 

Detailed Description

A class to handle mosaics of one or more identically-sized images (or Masks or MaskedImages)
E.g.
m = Mosaic()
m.setGutter(5)
m.setBackground(10)
m.setMode("square")                     # the default; other options are "x" or "y"

mosaic = m.makeMosaic(im1, im2, im3)    # build the mosaic
display = afwDisplay.getDisplay()
display.mtv(mosaic)                         # display it
m.drawLabels(["Label 1", "Label 2", "Label 3"], display) # label the panels

# alternative way to build a mosaic
images = [im1, im2, im3]
labels = ["Label 1", "Label 2", "Label 3"]

mosaic = m.makeMosaic(images)
display.mtv(mosaic)
m.drawLabels(labels, display)

# Yet another way to build a mosaic (no need to build the images/labels lists)
for i in range(len(images)):
    m.append(images[i], labels[i])
# You may optionally include a colour, e.g. afwDisplay.YELLOW, as a third argument

mosaic = m.makeMosaic()
display.mtv(mosaic)
m.drawLabels(display=display)

Or simply:
mosaic = m.makeMosaic(display=display)

You can return the (ix, iy)th (or nth) bounding box (in pixels) with getBBox()

Definition at line 73 of file utils.py.

Constructor & Destructor Documentation

def lsst.afw.display.utils.Mosaic.__init__ (   self,
  gutter = 3,
  background = 0,
  mode = "square" 
)

Definition at line 109 of file utils.py.

Member Function Documentation

def lsst.afw.display.utils.Mosaic.append (   self,
  image,
  label = None,
  ctype = None 
)
Add an image to the list of images to be mosaiced
Set may be cleared with Mosaic.reset()

Returns the index of this image (may be passed to getBBox())

Definition at line 123 of file utils.py.

def lsst.afw.display.utils.Mosaic.drawLabels (   self,
  labels = None,
  display = "deferToFrame",
  frame = None 
)
Draw the list labels at the corners of each panel.  If labels is None, use the ones
specified by Mosaic.append()

Definition at line 269 of file utils.py.

def lsst.afw.display.utils.Mosaic.getBBox (   self,
  ix,
  iy = None 
)
Get the BBox for the nth or (ix, iy)the panel

Definition at line 260 of file utils.py.

def lsst.afw.display.utils.Mosaic.makeMosaic (   self,
  images = None,
  display = "deferToFrame",
  mode = None,
  background = None,
  title = "",
  frame = None 
)
Return a mosaic of all the images provided; if none are specified,
use the list accumulated with Mosaic.append().

Note that this mosaic is a patchwork of the input images;  if you want to
make a mosaic of a set images of the sky, you probably want to use the coadd code

If display or frame (deprecated) is specified, display the mosaic

Definition at line 139 of file utils.py.

def lsst.afw.display.utils.Mosaic.nImage (   self)
Number of images

Definition at line 303 of file utils.py.

def lsst.afw.display.utils.Mosaic.reset (   self)
Reset the list of images to be mosaiced

Definition at line 118 of file utils.py.

def lsst.afw.display.utils.Mosaic.setBackground (   self,
  background 
)
Set the value in the gutters

Definition at line 244 of file utils.py.

def lsst.afw.display.utils.Mosaic.setGutter (   self,
  gutter 
)
Set the number of pixels between panels in a mosaic

Definition at line 240 of file utils.py.

def lsst.afw.display.utils.Mosaic.setMode (   self,
  mode 
)
Set mosaicing mode.  Valid options:
   square       Make mosaic as square as possible
   x            Make mosaic one image high
   y            Make mosaic one image wide

Definition at line 248 of file utils.py.

Member Data Documentation

lsst.afw.display.utils.Mosaic.background

Definition at line 111 of file utils.py.

lsst.afw.display.utils.Mosaic.gutter

Definition at line 110 of file utils.py.

lsst.afw.display.utils.Mosaic.images

Definition at line 120 of file utils.py.

lsst.afw.display.utils.Mosaic.labels

Definition at line 121 of file utils.py.

lsst.afw.display.utils.Mosaic.mode

Definition at line 258 of file utils.py.

lsst.afw.display.utils.Mosaic.nImage

Definition at line 163 of file utils.py.

lsst.afw.display.utils.Mosaic.ny

Definition at line 206 of file utils.py.

lsst.afw.display.utils.Mosaic.xsize

Definition at line 113 of file utils.py.

lsst.afw.display.utils.Mosaic.ysize

Definition at line 114 of file utils.py.


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