diff options
author | Nadia Dencheva <nadia.dencheva@gmail.com> | 2016-08-14 11:16:16 -0400 |
---|---|---|
committer | Nadia Dencheva <nadia.dencheva@gmail.com> | 2016-08-14 11:16:16 -0400 |
commit | 43010144f1f869e17a62a98de3d8fc51b6630c4c (patch) | |
tree | 2d06ce2ce2dfedb06e4f0f4567a0f8705c1f9efb | |
parent | 854883354a933451a6120d96154a25c55dc14826 (diff) | |
download | stwcs_hcf-43010144f1f869e17a62a98de3d8fc51b6630c4c.tar.gz |
altwcs logging
-rw-r--r-- | stwcs/wcsutil/altwcs.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/stwcs/wcsutil/altwcs.py b/stwcs/wcsutil/altwcs.py index 050a15e..cba400f 100644 --- a/stwcs/wcsutil/altwcs.py +++ b/stwcs/wcsutil/altwcs.py @@ -3,6 +3,7 @@ from __future__ import absolute_import, division, print_function import string import numpy as np from astropy import wcs as pywcs +from astropy import log from astropy.io import fits from stsci.tools import fileutil as fu @@ -120,7 +121,7 @@ def archiveWCS(fname, ext, wcskey=" ", wcsname=" ", reusekey=False): else: wkey = wcskey wname = wcsname - + log.setLevel('WARNING') for e in ext: hdr = _getheader(f, e) w = pywcs.WCS(hdr, f) @@ -147,6 +148,7 @@ def archiveWCS(fname, ext, wcskey=" ", wcsname=" ", reusekey=False): for k in hwcs.keys(): key = k[: 7] + wkey f[e].header[key] = hwcs[k] + log.setLevel('DEBUG') closefobj(fname, f) @@ -429,8 +431,9 @@ def _restore(fobj, ukey, fromextnum, # keep a copy of the ctype because of the "-SIP" suffix. ctype = hdr['ctype*'] w = pywcs.WCS(hdr, fobj, key=ukey) + log.setLevel('WARNING') hwcs = w.to_header() - + log.setLevel('DEBUG') if hwcs is None: return @@ -513,7 +516,9 @@ def readAltWCS(fobj, ext, wcskey=' ', verbose=False): print('readAltWCS: Could not read WCS with key %s' % wcskey) print(' Skipping %s[%s]' % (fobj.filename(), str(ext))) return None + log.setLevel('WARNING') hwcs = nwcs.to_header() + log.setLevel('DEBUG') if nwcs.wcs.has_cd(): hwcs = pc2cd(hwcs, key=wcskey) |