summaryrefslogtreecommitdiff
path: root/stwcs/wcsutil/headerlet.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/headerlet.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/headerlet.py')
-rw-r--r--stwcs/wcsutil/headerlet.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/stwcs/wcsutil/headerlet.py b/stwcs/wcsutil/headerlet.py
index 03861df..1d7351a 100644
--- a/stwcs/wcsutil/headerlet.py
+++ b/stwcs/wcsutil/headerlet.py
@@ -34,6 +34,9 @@ from . import wcscorr
from .hstwcs import HSTWCS
from .mappings import basic_wcs
+from astropy import log
+default_log_level = log.getEffectiveLevel()
+
# Logging support functions
@@ -2144,6 +2147,8 @@ class Headerlet(fits.HDUList):
fobj.close()
raise ValueError(mess)
numsip = countExtn(self, 'SIPWCS')
+
+ log.setLevel('WARNING')
for idx in range(1, numsip + 1):
siphdr = self[('SIPWCS', idx)].header
tg_ext = (siphdr['TG_ENAME'], siphdr['TG_EVER'])
@@ -2164,6 +2169,8 @@ class Headerlet(fits.HDUList):
# fhdr.insert(wind, pyfits.Card(kw + wkey,
# self[0].header[kw]))
fhdr.append(fits.Card(kw + wkey, self[0].header[kw]))
+
+ log.setLevel(default_log_level)
# Update the WCSCORR table with new rows from the headerlet's WCSs
wcscorr.update_wcscorr(fobj, self, 'SIPWCS')