File: simpleRGB.py

package info (click to toggle)
astlib 0.13.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,520 kB
  • sloc: ansic: 37,511; sed: 8,839; python: 3,881; makefile: 17
file content (30 lines) | stat: -rw-r--r-- 910 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env python
#File: simpleRGB/simpleRGB.py
#Created: Sat Dec 15 17:25:44 2012
#Last Change: Sat Dec 15 17:26:38 2012
# -*- coding: utf-8 -*-
#
# Simple RGB ImagePlot example

import numpy
import astropy.io.fits as pyfits
import pylab
from astLib import *

# Load the images - these have to be aligned to pixel and same pixel
# dimensions
rimg = pyfits.open("../../../testingData/stephanDSS2IR.fits")
gimg = pyfits.open("../../../testingData/stephanDSS2Red.fits")
bimg = pyfits.open("../../../testingData/stephanDSS2Blue.fits")
wcs = astWCS.WCS("../../../testingData/stephanDSS2Blue.fits")
r = rimg[0].data
g = gimg[0].data
b = bimg[0].data
rCut = [r.min(), r.max()]
gCut = [g.min(), g.max()]
bCut = [b.min(), b.max()]

# Make the figure
p = astPlots.ImagePlot([r, g, b], wcs, axes = [0.12, 0.12, 0.8, 0.8], cutLevels = [rCut, gCut, bCut],
    title="Stephan's Quintet")
p.save("output_simpleRGB.png")