lsst.pipe.tasks g253578fa50+e0a50b457a
Loading...
Searching...
No Matches
lsst.pipe.tasks._fallback_asinhmapping.AsinhMapping Class Reference
Inheritance diagram for lsst.pipe.tasks._fallback_asinhmapping.AsinhMapping:
lsst.pipe.tasks._fallback_asinhmapping.Mapping

Public Member Functions

 __init__ (self, minimum, stretch, Q=8)
 
 map_intensity_to_uint8 (self, I)
 
 make_rgb_image (self, image_r, image_g, image_b)
 
 intensity (self, image_r, image_g, image_b)
 

Public Attributes

 minimum = minimum
 

Protected Member Functions

 _convert_images_to_uint8 (self, image_r, image_g, image_b)
 

Protected Attributes

 _slope = frac * self._uint8Max / np.arcsinh(frac * Q)
 
 _soften = Q / float(stretch)
 
 _uint8Max = float(np.iinfo(np.uint8).max)
 
 _image = np.asarray(image)
 

Detailed Description

A mapping for an asinh stretch (preserving colours independent of brightness).
x = asinh(Q (I - minimum)/stretch)/Q
This reduces to a linear stretch if Q == 0
See https://ui.adsabs.harvard.edu/abs/2004PASP..116..133L
Parameters
----------
minimum : float
    Intensity that should be mapped to black (a scalar or array for R, G, B).
stretch : float
    The linear stretch of the image.
Q : float
    The asinh softening parameter.

Definition at line 189 of file _fallback_asinhmapping.py.

Constructor & Destructor Documentation

◆ __init__()

lsst.pipe.tasks._fallback_asinhmapping.AsinhMapping.__init__ ( self,
minimum,
stretch,
Q = 8 )

Definition at line 205 of file _fallback_asinhmapping.py.

Member Function Documentation

◆ _convert_images_to_uint8()

lsst.pipe.tasks._fallback_asinhmapping.Mapping._convert_images_to_uint8 ( self,
image_r,
image_g,
image_b )
protectedinherited
Use the mapping to convert images image_r, image_g, and image_b to a triplet of uint8 images.

Definition at line 99 of file _fallback_asinhmapping.py.

◆ intensity()

lsst.pipe.tasks._fallback_asinhmapping.Mapping.intensity ( self,
image_r,
image_g,
image_b )
inherited
Return the total intensity from the red, blue, and green intensities.
This is a naive computation, and may be overridden by subclasses.
Parameters
----------
image_r : ndarray
    Intensity of image to be mapped to red; or total intensity if
    ``image_g`` and ``image_b`` are None.
image_g : ndarray, optional
    Intensity of image to be mapped to green.
image_b : ndarray, optional
    Intensity of image to be mapped to blue.
Returns
-------
intensity : ndarray
    Total intensity from the red, blue and green intensities, or
    ``image_r`` if green and blue images are not provided.

Definition at line 60 of file _fallback_asinhmapping.py.

◆ make_rgb_image()

lsst.pipe.tasks._fallback_asinhmapping.Mapping.make_rgb_image ( self,
image_r,
image_g,
image_b )
inherited
Convert 3 arrays, image_r, image_g, and image_b into an 8-bit RGB image.
Parameters
----------
image_r : ndarray
    Image to map to red.
image_g : ndarray
    Image to map to green.
image_b : ndarray
    Image to map to blue.
Returns
-------
RGBimage : ndarray
    RGB (integer, 8-bits per channel) color image as an NxNx3 numpy array.

Definition at line 32 of file _fallback_asinhmapping.py.

◆ map_intensity_to_uint8()

lsst.pipe.tasks._fallback_asinhmapping.AsinhMapping.map_intensity_to_uint8 ( self,
I )
Return an array which, when multiplied by an image, returns that image
mapped to the range of a uint8, [0, 255] (but not converted to uint8).
The intensity is assumed to have had minimum subtracted (as that can be
done per-band).
Parameters
----------
I : ndarray
    Intensity to be mapped.
Returns
-------
mapped_I : ndarray
    ``I`` mapped to uint8

Reimplemented from lsst.pipe.tasks._fallback_asinhmapping.Mapping.

Definition at line 222 of file _fallback_asinhmapping.py.

Member Data Documentation

◆ _image

lsst.pipe.tasks._fallback_asinhmapping.Mapping._image = np.asarray(image)
protectedinherited

Definition at line 30 of file _fallback_asinhmapping.py.

◆ _slope

lsst.pipe.tasks._fallback_asinhmapping.AsinhMapping._slope = frac * self._uint8Max / np.arcsinh(frac * Q)
protected

Definition at line 218 of file _fallback_asinhmapping.py.

◆ _soften

lsst.pipe.tasks._fallback_asinhmapping.AsinhMapping._soften = Q / float(stretch)
protected

Definition at line 220 of file _fallback_asinhmapping.py.

◆ _uint8Max

lsst.pipe.tasks._fallback_asinhmapping.Mapping._uint8Max = float(np.iinfo(np.uint8).max)
protectedinherited

Definition at line 20 of file _fallback_asinhmapping.py.

◆ minimum

lsst.pipe.tasks._fallback_asinhmapping.Mapping.minimum = minimum
inherited

Definition at line 29 of file _fallback_asinhmapping.py.


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