[AstroPy] Pyfits nan issue

Tommy Grav tgrav@mac....
Fri Sep 11 13:48:21 CDT 2009


I am trying to read in images using the pyfits svn trunk  
(2.1.1dev494). These images
display correctly in ds9, but when reading in pyfits the nan values  
are converted to
very large values (well not that large, for example 53662.75, but with  
different values
for each image).

 >>> hdu.info()
Filename: o5014g0242o.84241.wrp.7117.skycell.077.fits
No.    Name         Type      Cards   Dimensions   Format
0    PRIMARY     PrimaryHDU       6  ()            int16
1                CompImageHDU    98  (6000, 6000)  float32
 >>> hdu[1].header["BITPIX"]
-32
 >>> np.isnan(hdu[1].data).sum()
0
 >>> hdu[1].data.max()
53662.75
 >>>

Does anyone know what might be going on such that ds9 correctly reads  
the files and
displays the nan values, while pyfits (or np) fails to do so?

Cheers
Tommy Grav
+ 
----------------------------------------------------------------------------+
Associate Researcher @ Dept. of Physics and Astronomy
Johns Hopkins University
+ 
----------------------------------------------------------------------------+
tgrav@pha.jhu.edu
(410) 516-7683
http://web.mac.com/tgrav/Astronomy/Welcome.html
+ 
----------------------------------------------------------------------------+





More information about the AstroPy mailing list