diff options
author | dencheva <dencheva@stsci.edu> | 2012-03-15 10:12:50 -0400 |
---|---|---|
committer | dencheva <dencheva@stsci.edu> | 2012-03-15 10:12:50 -0400 |
commit | 16ab61c69d35b8f9ebf0ebb5b9ee02ed3b160ca8 (patch) | |
tree | 1785a30c1edbe6dd12e25ef664bf230d6c9569ed /lib | |
parent | 523877cea119672b172675d877d6182be426b64d (diff) | |
download | stwcs_hcf-16ab61c69d35b8f9ebf0ebb5b9ee02ed3b160ca8.tar.gz |
deleteWCS did not detect the case of a data array in the primary hdu when the file is not simple fits. The file checking is more robust now.
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@15624 fe389314-cf27-0410-b35b-8c050e845b92
Diffstat (limited to 'lib')
-rw-r--r-- | lib/stwcs/wcsutil/altwcs.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/stwcs/wcsutil/altwcs.py b/lib/stwcs/wcsutil/altwcs.py index d68a0d8..d666b37 100644 --- a/lib/stwcs/wcsutil/altwcs.py +++ b/lib/stwcs/wcsutil/altwcs.py @@ -313,18 +313,13 @@ def deleteWCS(fname, ext, wcskey=" ", wcsname=" "): # Interpret input 'ext' value to get list of extensions to process ext = _buildExtlist(fobj, ext) - # Do not allow deleting the original WCS. if wcskey == 'O': print "Wcskey 'O' is reserved for the original WCS and should not be deleted." closefobj(fname, fobj) return - - simplefits = fu.isFits(fobj)[1] is 'simple' - if simplefits: - wcskeyext = 0 - else: - wcskeyext = 1 + + wcskeyext = ext[0] if not wcskeys and not wcsname: raise KeyError("Either wcskey or wcsname should be specified") |