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
Public Member Functions | Private Attributes | List of all members
lsst.afw.display.rgb.AsinhMapping Class Reference

A mapping for an asinh stretch (preserving colours independent of brightness) More...

Inheritance diagram for lsst.afw.display.rgb.AsinhMapping:
lsst.afw.display.rgb.Mapping

Public Member Functions

def __init__
 
def mapIntensityToUint8
 
- Public Member Functions inherited from lsst.afw.display.rgb.Mapping
def __init__
 Create a mapping. More...
 
def makeRgbImage
 Convert 3 arrays, imageR, imageG, and imageB into a numpy RGB image. More...
 
def intensity
 Return the total intensity from the red, blue, and green intensities. More...
 
def mapIntensityToUint8
 

Private Attributes

 _slope
 
 _soften
 

Detailed Description

A mapping for an asinh stretch (preserving colours independent of brightness)

x = asinh(Q (I - min)/range)/Q

This reduces to a linear stretch if Q == 0

See http://adsabs.harvard.edu/abs/2004PASP..116..133L

Definition at line 77 of file rgb.py.

Constructor & Destructor Documentation

def lsst.afw.display.rgb.AsinhMapping.__init__ (   self,
  min,
  range,
  Q 
)

Definition at line 87 of file rgb.py.

87 
88  def __init__(self, min, range, Q):
89  Mapping.__init__(self, min)
90 
91  epsilon = 1.0/2**23 # 32bit floating point machine epsilon; sys.float_info.epsilon is 64bit
92  if abs(Q) < epsilon:
93  Q = 0.1
94  else:
95  Qmax = 1e10
96  if Q > Qmax:
97  Q = Qmax
98 
99  if False:
100  self._slope = self._uint8Max/Q # gradient at origin is self._slope
101  else:
102  frac = 0.1 # gradient estimated using frac*range is _slope
103  self._slope = frac*self._uint8Max/np.arcsinh(frac*Q)
105  self._soften = Q/float(range);

Member Function Documentation

def lsst.afw.display.rgb.AsinhMapping.mapIntensityToUint8 (   self,
  I 
)

Definition at line 106 of file rgb.py.

107  def mapIntensityToUint8(self, I):
108  return np.where(I <= 0, 0, np.arcsinh(I*self._soften)*self._slope/I)

Member Data Documentation

lsst.afw.display.rgb.AsinhMapping._slope
private

Definition at line 99 of file rgb.py.

lsst.afw.display.rgb.AsinhMapping._soften
private

Definition at line 104 of file rgb.py.


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