From e646fadec3123a2c3f837f9a2d0cb56c01dcb765 Mon Sep 17 00:00:00 2001 From: hack Date: Fri, 9 Nov 2012 15:58:21 +0000 Subject: Minor change to insure that NPOL WCSDVARR extensions ALWAYS get written out as Float32 datatype, as some NPOL file reference files may have Float64 input arrays which cause PyWCS to choke. git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@20341 fe389314-cf27-0410-b35b-8c050e845b92 --- lib/stwcs/updatewcs/npol.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'lib/stwcs/updatewcs/npol.py') diff --git a/lib/stwcs/updatewcs/npol.py b/lib/stwcs/updatewcs/npol.py index 537cda3..2c90611 100644 --- a/lib/stwcs/updatewcs/npol.py +++ b/lib/stwcs/updatewcs/npol.py @@ -138,11 +138,11 @@ class NPOLCorr(object): dpaxis1 = 'DP%s.' %j+'AXIS.1' dpaxis2 = 'DP%s.' %j+'AXIS.2' keys = [cperror, cpdis, dpext, dpnaxes, dpaxis1, dpaxis2] - values = {cperror: error_val, - cpdis: 'Lookup', - dpext: wdvarr_ver, + values = {cperror: error_val, + cpdis: 'Lookup', + dpext: wdvarr_ver, dpnaxes: 2, - dpaxis1: 1, + dpaxis1: 1, dpaxis2: 2} comments = {cperror: 'Maximum error of NPOL correction for axis %s' % j, @@ -187,7 +187,7 @@ class NPOLCorr(object): """ Transform the NPOL data arrays for use with SIP """ - ndx, ndy = np.dot(coeffs, [dx.ravel(), dy.ravel()]) + ndx, ndy = np.dot(coeffs, [dx.ravel(), dy.ravel()]).astype(np.float32) ndx.shape = dx.shape ndy.shape=dy.shape return ndx, ndy @@ -336,4 +336,3 @@ class NPOLCorr(object): return ccdchip get_ccdchip = classmethod(get_ccdchip) - -- cgit