diff options
author | Nadia Dencheva <nadia.astropy@gmail.com> | 2017-04-24 20:27:39 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-24 20:27:39 -0400 |
commit | c956b066bd3f9e60491a8258a14c2028f713d23b (patch) | |
tree | 5984d868fd456020c640d406a90726c74b6c47f2 /stwcs/wcsutil/hstwcs.py | |
parent | 53494790dfa08265eeea23b5e659f1ac157a1490 (diff) | |
parent | 95e84f773a7254f7a07d7393c9dd3828ff8c5662 (diff) | |
download | stwcs_hcf-c956b066bd3f9e60491a8258a14c2028f713d23b.tar.gz |
suppress warning messages when it's known they are not relevant
Diffstat (limited to 'stwcs/wcsutil/hstwcs.py')
-rw-r--r-- | stwcs/wcsutil/hstwcs.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/stwcs/wcsutil/hstwcs.py b/stwcs/wcsutil/hstwcs.py index d9146d2..86dec5e 100644 --- a/stwcs/wcsutil/hstwcs.py +++ b/stwcs/wcsutil/hstwcs.py @@ -1,6 +1,7 @@ from __future__ import absolute_import, division, print_function import os +import warnings from astropy.wcs import WCS from astropy.io import fits from ..distortion import models, coeff_converter @@ -17,6 +18,7 @@ default_log_level = log.getEffectiveLevel() __all__ = ['HSTWCS'] +warnings.filterwarnings("ignore", message="^Some non-standard WCS keywords were excluded:", module="astropy.wcs.wcs") def extract_rootname(kwvalue, suffix=""): """ Returns the rootname from a full reference filename @@ -385,10 +387,8 @@ class HSTWCS(WCS): sip2hdr : bool If True - include SIP coefficients """ - if not relax and not sip2hdr: - log.setLevel('WARNING') + warnings.filterwarnings("ignore", message="^Some non-standard WCS keywords were excluded:", module="astropy.wcs") h = self.to_header(key=wcskey, relax=relax) - log.setLevel(default_log_level) if not wcskey: wcskey = self.wcs.alt |