summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhack <hack@stsci.edu>2013-12-30 12:06:12 -0500
committerhack <hack@stsci.edu>2013-12-30 12:06:12 -0500
commitb5aa57596c5ed16e58f59c4d0602ab72a198c94c (patch)
treefba8acaa6f7c28a032979eff44711faeaed82a37
parentc84fc2a5698f4a4b25564c9bbd0cf21eb65ea467 (diff)
downloadstwcs_hcf-b5aa57596c5ed16e58f59c4d0602ab72a198c94c.tar.gz
STWCS.updatewcs update to insure that NEXTEND keyword (if already present in primary header) remains consistent with full size of FITS file after updates.
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stwcs/trunk@28704 fe389314-cf27-0410-b35b-8c050e845b92
-rw-r--r--lib/stwcs/updatewcs/__init__.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/stwcs/updatewcs/__init__.py b/lib/stwcs/updatewcs/__init__.py
index 43f572b..a0e39f6 100644
--- a/lib/stwcs/updatewcs/__init__.py
+++ b/lib/stwcs/updatewcs/__init__.py
@@ -122,7 +122,7 @@ def makecorr(fname, allowed_corr):
kw2update = det2im.DET2IMCorr.updateWCS(f)
for kw in kw2update:
f[1].header.update(kw, kw2update[kw])
-
+
for i in range(len(f))[1:]:
extn = f[i]
@@ -192,6 +192,8 @@ def makecorr(fname, allowed_corr):
distdict = utils.construct_distname(f,rwcs)
f[0].header['DISTNAME'] = distdict['DISTNAME']
f[0].header['SIPNAME'] = distdict['SIPNAME']
+ # Make sure NEXTEND keyword remains accurate
+ f[0].header['NEXTEND'] = len(f)-1
f.close()
def copyWCS(w, ehdr):