lsst.afw  13.0-101-g894215678
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__ (self, gutter=3, background=0, mode="square")
 
def reset (self)
 
def append (self, image, label=None, ctype=None)
 
def makeMosaic (self, images=None, display="deferToFrame", mode=None, background=None, title="", frame=None)
 
def setGutter (self, gutter)
 
def setBackground (self, background)
 
def setMode (self, mode)
 
def getBBox (self, ix, iy=None)
 
def drawLabels (self, labels=None, display="deferToFrame", frame=None)
 
def nImage (self)
 

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

◆ __init__()

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

◆ append()

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.

◆ drawLabels()

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.

◆ getBBox()

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.

◆ makeMosaic()

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.

◆ nImage()

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

Definition at line 303 of file utils.py.

◆ reset()

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

Definition at line 118 of file utils.py.

◆ setBackground()

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

Definition at line 244 of file utils.py.

◆ setGutter()

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.

◆ setMode()

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

◆ background

lsst.afw.display.utils.Mosaic.background

Definition at line 111 of file utils.py.

◆ gutter

lsst.afw.display.utils.Mosaic.gutter

Definition at line 110 of file utils.py.

◆ images

lsst.afw.display.utils.Mosaic.images

Definition at line 120 of file utils.py.

◆ labels

lsst.afw.display.utils.Mosaic.labels

Definition at line 121 of file utils.py.

◆ mode

lsst.afw.display.utils.Mosaic.mode

Definition at line 258 of file utils.py.

◆ nImage

lsst.afw.display.utils.Mosaic.nImage

Definition at line 163 of file utils.py.

◆ ny

lsst.afw.display.utils.Mosaic.ny

Definition at line 206 of file utils.py.

◆ xsize

lsst.afw.display.utils.Mosaic.xsize

Definition at line 113 of file utils.py.

◆ ysize

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: