From c3f5a3514eff40b3aa178b2996d997a98f03cee0 Mon Sep 17 00:00:00 2001 From: hack Date: Fri, 18 Dec 2015 15:52:00 +0000 Subject: Logic for setting D2IMFILE has been revised to allow updatewcs to be run multiple times without causing problems. In this case, D2IMFILE only gets set if DGEOFILE needs to be changed or D2IMFILE is not there already. git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stwcs/trunk@47227 fe389314-cf27-0410-b35b-8c050e845b92 --- lib/stwcs/updatewcs/wfpc2_dgeo.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/stwcs/updatewcs/wfpc2_dgeo.py') diff --git a/lib/stwcs/updatewcs/wfpc2_dgeo.py b/lib/stwcs/updatewcs/wfpc2_dgeo.py index d2d03ef..884bd7e 100644 --- a/lib/stwcs/updatewcs/wfpc2_dgeo.py +++ b/lib/stwcs/updatewcs/wfpc2_dgeo.py @@ -52,7 +52,8 @@ def update_wfpc2_d2geofile(filename, fhdu=None): else: d2imfile = None fhdu['PRIMARY'].header['DGEOFILE'] = 'N/A' - fhdu['PRIMARY'].header['D2IMFILE'] = 'N/A' + if 'D2IMFILE' not in fhdu['PRIMARY'].header: + fhdu['PRIMARY'].header['D2IMFILE'] = 'N/A' # Only close the file handle if opened in this function if close_fhdu: -- cgit