File: contourTest.py

package info (click to toggle)
astlib 0.13.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,520 kB
  • sloc: ansic: 37,511; sed: 8,839; python: 3,879; makefile: 17
file content (32 lines) | stat: -rw-r--r-- 826 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
31
32
#!/usr/bin/env python
#File: contourTest/contourTest.py
#Created: Sat Dec 15 17:04:57 2012
#Last Change: Sat Dec 15 17:05:29 2012
# -*- coding: utf-8 -*-
#
# Test of contour plot

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

TEST_IMAGE = "../../../testingData/testImage2.fits"
TEST_CONTOUR_IMAGE = "../../../testingData/testXRayImage.fits"

img = pyfits.open(TEST_IMAGE)
wcs = astWCS.WCS(TEST_IMAGE)
d = img[0].data

ximg = pyfits.open(TEST_CONTOUR_IMAGE)
xwcs = astWCS.WCS(TEST_CONTOUR_IMAGE)
xd = ximg[0].data

f = astPlots.ImagePlot(d, wcs, axesLabels='decimal')

cLevels = ['log', numpy.median(xd.flatten()), xd.max(), 10]

f.addContourOverlay(xd, xwcs, 'xmm', levels=cLevels, smooth=5.0, color='cyan',
            width=1, highAccuracy=False)
f.draw()
f.save("output_contourTest.png")