diff options
author | dencheva <dencheva@stsci.edu> | 2010-07-14 16:33:07 -0400 |
---|---|---|
committer | dencheva <dencheva@stsci.edu> | 2010-07-14 16:33:07 -0400 |
commit | b1c0cae4cb1d23e69228ecb1da96dd8ac359c23d (patch) | |
tree | 18cabd15bfdf0d322524c630751c9843a76da93c /wcsutil/__init__.py | |
parent | 36281d4b8086a8488c113aaffaa9919c94573a6b (diff) | |
download | stwcs_hcf-b1c0cae4cb1d23e69228ecb1da96dd8ac359c23d.tar.gz |
Pywcs was changed not to set the WCS values for a default object (header is None) and these are the corresponing changes in wcsutil.And some other minor bug fixes.
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@9839 fe389314-cf27-0410-b35b-8c050e845b92
Diffstat (limited to 'wcsutil/__init__.py')
-rw-r--r-- | wcsutil/__init__.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/wcsutil/__init__.py b/wcsutil/__init__.py index 791f3aa..ee93668 100644 --- a/wcsutil/__init__.py +++ b/wcsutil/__init__.py @@ -52,7 +52,6 @@ class HSTWCS(WCS): self.instrument = hdr0['INSTRUME'] WCS.__init__(self, ehdr, fobj=phdu, minerr=minerr) - # If input was a pyfits HDUList object, it's the user's # responsibility to close it, otherwise, it's closed here. if not isinstance(fobj, pyfits.HDUList): @@ -67,8 +66,11 @@ class HSTWCS(WCS): # create a default HSTWCS object self.instrument = 'DEFAULT' WCS.__init__(self, minerr=minerr) + self.wcs.cd = np.array([[1.0, 0.0], [0.0, 1.0]], np.double) + self.wcs.crval = np.zeros((self.naxis,), np.double) + self.wcs.crpix = np.zeros((self.naxis,), np.double) + self.wcs.set() self.setInstrSpecKw() - self.setPscale() self.setOrient() @@ -178,6 +180,7 @@ class HSTWCS(WCS): cd22 = -cd11 cdmat = np.array([[cd11, cd12],[cd21,cd22]]) self.wcs.cd = cdmat * self.pscale/3600 + self.wcs.set() def readModel(self, update=False, header=None): @@ -283,7 +286,7 @@ class HSTWCS(WCS): cdl.append(card) h = pyfits.Header(cdl) - wprm = Wcsprm("".join([str(x) for x in h.ascardlist()])) + wprm = Wcsprm(str(h.ascardlist())) self.wcs = wprm self.setPscale() self.setOrient() |