[AstroPy] Capturing pyfits warnings

Bridgman, William T. william.t.bridgman at nasa.gov
Tue Sep 14 09:41:40 EDT 2010

I'm trying to get an inventory of all the FITS files I'm storing  
locally, to track down duplicates and determine data gaps in covering  
certain phenomena.

I'm getting a warning from pyfits about file size mismatches.  Is  
there an elegant way to capture this message, or a warning code, that  
I can save with the file inventory record for generating a summary  

I see some items in the pyfits doc on capturing this with the warnings  
module but it seems more focussed on logging.  It is unclear how I  
would capture the warning information as a separate variable to save  
with the inventory dictionary.

Dr. William T."Tom" Bridgman               Scientific Visualization  
Global Science & Technology, Inc.          NASA/Goddard Space Flight  
Email: William.T.Bridgman at nasa.gov         Code 610.3
Phone: 301-286-1346                        Greenbelt, MD 20771
FAX:   301-286-1634                        http://svs.gsfc.nasa.gov/

More information about the AstroPy mailing list