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
lsst.afw.display.rgb Namespace Reference

Classes

class  Mapping
 Baseclass to map red, blue, green intensities into uint8 values. More...
 
class  AsinhMapping
 A mapping for an asinh stretch (preserving colours independent of brightness) More...
 
class  asinhMappingF
 
class  _RgbImageF
 

Functions

def makeRGB
 
def displayRGB
 
def writeRGB
 
def RgbImageF
 

Function Documentation

def lsst.afw.display.rgb.displayRGB (   rgb)
Display an rgb image using matplotlib

Definition at line 128 of file rgb.py.

129 def displayRGB(rgb):
130  """Display an rgb image using matplotlib"""
131  import matplotlib.pyplot as plt
132  plt.imshow(rgb, interpolation='nearest')
133  plt.show()
def lsst.afw.display.rgb.makeRGB (   imageR,
  imageG,
  imageB,
  min = 0,
  range = 5,
  Q = 20,
  fileName = None,
  saturatedBorderWidth = 0,
  saturatedPixelValue = None 
)
Make a set of three images into an RGB image using an asinh stretch and optionally write it to disk

If saturatedBorderWidth is non-zero, replace saturated pixels with saturatedPixelValue.  Note
that replacing saturated pixels requires that the input images be MaskedImages.

Definition at line 110 of file rgb.py.

111  saturatedBorderWidth=0, saturatedPixelValue=None):
112  """Make a set of three images into an RGB image using an asinh stretch and optionally write it to disk
113 
114  If saturatedBorderWidth is non-zero, replace saturated pixels with saturatedPixelValue. Note
115  that replacing saturated pixels requires that the input images be MaskedImages.
116  """
117  if saturatedBorderWidth:
118  if saturatedPixelValue is None:
119  raise ValueError("saturatedPixelValue must be set if saturatedBorderWidth is set")
120  replaceSaturatedPixels(imageR, imageG, imageB, saturatedBorderWidth, saturatedPixelValue)
121 
122  asinhMap = AsinhMapping(min, range, Q)
123  rgb = asinhMap.makeRgbImage(imageR, imageG, imageB)
124  if fileName:
125  writeRGB(fileName, rgb)
126 
127  return rgb
A mapping for an asinh stretch (preserving colours independent of brightness)
Definition: rgb.py:77
template void replaceSaturatedPixels(image::MaskedImage< float > &rim, image::MaskedImage< float > &gim, image::MaskedImage< float > &bim, int borderWidth, float saturatedPixelValue)
def lsst.afw.display.rgb.RgbImageF (   imageR,
  imageG,
  imageB,
  mapping 
)

Definition at line 157 of file rgb.py.

158 def RgbImageF(imageR, imageG, imageB, mapping):
159  return _RgbImageF(imageR, imageG, imageB, mapping)
def lsst.afw.display.rgb.writeRGB (   fileName,
  rgbImage 
)
Write an RGB image (made by e.g. makeRGB) to fileName

Definition at line 134 of file rgb.py.

135 def writeRGB(fileName, rgbImage):
136  """Write an RGB image (made by e.g. makeRGB) to fileName"""
137  import matplotlib.image
138  matplotlib.image.imsave(fileName, rgbImage)
139 
140 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
141 #
142 # Support the legacy API
#