summaryrefslogtreecommitdiff
path: root/hstwcs/det2im.py
diff options
context:
space:
mode:
authordencheva <dencheva@stsci.edu>2009-04-28 17:07:43 -0400
committerdencheva <dencheva@stsci.edu>2009-04-28 17:07:43 -0400
commit3b873f14d1ec709fe6df3ab053ecff3f363c7510 (patch)
tree4627d70f41ade03c3eafbe6a580be9847080f78e /hstwcs/det2im.py
parent9b7a13403e5ba2039a0f66682ad609d9fb2c685b (diff)
downloadstwcs_hcf-3b873f14d1ec709fe6df3ab053ecff3f363c7510.tar.gz
These changes allow the HSTWCS object ot be used for transformations and when updating the headers
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/development/trunk/updatewcs@7974 fe389314-cf27-0410-b35b-8c050e845b92
Diffstat (limited to 'hstwcs/det2im.py')
-rw-r--r--hstwcs/det2im.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/hstwcs/det2im.py b/hstwcs/det2im.py
index 164eff6..90c9f28 100644
--- a/hstwcs/det2im.py
+++ b/hstwcs/det2im.py
@@ -20,7 +20,7 @@ class DET2IMCorr(object):
else:
new_kw = {'D2IMEXT': d2imfile, 'AXISCORR': axiscorr, 'D2IMERR': d2imerr}
cls.applyDet2ImCorr(fobj, axiscorr)
- return new_kw
+ cls.updatehdr(fobj, new_kw)
updateWCS = classmethod(updateWCS)
@@ -135,4 +135,21 @@ class DET2IMCorr(object):
return hdr
createDet2ImHdr = classmethod(createDet2ImHdr)
+
+ def updatehdr(cls, fobj, kwdict):
+ """
+ Update extension headers to keep record of the files used for the
+ detector to image correction.
+ """
+ for ext in fobj:
+ try:
+ extname = ext.header['EXTNAME'].lower()
+ except KeyError:
+ continue
+ if extname == 'sci':
+ for kw in kwdict:
+ ext.header.update(kw, kwdict[kw])
+ else:
+ continue
+ updatehdr = classmethod(updatehdr)
\ No newline at end of file