From b1c0cae4cb1d23e69228ecb1da96dd8ac359c23d Mon Sep 17 00:00:00 2001 From: dencheva Date: Wed, 14 Jul 2010 20:33:07 +0000 Subject: 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 --- wcsutil/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'wcsutil/__init__.py') 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() -- cgit