[AstroPy] Capturing pyfits warnings

Bridgman, William T. william.t.bridgman at nasa.gov
Wed Sep 15 08:52:45 EDT 2010


That's what I suspect, I just want to produce a full list of them.

Now it appears that if I raise the warning to an exception, it skips  
the header load which causes my file summary section (which parses the  
file header) to fail.

I seem to be faced with the choice of

1) recording the warning, and not getting info on data that is  
otherwise at least partially readable, or
2) not capturing the warning and getting a file summary.

I have a couple of ideas for getting around this issue, but none of  
them are very clean.  Now I can fall completely into the camp that  
this type of warning should *not* be treated as an error.

Right now, the files indicating problems are not the ones I need for  
my current project so I will have to shelve this problem for now.

Thanks for your assistance,
On Sep 14, 2010, at 5:29 PM, jtaylor2 at stsci.edu wrote:

> Tom,
>   Based on the warning message you are getting, your file is indeed  
> corrupt.  The file size 2102784 is not a multiple of 2880 so their  
> must be a problem with the file.  Your problem may be the same as  
> Anne has indicated or it may not.  At any rate, the file you have is  
> not fits complient.  Although PyFITS may be able to handle the  
> extensions in the file that are.
>    Jim T.

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