From 43010144f1f869e17a62a98de3d8fc51b6630c4c Mon Sep 17 00:00:00 2001 From: Nadia Dencheva Date: Sun, 14 Aug 2016 11:16:16 -0400 Subject: altwcs logging --- stwcs/wcsutil/altwcs.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'stwcs') 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) -- cgit