<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    On 5/8/2012 9:05 PM, Michael Droettboom wrote:
    <blockquote cite="mid:4FA9DF0A.1080600@stsci.edu" type="cite">
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      It actually appears that this is converting 32-bit integers to
      64-bit floats.  Does the file have BZERO or BSCALE specified?  If
      so, it is normal behavior to convert to 64-bit floats so that user
      code doesn't have to deal with offset and scaling issues.<br>
      <br>
      Mike<br>
    </blockquote>
    <br>
    Thanks Mike.  <br>
    <br>
    The FITS files do have BZERO and BSCALE defined.  My mistake (twice)
    saying 32-bit float since BITPIX=+32.  I was expecting conversion to
    32-bit floats.  Since converting 32-bit integers to 64-bit floats is
    the standard Pyfits behavior, I will perform the conversion
    explicitly (numpy astype).<br>
    <br>
    -- jv<br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <blockquote cite="mid:4FA9DF0A.1080600@stsci.edu" type="cite"> <br>
      On 05/08/2012 02:14 PM, Jim Vickroy wrote:
      <blockquote cite="mid:4FA96276.6060506@noaa.gov" type="cite">
        <meta http-equiv="Content-Type" content="text/html;
          charset=ISO-8859-1">
        On 5/8/2012 11:11 AM, Philip Tait wrote:
        <blockquote
          cite="mid:4fa953d2.4574b60a.76bc.ffffc485@mx.google.com"
          type="cite">Isn't this a known issue, fixed in 3.0.7?<br>
        </blockquote>
        <br>
        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:<br>
        <br>
        >>> import os<br>
        >>> import sys<br>
        >>> import pyfits<br>
        >>> sys.version<br>
        '2.6.4 (r264:75708, Oct 26 2009, 08:23:19) [MSC v.1500 32 bit
        (Intel)]'<br>
        >>> pyfits.__version__<br>
        '3.0.7'<br>
        >>> path = ...<br>
        >>> HDUs = pyfits.open (path,mode='readonly')<br>
        >>> HDUs['primary'].header['bitpix']<br>
        32<br>
        >>> HDUs['primary'].data.dtype<br>
        dtype('float64')<br>
        >>> HDUs['primary'].header['bitpix']<br>
        -64<br>
        >>> <br>
        <br>
        Is this a bug that should be reported?<br>
        <br>
        Thanks,<br>
        -- jv<br>
        <br>
        <br>
        <br>
        <br>
        <br>
        <br>
        <blockquote
          cite="mid:4fa953d2.4574b60a.76bc.ffffc485@mx.google.com"
          type="cite"><br>
          <span style="font-family:Prelude, Verdana, san-serif;"><br>
            <br>
          </span><span id="signature">
            <div style="font-family: arial, sans-serif; font-size:
              12px;color: #999999;">-- Sent from my HP Pre3</div>
            <br>
          </span><span style="color:navy; font-family:Prelude, Verdana,
            san-serif; ">
            <hr style="width:75%" align="left">On May 8, 2012 6:59, Jim
            Vickroy <a moz-do-not-send="true"
              class="moz-txt-link-rfc2396E"
              href="mailto:jim.vickroy@noaa.gov"><jim.vickroy@noaa.gov></a>
            wrote: <br>
            <br>
          </span>Hi Pyfits users, <br>
          <br>
          Consider: <br>
          <br>
          >>> import pyfits <br>
          >>> pyfits.__version__ <br>
          '3.0.5' <br>
          >>> path = ... <br>
          >>> HDUs = pyfits.open (path,mode='readonly') <br>
          >>> HDUs['primary'].header['bitpix'] <br>
          32 <br>
          >>> HDUs['primary'].data.dtype <br>
          dtype('float64') <br>
          >>> HDUs['primary'].header['bitpix'] <br>
          -64 <br>
          >>> <br>
          <br>
          Why is the conversion from 32 to 64 bit floats silently
          occurring? How <br>
          can I prevent it? <br>
          <br>
          Thanks, <br>
          -- jv <br>
          <br>
          _______________________________________________ <br>
          AstroPy mailing list <br>
          <a moz-do-not-send="true" class="moz-txt-link-abbreviated"
            href="mailto:AstroPy@scipy.org">AstroPy@scipy.org</a> <br>
          <a moz-do-not-send="true" class="moz-txt-link-freetext"
            href="http://mail.scipy.org/mailman/listinfo/astropy">http://mail.scipy.org/mailman/listinfo/astropy</a>
          <br>
        </blockquote>
        <br>
        <br>
        <fieldset class="mimeAttachmentHeader"></fieldset>
        <br>
        <pre wrap="">_______________________________________________
AstroPy mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:AstroPy@scipy.org">AstroPy@scipy.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://mail.scipy.org/mailman/listinfo/astropy">http://mail.scipy.org/mailman/listinfo/astropy</a>
</pre>
      </blockquote>
      <br>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
AstroPy mailing list
<a class="moz-txt-link-abbreviated" href="mailto:AstroPy@scipy.org">AstroPy@scipy.org</a>
<a class="moz-txt-link-freetext" href="http://mail.scipy.org/mailman/listinfo/astropy">http://mail.scipy.org/mailman/listinfo/astropy</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>