LSST Applications g180d380827+46ec7ae9a6,g2079a07aa2+86d27d4dc4,g2305ad1205+561f0b4c6e,g2bbee38e9b+c6a8a0fb72,g337abbeb29+c6a8a0fb72,g33d1c0ed96+c6a8a0fb72,g3a166c0a6a+c6a8a0fb72,g3d1719c13e+4b175340dc,g3ddfee87b4+e72d28e2d1,g487adcacf7+2f6f39ce3c,g50ff169b8f+96c6868917,g52b1c1532d+585e252eca,g591dd9f2cf+a10213cc50,g62aa8f1a4b+bf10eb883e,g858d7b2824+4b175340dc,g991b906543+4b175340dc,g99cad8db69+af57a9dece,g9c22b2923f+e2510deafe,g9ddcbc5298+9a081db1e4,g9fbc5161f1+30b2b595e6,ga1e77700b3+03d07e1c1f,gb0e22166c9+60f28cb32d,gb23b769143+4b175340dc,gba4ed39666+c2a2e4ac27,gbb8dafda3b+6155d6700f,gbd998247f1+585e252eca,gbeadb96d05+67a36bdf6a,gc120e1dc64+7a34493dbd,gc28159a63d+c6a8a0fb72,gc3e9b769f7+95821ff628,gcf0d15dbbd+e72d28e2d1,gdaeeff99f8+f9a426f77a,ge6526c86ff+3d1b9a9f4a,ge79ae78c31+c6a8a0fb72,gee10cc3b42+585e252eca,w.2024.18
LSST Data Management Base Package
Loading...
Searching...
No Matches
Classes | Functions
lsst.ip.isr.isrQa Namespace Reference

Classes

class  IsrQaConfig
 
class  IsrQaFlatnessConfig
 

Functions

 makeThumbnail (exposure, isrQaConfig=None)
 

Function Documentation

◆ makeThumbnail()

lsst.ip.isr.isrQa.makeThumbnail ( exposure,
isrQaConfig = None )
Create a snapshot thumbnail from input exposure.

The output thumbnail image is constructed based on the parameters
in the configuration file.  Currently, the asinh mapping is the
only mapping method used.

Parameters
----------
exposure : `lsst.afw.image.Exposure`
    The exposure to be converted into a thumbnail.
isrQaConfig : `Config`
    Configuration object containing all parameters to control the
    thumbnail generation.

Returns
-------
rgbImage : `numpy.ndarray`
    Binned and scaled version of the exposure, converted to an
    integer array to allow it to be written as PNG.

Definition at line 119 of file isrQa.py.

119def makeThumbnail(exposure, isrQaConfig=None):
120 """Create a snapshot thumbnail from input exposure.
121
122 The output thumbnail image is constructed based on the parameters
123 in the configuration file. Currently, the asinh mapping is the
124 only mapping method used.
125
126 Parameters
127 ----------
128 exposure : `lsst.afw.image.Exposure`
129 The exposure to be converted into a thumbnail.
130 isrQaConfig : `Config`
131 Configuration object containing all parameters to control the
132 thumbnail generation.
133
134 Returns
135 -------
136 rgbImage : `numpy.ndarray`
137 Binned and scaled version of the exposure, converted to an
138 integer array to allow it to be written as PNG.
139 """
140 if isrQaConfig is not None:
141 binning = isrQaConfig.thumbnailBinning
142 binnedImage = afwMath.binImage(exposure.getMaskedImage(), binning, binning, afwMath.MEAN)
143
144 statsCtrl = afwMath.StatisticsControl()
145 statsCtrl.setAndMask(binnedImage.getMask().getPlaneBitMask(["SAT", "BAD", "INTRP"]))
146 stats = afwMath.makeStatistics(binnedImage,
147 afwMath.MEDIAN | afwMath.STDEVCLIP | afwMath.MAX, statsCtrl)
148
149 low = stats.getValue(afwMath.MEDIAN) - isrQaConfig.thumbnailStdev*stats.getValue(afwMath.STDEVCLIP)
150
151 if isrQaConfig.thumbnailSatBorder:
152 afwRGB.replaceSaturatedPixels(binnedImage, binnedImage, binnedImage,
153 isrQaConfig.thumbnailSatBorder, stats.getValue(afwMath.MAX))
154
155 asinhMap = afwRGB.AsinhMapping(low, isrQaConfig.thumbnailRange, Q=isrQaConfig.thumbnailQ)
156 rgbImage = asinhMap.makeRgbImage(binnedImage)
157
158 return rgbImage
Pass parameters to a Statistics object.
Definition Statistics.h:83
Statistics makeStatistics(lsst::afw::image::Image< Pixel > const &img, lsst::afw::image::Mask< image::MaskPixel > const &msk, int const flags, StatisticsControl const &sctrl=StatisticsControl())
Handle a watered-down front-end to the constructor (no variance)
Definition Statistics.h:361
std::shared_ptr< ImageT > binImage(ImageT const &inImage, int const binX, int const binY, lsst::afw::math::Property const flags=lsst::afw::math::MEAN)
Definition binImage.cc:44