mViewer and Python (beta)

Python mViewer: Full Color

If you have multiple images at different wavelengths, it is often useful to combine them as blue, green and red channels in a "full color" composite. The Montage toolkit contains all the functionality necessary to reproject/resample images to a common frame (matched WCS). See the mViewer documents for more details.

    import astroMontage.mViewer as mv
    viewer = mv.mViewer()
    viewer.set_red_stretch("0.1s", "max", "gaussian-log")
    viewer.set_green_stretch("0.1s", "max", "gaussian-log")
    viewer.set_blue_stretch("0.1s", "max", "gaussian-log")

    Each image is stretched separately. We could have left the stretch at its default setting but in this case that would have resulted in a washed-out background.

Click image to view full resolution in a new tab.

The pseudo-color table used in the previous example is meaningless in this context and will be ignored. mViewer actually maintains information about a grayscale image and the three (blue, green, red) images separately and there is a command ("viewer.setDisplayMode('color') or 'grayscale') for switching between them. Usually, the user intent is clear and mViewer chooses an appropriate mode based on the setup calls.