Exemple #1
0
    def test_AsinhZscaleIntensityBW(self):
        """Test creating a black-and-white image using an asinh stretch estimated
        using zscale on the intensity"""

        map = lupton_rgb.AsinhZScaleMapping(self.image_r)
        rgbImage = map.make_rgb_image(self.image_r, self.image_r, self.image_r)
        if display:
            display_rgb(rgbImage, title=sys._getframe().f_code.co_name)
Exemple #2
0
    def test_AsinhZscale(self):
        """Test creating an RGB image using an asinh stretch estimated using zscale"""

        map = lupton_rgb.AsinhZScaleMapping(self.image_r, self.image_g,
                                            self.image_b)
        rgbImage = map.make_rgb_image(self.image_r, self.image_g, self.image_b)
        if display:
            display_rgb(rgbImage, title=sys._getframe().f_code.co_name)
Exemple #3
0
    def test_AsinhZscaleIntensityPedestal(self):
        """Test creating an RGB image using an asinh stretch estimated using zscale on the intensity
        where the images each have a pedestal added"""

        pedestal = [100, 400, -400]
        self.image_r += pedestal[0]
        self.image_g += pedestal[1]
        self.image_b += pedestal[2]

        map = lupton_rgb.AsinhZScaleMapping(self.image_r,
                                            self.image_g,
                                            self.image_b,
                                            pedestal=pedestal)
        rgbImage = map.make_rgb_image(self.image_r, self.image_g, self.image_b)
        if display:
            display_rgb(rgbImage, title=sys._getframe().f_code.co_name)
Exemple #4
0
def make_rgb(rimage, gimage, bimage):

    mr = max(rimage.flatten())

    mg = max(gimage.flatten())

    mb = max(bimage.flatten())

    minval = min(min((rimage / mr).flatten()), min((gimage / mg).flatten()),
                 min((bimage / mb).flatten()))

    maxval = max(max((rimage / mr).flatten()), max((gimage / mg).flatten()),
                 max((bimage / mb).flatten()))

    map = lupton_rgb.AsinhZScaleMapping(rimage, gimage, bimage)

    color_image = map.make_rgb_image(rimage, gimage, bimage)
    return color_image