[AstroPy] Pyfits nan issue
Perry Greenfield
perry at stsci.edu
Mon Sep 14 11:06:39 EDT 2009
After looking at the file, it may be an issue with how pyfits is
dealing with compressed data. We won't be able to look at it right
away, but we will fix it at some point in the next month or so.
Perry
On Sep 11, 2009, at 2:48 PM, Tommy Grav wrote:
> 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 at pha.jhu.edu
> (410) 516-7683
> http://web.mac.com/tgrav/Astronomy/Welcome.html
> +
> ----------------------------------------------------------------------------+
>
>
>
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy
More information about the AstroPy
mailing list