summaryrefslogtreecommitdiff
path: root/lib/stwcs/updatewcs/wfpc2_dgeo.py
diff options
context:
space:
mode:
authorhack <hack@stsci.edu>2015-12-18 10:52:00 -0500
committerhack <hack@stsci.edu>2015-12-18 10:52:00 -0500
commitc3f5a3514eff40b3aa178b2996d997a98f03cee0 (patch)
tree66ea7ed5c190df8d23d1d7bf8f14af2c2c39273d /lib/stwcs/updatewcs/wfpc2_dgeo.py
parentd6432457220db0693499cca272c33081c880d69c (diff)
downloadstwcs_hcf-c3f5a3514eff40b3aa178b2996d997a98f03cee0.tar.gz
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
Diffstat (limited to 'lib/stwcs/updatewcs/wfpc2_dgeo.py')
-rw-r--r--lib/stwcs/updatewcs/wfpc2_dgeo.py3
1 files changed, 2 insertions, 1 deletions
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: