summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordencheva <dencheva@stsci.edu>2010-03-15 17:19:07 -0400
committerdencheva <dencheva@stsci.edu>2010-03-15 17:19:07 -0400
commitb63fb3b5ae1dca33cf5dc77a0e879b44b9adc22d (patch)
treeb95a729523e4c350eea5d7493d894be6507ef0f5
parent99f434a972afb4db89eafa7f134e9af752571b9c (diff)
downloadstwcs_hcf-b63fb3b5ae1dca33cf5dc77a0e879b44b9adc22d.tar.gz
CDELT is the stepsize of the subsampled full-size dgeo file and is recorded in the header of the npl file. It is copied from there to the WCSDVARR extension header.
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@8912 fe389314-cf27-0410-b35b-8c050e845b92
-rw-r--r--updatewcs/__init__.py2
-rw-r--r--updatewcs/dgeo.py22
2 files changed, 11 insertions, 13 deletions
diff --git a/updatewcs/__init__.py b/updatewcs/__init__.py
index 282d6c9..b1d88d4 100644
--- a/updatewcs/__init__.py
+++ b/updatewcs/__init__.py
@@ -14,7 +14,7 @@ import apply_corrections
__docformat__ = 'restructuredtext'
-__version__ = '0.4'
+__version__ = '0.5'
def updatewcs(input, vacorr=True, tddcorr=True, dgeocorr=True, d2imcorr=True, checkfiles=True):
"""
diff --git a/updatewcs/dgeo.py b/updatewcs/dgeo.py
index 63d5f52..2fca578 100644
--- a/updatewcs/dgeo.py
+++ b/updatewcs/dgeo.py
@@ -69,9 +69,10 @@ class DGEOCorr(object):
# get the data arrays from the reference file and transform them for use with SIP
dx,dy = cls.getData(nplfile, ccdchip)
idccoeffs = cls.getIDCCoeffs(header)
+ """
if idccoeffs != None:
dx, dy = cls.transformData(dx,dy, idccoeffs)
-
+ """
# Determine EXTVER for the WCSDVARR extension from the NPL file (EXTNAME, EXTVER) kw.
# This is used to populate DPj.EXTVER kw
wcsdvarr_x_version = 2 * extversion -1
@@ -237,10 +238,11 @@ class DGEOCorr(object):
ccdchip = nplextname #dgeo_header['CCDCHIP']
kw = { 'NAXIS': 'Size of the axis',
- 'CRPIX': 'Coordinate system reference pixel',
- 'CRVAL': 'Coordinate system value at reference pixel',
- 'CDELT': 'Coordinate increment along axis'}
-
+ 'CDELT': 'Coordinate increment along axis',
+ 'CRPIX': 'Coordinate system reference pixel',
+ 'CRVAL': 'Coordinate system value at reference pixel',
+ }
+
kw_comm1 = {}
kw_val1 = {}
for key in kw.keys():
@@ -251,13 +253,9 @@ class DGEOCorr(object):
for i in range(1, naxis+1):
si = str(i)
kw_val1['NAXIS'+si] = npol_header.get('NAXIS'+si)
- cdelt = (float(npol_header.get('ONAXIS'+si))/ ((kw_val1['NAXIS'+si]-1) * binned))
- kw_val1['CDELT'+si] = cdelt
- if cdelt == 0: cdelt = 1.0
- kw_val1['CRPIX'+si] = (kw_val1['NAXIS'+si]-1)/2. + 1/cdelt
- kw_val1['CRVAL'+si] = (npol_header.get('ONAXIS'+si)/2. + \
- sciheader.get('LTV'+si, 0.)) / binned
-
+ kw_val1['CDELT'+si] = npol_header.get('CDELT'+si, 1.0)
+ kw_val1['CRPIX'+si] = npol_header.get('CRPIX'+si, 0.0)
+ kw_val1['CRVAL'+si] = npol_header.get('CRVAL'+si, 0.0)
kw_comm0 = {'XTENSION': 'Image extension',
'BITPIX': 'IEEE floating point',