[AstroPy] unexpected pyfits behavior float32 converted to float64

Jim Vickroy jim.vickroy at noaa.gov
Tue May 8 14:14:14 EDT 2012


On 5/8/2012 11:11 AM, Philip Tait wrote:
> Isn't this a known issue, fixed in 3.0.7?

Thanks for the quick reply.  It is embarrassing to post a problem and 
not be using the latest release.  So I've downloaded/installed 3.0.7.  
Unfortunately, the same behavior persists (i.e., unwanted, silent 
conversion from 32 to 64 bit floats) as illustrated below:

 >>> import os
 >>> import sys
 >>> import pyfits
 >>> sys.version
'2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit (Intel)]'
 >>> pyfits.__version__
'3.0.7'
 >>> path = ...
 >>> HDUs = pyfits.open (path,mode='readonly')
 >>> HDUs['primary'].header['bitpix']
32
 >>> HDUs['primary'].data.dtype
dtype('float64')
 >>> HDUs['primary'].header['bitpix']
-64
 >>>

Is this a bug that should be reported?

Thanks,
-- jv






>
>
>
> -- Sent from my HP Pre3
>
> ------------------------------------------------------------------------
> On May 8, 2012 6:59, Jim Vickroy <jim.vickroy at noaa.gov> wrote:
>
> Hi Pyfits users,
>
> Consider:
>
> >>> import pyfits
> >>> pyfits.__version__
> '3.0.5'
> >>> path = ...
> >>> HDUs = pyfits.open (path,mode='readonly')
> >>> HDUs['primary'].header['bitpix']
> 32
> >>> HDUs['primary'].data.dtype
> dtype('float64')
> >>> HDUs['primary'].header['bitpix']
> -64
> >>>
>
> Why is the conversion from 32 to 64 bit floats silently occurring? How
> can I prevent it?
>
> Thanks,
> -- jv
>
> _______________________________________________
> AstroPy mailing list
> AstroPy at scipy.org
> http://mail.scipy.org/mailman/listinfo/astropy

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20120508/93ab0939/attachment.html>


More information about the AstroPy mailing list