summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorhack <hack@stsci.edu>2015-12-17 16:01:01 -0500
committerhack <hack@stsci.edu>2015-12-17 16:01:01 -0500
commit78247ad8d839b7f63280a925e5a4e6c8e2a72e95 (patch)
treef3147447801d42ed62c28c0c403ac5c1bff48d63 /lib
parent5cda820feea23fa5075badb3bb6d13ab4390f4da (diff)
downloadstwcs_hcf-78247ad8d839b7f63280a925e5a4e6c8e2a72e95.tar.gz
STWCS v1.2.3dev: Added wfpc2_dgeo module to updatewcs in order to integrate the conversion of WFPC2 DGEOFILEs into D2IMFILEs when running updatewcs. This functionality has been moved from DrizzlePac v2.1.0rev47111 to get all operations to run in the correct order while keeping updatewcs and astrodrizzle/tweakreg functionality separated. WJH
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stwcs/branches/opus_2015_3dms@47113 fe389314-cf27-0410-b35b-8c050e845b92
Diffstat (limited to 'lib')
-rw-r--r--lib/stwcs/updatewcs/apply_corrections.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/stwcs/updatewcs/apply_corrections.py b/lib/stwcs/updatewcs/apply_corrections.py
index 74feb82..86b623a 100644
--- a/lib/stwcs/updatewcs/apply_corrections.py
+++ b/lib/stwcs/updatewcs/apply_corrections.py
@@ -1,4 +1,4 @@
-from __future__ import division, print_function # confidence high
+from __future__ import division, print_function # confidence high
import os
from astropy.io import fits
@@ -7,6 +7,7 @@ from stsci.tools import fileutil
import os.path
from stwcs.wcsutil import altwcs
from . import utils
+from . import wfpc2_dgeo
import logging
logger = logging.getLogger("stwcs.updatewcs.apply_corrections")
@@ -42,6 +43,11 @@ def setCorrections(fname, vacorr=True, tddcorr=True, npolcorr=True, d2imcorr=Tru
# make a copy of this list !
acorr = allowed_corrections[instrument][:]
+ # For WFPC2 images, the old-style DGEOFILE needs to be
+ # converted on-the-fly into a proper D2IMFILE here...
+ if instrument == 'WFPC2':
+ # check for DGEOFILE, and convert it to D2IMFILE if found
+ d2imfile = wfpc2_dgeo.update_wfpc2_d2geofile(fname)
# Check if idctab is present on disk
# If kw IDCTAB is present in the header but the file is
# not found on disk, do not run TDDCorr, MakeCWS and CompSIP