diff options
author | hack <hack@stsci.edu> | 2012-04-17 13:52:54 -0400 |
---|---|---|
committer | hack <hack@stsci.edu> | 2012-04-17 13:52:54 -0400 |
commit | d5d14f116c0a60d14a0c7e1bf2d459e22ba600f2 (patch) | |
tree | 3155288d3e4dad6533e447e802ba44bcdb8543d0 | |
parent | c58735cfd7b383612abf9684c8ace58413269124 (diff) | |
download | stwcs_hcf-d5d14f116c0a60d14a0c7e1bf2d459e22ba600f2.tar.gz |
Modified a few print statements in altwcs to make 'updatewcs' a little less disconcerting for users to address an issue raised in astrodrizzle testing.
git-svn-id: http://svn.stsci.edu/svn/ssb/stsci_python/stsci_python/trunk/stwcs@16258 fe389314-cf27-0410-b35b-8c050e845b92
-rw-r--r-- | lib/stwcs/wcsutil/altwcs.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/stwcs/wcsutil/altwcs.py b/lib/stwcs/wcsutil/altwcs.py index f528f38..7099898 100644 --- a/lib/stwcs/wcsutil/altwcs.py +++ b/lib/stwcs/wcsutil/altwcs.py @@ -66,7 +66,7 @@ def archiveWCS(fname, ext, wcskey=" ", wcsname=" ", reusekey=False): if not wcskey and not wcsname: raise KeyError("Either wcskey or wcsname should be specified") - + if wcsname.strip() == "": wcsname = readAltWCS(f, ext[0], wcskey=" ")['WCSNAME'] wcsext = ext[0] @@ -277,14 +277,13 @@ def restoreWCS(f, ext, wcskey=" ", wcsname=" "): raise KeyError("Could not get a key from wcsname %s ." % wcsname) else: if wcskey not in wcskeys(fobj, ext=wcskeyext): - print "Could not find alternate WCS with key %s in this file" % wcskey + #print "Could not find alternate WCS with key %s in this file" % wcskey closefobj(f, fobj) return wkey = wcskey - for e in ext: - _restore(fobj, wkey, fromextnum=e) + _restore(fobj, wkey, fromextnum=e, verbose=False) if fobj.filename() is not None: #fobj.writeto(name) @@ -322,7 +321,7 @@ def deleteWCS(fname, ext, wcskey=" ", wcsname=" "): print "Wcskey 'O' is reserved for the original WCS and should not be deleted." closefobj(fname, fobj) return - + wcskeyext = ext[0] if not wcskeys and not wcsname: @@ -384,7 +383,8 @@ def _buildExtlist(fobj, ext): raise KeyError("Valid extensions in 'ext' parameter need to be specified.") return ext -def _restore(fobj, ukey, fromextnum, toextnum=None, fromextnam=None, toextnam=None): +def _restore(fobj, ukey, fromextnum, + toextnum=None, fromextnam=None, toextnam=None, verbose=True): """ fobj: string of HDUList ukey: string 'A'-'Z' @@ -411,7 +411,7 @@ def _restore(fobj, ukey, fromextnum, toextnum=None, fromextnam=None, toextnam=No else: toextension = fromextension - hwcs = readAltWCS(fobj,fromextension,wcskey=ukey,verbose=True) + hwcs = readAltWCS(fobj,fromextension,wcskey=ukey,verbose=verbose) if hwcs is None: return |