diff options
author | dencheva <dencheva@stsci.edu> | 2014-05-01 17:36:36 -0400 |
---|---|---|
committer | dencheva <dencheva@stsci.edu> | 2014-05-01 17:36:36 -0400 |
commit | 2f4c246d0ff88b736f69679ddcab3c2d8257e281 (patch) | |
tree | a541ee75da584c60d624c7024b63e2c6b02d5e39 /stsci | |
parent | 7b04268af9bf0f2a7c29fcc53266fddec672793e (diff) | |
download | stsci.sphere-2f4c246d0ff88b736f69679ddcab3c2d8257e281.tar.gz |
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
Diffstat (limited to 'stsci')
-rw-r--r-- | stsci/sphere/polygon.py | 12 |
1 files changed, 5 insertions, 7 deletions
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): """ |