summaryrefslogtreecommitdiff
path: root/hstwcs/__init__.py
diff options
context:
space:
mode:
authordencheva <dencheva@stsci.edu>2009-03-17 16:35:57 -0400
committerdencheva <dencheva@stsci.edu>2009-03-17 16:35:57 -0400
commit0bc834376d0e7cb66c1b7f5e27d14402b84235d9 (patch)
treea2c8d2c80b33c79d7da2d872dabe22a89f24cbca /hstwcs/__init__.py
parent2f388a86de97f76640063aa521389bdd5ddf2ee6 (diff)
downloadstwcs_hcf-0bc834376d0e7cb66c1b7f5e27d14402b84235d9.tar.gz
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
Diffstat (limited to 'hstwcs/__init__.py')
-rw-r--r--hstwcs/__init__.py9
1 files changed, 7 insertions, 2 deletions
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: