From 0bc834376d0e7cb66c1b7f5e27d14402b84235d9 Mon Sep 17 00:00:00 2001 From: dencheva Date: Tue, 17 Mar 2009 20:35:57 +0000 Subject: Added code which populates the science file with information about detector to image correction - header keywords and a lookup table extension. Cleaned coed. git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/development/trunk/updatewcs@7770 fe389314-cf27-0410-b35b-8c050e845b92 --- hstwcs/__init__.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'hstwcs/__init__.py') diff --git a/hstwcs/__init__.py b/hstwcs/__init__.py index 926d4c3..8b83e1e 100644 --- a/hstwcs/__init__.py +++ b/hstwcs/__init__.py @@ -6,7 +6,7 @@ from updatewcs.wcsutil import HSTWCS #from .. mappings import allowed_corrections from updatewcs import utils import corrections, makewcs -import dgeo +import dgeo, det2im import time from pytools import parseinput, fileutil import apply_corrections @@ -80,6 +80,11 @@ def makecorr(fname, allowed_corr): ref_wcs = HSTWCS(fobj=f, ext=nrefext) ref_wcs.readModel(update=True,header=f[nrefext].header) utils.write_archive(f[nrefext].header) + + if 'DET2IMCorr' in 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:]: # Perhaps all ext headers should be corrected (to be consistent) @@ -91,7 +96,7 @@ def makecorr(fname, allowed_corr): ext_wcs = HSTWCS(fobj=f, ext=i) ext_wcs.readModel(update=True,header=hdr) for c in allowed_corr: - if c != 'DGEOCorr': + if c != 'DGEOCorr' and c != 'DET2IMCorr': corr_klass = corrections.__getattribute__(c) kw2update = corr_klass.updateWCS(ext_wcs, ref_wcs) for kw in kw2update: -- cgit