diff options
-rw-r--r-- | lib/stwcs/updatewcs/__init__.py | 4 |
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): |