From 16ab61c69d35b8f9ebf0ebb5b9ee02ed3b160ca8 Mon Sep 17 00:00:00 2001 From: dencheva Date: Thu, 15 Mar 2012 14:12:50 +0000 Subject: 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 --- lib/stwcs/wcsutil/altwcs.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'lib/stwcs/wcsutil/altwcs.py') 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") -- cgit