From b5aa57596c5ed16e58f59c4d0602ab72a198c94c Mon Sep 17 00:00:00 2001 From: hack Date: Mon, 30 Dec 2013 17:06:12 +0000 Subject: 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 --- lib/stwcs/updatewcs/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/stwcs/updatewcs') 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): -- cgit