From 2b246650dae33a3a11220adf5f044b419a5ed1ea Mon Sep 17 00:00:00 2001 From: Nadia Dencheva Date: Sun, 14 Aug 2016 11:46:28 -0400 Subject: Catch log.info messages from astropy.wcs and don't print them. --- stwcs/wcsutil/hstwcs.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'stwcs/wcsutil/hstwcs.py') 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(): -- cgit