summaryrefslogtreecommitdiff
path: root/lib/stwcs/updatewcs/utils.py
diff options
context:
space:
mode:
authorhack <hack@stsci.edu>2011-11-15 16:37:46 -0500
committerhack <hack@stsci.edu>2011-11-15 16:37:46 -0500
commitc3a8a79697b724cb51c955c0f52046036f7f6139 (patch)
treede9731fa3368d28b721ee245d2923c018d5f93ac /lib/stwcs/updatewcs/utils.py
parentf76a85324095382f99c02ab5a6663f295acd09cd (diff)
downloadstwcs_hcf-c3a8a79697b724cb51c955c0f52046036f7f6139.tar.gz
Fixes a bug in the creation of headerlets without NPOLFILE or D2IMFILE. This was found by Ray when running 'tweakreg' on ACS/HRC data, with the problem and subsequent fix being verified using ACS/HRC dither box data.
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@14014 fe389314-cf27-0410-b35b-8c050e845b92
Diffstat (limited to 'lib/stwcs/updatewcs/utils.py')
-rw-r--r--lib/stwcs/updatewcs/utils.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/stwcs/updatewcs/utils.py b/lib/stwcs/updatewcs/utils.py
index 460ddb3..4a00fb2 100644
--- a/lib/stwcs/updatewcs/utils.py
+++ b/lib/stwcs/updatewcs/utils.py
@@ -69,7 +69,7 @@ def construct_distname(fobj,wcsobj):
"""
idcname = extract_rootname(fobj[0].header.get('IDCTAB', "NONE"),
suffix='_idc')
- if idcname is None and wcsobj.sip is not None:
+ if (idcname is None or idcname=='NONE') and wcsobj.sip is not None:
idcname = 'UNKNOWN'
npolname = build_npolname(fobj)
@@ -122,6 +122,8 @@ def build_sipname(fobj):
def build_npolname(fobj):
try:
npolfile = extract_rootname(fobj[0].header["NPOLFILE"],suffix='_npl')
+ if npolfile == 'NONE':
+ npolfile = 'NOMODEL'
except KeyError:
if fileutil.countExtn(fobj, 'WCSDVARR'):
npolfile = 'UNKNOWN'
@@ -132,6 +134,8 @@ def build_npolname(fobj):
def build_d2imname(fobj):
try:
d2imfile = extract_rootname(fobj[0].header["D2IMFILE"],suffix='_d2i')
+ if d2imfile == 'NONE':
+ d2imfile = 'NOMODEL'
except KeyError:
if fileutil.countExtn(fobj, 'D2IMARR'):
d2imfile = 'UNKNOWN'