summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhack <hack@stsci.edu>2012-01-30 16:52:50 -0500
committerhack <hack@stsci.edu>2012-01-30 16:52:50 -0500
commit0e34a376d4440655b7d4cb05ed9bca70f7d2ec56 (patch)
treef2bdcb36aac7b935ac35a23f8dee34ad348ae86e
parent8f3235bba033064c7f212fbffbb58afca3414c10 (diff)
downloadstwcs_hcf-0e34a376d4440655b7d4cb05ed9bca70f7d2ec56.tar.gz
Logic was added to wcscorr.update_wcscorr() to prevent it from trying to update WCSCORR tables when the input image is a simple FITS file.
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@14693 fe389314-cf27-0410-b35b-8c050e845b92
-rw-r--r--lib/stwcs/wcsutil/wcscorr.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/stwcs/wcsutil/wcscorr.py b/lib/stwcs/wcsutil/wcscorr.py
index 7dd8578..0bc7bc2 100644
--- a/lib/stwcs/wcsutil/wcscorr.py
+++ b/lib/stwcs/wcsutil/wcscorr.py
@@ -271,10 +271,13 @@ def update_wcscorr(dest, source=None, extname='SCI', wcs_id=None, active=True):
if source is None:
source = dest
+ if extname == 'PRIMARY':
+ return
+
numext = fileutil.countExtn(source, extname)
if numext == 0:
raise ValueError('No %s extensions found in the source HDU list.'
- % extname)
+ % extname)
# Initialize the WCSCORR table extension in dest if not already present
init_wcscorr(dest)