From 2f4c246d0ff88b736f69679ddcab3c2d8257e281 Mon Sep 17 00:00:00 2001 From: dencheva Date: Thu, 1 May 2014 21:36:36 +0000 Subject: further changes to move to astropy git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci.sphere/trunk@31268 fe389314-cf27-0410-b35b-8c050e845b92 Former-commit-id: 1200f37b1166f35ab4f24774462fbe4ee291fe08 --- stsci/sphere/polygon.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'stsci/sphere/polygon.py') diff --git a/stsci/sphere/polygon.py b/stsci/sphere/polygon.py index 1dc33cd..06f6b80 100644 --- a/stsci/sphere/polygon.py +++ b/stsci/sphere/polygon.py @@ -239,11 +239,11 @@ class SphericalPolygon(object): Create a new `SphericalPolygon` from the footprint of a FITS WCS specification. - This method requires having `pywcs` and `pyfits` installed. + This method requires having `astropy` installed. Parameters ---------- - fitspath : path to a FITS file, `pyfits.Header`, or `pywcs.WCS` + fitspath : path to a FITS file, `astropy.io.fits.Header`, or `astropy.wcs.WCS` Refers to a FITS header containing a WCS specification. steps : int, optional @@ -254,12 +254,10 @@ class SphericalPolygon(object): ------- polygon : `SphericalPolygon` object """ - #import pywcs - #import pyfits from astropy import wcs as pywcs - from astropy.io import fits as pyfits + from astropy.io import fits - if isinstance(fitspath, pyfits.Header): + if isinstance(fitspath, fits.Header): header = fitspath wcs = pywcs.WCS(header) elif isinstance(fitspath, pywcs.WCS): @@ -296,7 +294,7 @@ class SphericalPolygon(object): ra, dec = wcs.all_pix2world(xa / 2.0, ya / 2.0, 1) xc, yc, zc = vector.radec_to_vector(ra, dec) - return cls(np.dstack((x, y, z))[0], (xc[0], yc[0], zc[0])) + return cls(np.dstack((x, y, z))[0], (xc, yc, zc)) def _unique_points(self): """ -- cgit