summaryrefslogtreecommitdiff
path: root/wcsutil/wcscorr.py
diff options
context:
space:
mode:
authorhack <hack@stsci.edu>2011-04-23 16:25:14 -0400
committerhack <hack@stsci.edu>2011-04-23 16:25:14 -0400
commit6530910dc0f88dcd4daa710b8180d70f4040ccbe (patch)
tree076e5eeb1f30edea1366e02fed80496cac099077 /wcsutil/wcscorr.py
parent4f92dfbd2757dcc1a3ee92cd515ec5eb242dd8f9 (diff)
downloadstwcs_hcf-6530910dc0f88dcd4daa710b8180d70f4040ccbe.tar.gz
This update to the 'wcscorr' modele in STWCS.WCSUTIL fixes a problem with initializing the WCSCORR table, and in fact, the entire header by archiving the original WCS values if no WCS with wcskey='O' has already been created. This affects the usage of the 'init_wcscorr()' function.
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@12589 fe389314-cf27-0410-b35b-8c050e845b92
Diffstat (limited to 'wcsutil/wcscorr.py')
-rw-r--r--wcsutil/wcscorr.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/wcsutil/wcscorr.py b/wcsutil/wcscorr.py
index 4f5a05d..fae48ce 100644
--- a/wcsutil/wcscorr.py
+++ b/wcsutil/wcscorr.py
@@ -81,10 +81,10 @@ def init_wcscorr(input, force=False):
# Check to see whether or not there is an OPUS alternate WCS present,
# if so, get its values directly, otherwise, archive the PRIMARY WCS
# as the OPUS values in the WCSCORR table
- if 'O' in used_wcskeys:
- wkey = 'O'
- else:
- wkey = ' '
+ if 'O' not in used_wcskeys:
+ altwcs.archiveWCS(fimg,('SCI',extver),wcskey='O', wcsname='OPUS')
+ wkey = 'O'
+
wcs = stwcs.wcsutil.HSTWCS(fimg, ext=('SCI', extver), wcskey=wkey)
wcshdr = wcs.wcs2header(idc2hdr=idc2header)