From 78247ad8d839b7f63280a925e5a4e6c8e2a72e95 Mon Sep 17 00:00:00 2001 From: hack Date: Thu, 17 Dec 2015 21:01:01 +0000 Subject: 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 --- lib/stwcs/updatewcs/apply_corrections.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib') 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 -- cgit