summaryrefslogtreecommitdiff
path: root/stwcs/wcsutil/hstwcs.py
diff options
context:
space:
mode:
authorNadia Dencheva <nadia.dencheva@gmail.com>2016-08-14 11:46:28 -0400
committerNadia Dencheva <nadia.dencheva@gmail.com>2016-08-14 11:46:28 -0400
commit2b246650dae33a3a11220adf5f044b419a5ed1ea (patch)
treeb685dfdd08ef31adf4dd1ac551a9215e18fc7c9a /stwcs/wcsutil/hstwcs.py
parent43010144f1f869e17a62a98de3d8fc51b6630c4c (diff)
downloadstwcs_hcf-2b246650dae33a3a11220adf5f044b419a5ed1ea.tar.gz
Catch log.info messages from astropy.wcs and don't print them.
Diffstat (limited to 'stwcs/wcsutil/hstwcs.py')
-rw-r--r--stwcs/wcsutil/hstwcs.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/stwcs/wcsutil/hstwcs.py b/stwcs/wcsutil/hstwcs.py
index aeaa43f..d9146d2 100644
--- a/stwcs/wcsutil/hstwcs.py
+++ b/stwcs/wcsutil/hstwcs.py
@@ -12,6 +12,9 @@ from . import getinput
from . import instruments
from .mappings import inst_mappings, ins_spec_kw
+from astropy import log
+default_log_level = log.getEffectiveLevel()
+
__all__ = ['HSTWCS']
@@ -382,8 +385,11 @@ class HSTWCS(WCS):
sip2hdr : bool
If True - include SIP coefficients
"""
-
+ if not relax and not sip2hdr:
+ log.setLevel('WARNING')
h = self.to_header(key=wcskey, relax=relax)
+ log.setLevel(default_log_level)
+
if not wcskey:
wcskey = self.wcs.alt
if self.wcs.has_cd():