Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > 82fd441cd3f2a8bc33fc3ed41403eced > files > 2011

python-astropy-0.2.4-4.mga4.x86_64.rpm


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>astropy.io.fits History &mdash; Astropy v0.2.4</title>
    
    <link rel="stylesheet" href="../../../_static/bootstrap-astropy.css" type="text/css" />
    <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../../../',
        VERSION:     '0.2.4',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../../_static/underscore.js"></script>
    <script type="text/javascript" src="../../../_static/doctools.js"></script>
    <script type="text/javascript" src="../../../_static/sidebar.js"></script>
    <link rel="shortcut icon" href="../../../_static/astropy_logo.ico"/>
    <link rel="top" title="Astropy v0.2.4" href="../../../index.html" />
    <link rel="up" title="FITS File handling (astropy.io.fits)" href="../index.html" />
    <link rel="next" title="File Handling and Convenience Functions" href="../api/files.html" />
    <link rel="prev" title="PyFITS FAQ" href="faq.html" /> 
  </head>
  <body>
<div class="topbar">
  <a class="brand" title="Documentation Home" href="../../../index.html"></a>
  <ul>
    <li><a class="homelink" title="AstroPy Homepage" href="http://www.astropy.org"></a></li>
    <li><a title="General Index" href="../../../genindex.html">Index</a></li>
    <li><a title="Python Module Index" href="../../../py-modindex.html">Modules</a></li>
    <li>
      
      
<form action="../../../search.html" method="get">
  <input type="text" name="q" placeholder="Search" />
  <input type="hidden" name="check_keywords" value="yes" />
  <input type="hidden" name="area" value="default" />
</form>
      
    </li>
  </ul>
</div>

<div class="related">
    <h3>Navigation</h3>
    <ul>
      <li class="right">
	<a href="../api/files.html" title="File Handling and Convenience Functions">
	  next &raquo;
	</a>
      </li>
      <li class="right">
	<a href="faq.html" title="PyFITS FAQ">
	  &laquo; previous
	</a>
	 |
      </li>
      <li>
	<a href="../../../index.html">Astropy v0.2.4</a>
	 &raquo;
      </li>
      <li><a href="../index.html" accesskey="U">FITS File handling (<tt class="docutils literal"><span class="pre">astropy.io.fits</span></tt>)</a> &raquo;</li>
      
      <li>astropy.io.fits History</li> 
    </ul>
</div>
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="astropy-io-fits-history">
<h1>astropy.io.fits History<a class="headerlink" href="#astropy-io-fits-history" title="Permalink to this headline">¶</a></h1>
<p>Prior to its inclusion in Astropy, the <tt class="xref py py-obj docutils literal"><span class="pre">astropy.io.fits</span></tt> package was a stand-
alone package called <a class="reference external" href="http://www.stsci.edu/resources/software_hardware/pyfits">PyFITS</a>.  Though for the time being active development
is continuing on PyFITS, that development is also being merged into Astropy.
This page documents the release history of PyFITS prior to its merge into
Astropy.</p>
<div class="contents local topic" id="pyfits-changelog">
<p class="topic-title first">PyFITS Changelog</p>
<ul class="simple">
<li><a class="reference internal" href="#unreleased" id="id57">3.2 (unreleased)</a><ul>
<li><a class="reference internal" href="#highlights" id="id58">Highlights</a></li>
<li><a class="reference internal" href="#api-changes" id="id59">API Changes</a></li>
<li><a class="reference internal" href="#new-features" id="id60">New Features</a></li>
</ul>
</li>
<li><a class="reference internal" href="#id1" id="id61">3.1.3 (unreleased)</a></li>
<li><a class="reference internal" href="#id2" id="id62">3.0.12 (unreleased)</a></li>
<li><a class="reference internal" href="#id3" id="id63">3.1.2 (2013-04-22)</a></li>
<li><a class="reference internal" href="#id4" id="id64">3.0.11 (2013-04-17)</a></li>
<li><a class="reference internal" href="#id5" id="id65">3.1.1 (2013-01-02)</a><ul>
<li><a class="reference internal" href="#bug-fixes" id="id66">Bug Fixes</a></li>
</ul>
</li>
<li><a class="reference internal" href="#id6" id="id67">3.0.10 (2013-01-02)</a></li>
<li><a class="reference internal" href="#id7" id="id68">3.1 (2012-08-08)</a><ul>
<li><a class="reference internal" href="#id8" id="id69">Highlights</a></li>
<li><a class="reference internal" href="#id9" id="id70">API Changes</a></li>
<li><a class="reference internal" href="#id10" id="id71">New Features</a></li>
<li><a class="reference internal" href="#changes-in-behavior" id="id72">Changes in Behavior</a></li>
<li><a class="reference internal" href="#id11" id="id73">Bug Fixes</a></li>
</ul>
</li>
<li><a class="reference internal" href="#id12" id="id74">3.0.9 (2012-08-06)</a><ul>
<li><a class="reference internal" href="#id13" id="id75">Bug Fixes</a></li>
</ul>
</li>
<li><a class="reference internal" href="#id14" id="id76">3.0.8 (2012-06-04)</a><ul>
<li><a class="reference internal" href="#id15" id="id77">Changes in Behavior</a></li>
<li><a class="reference internal" href="#id16" id="id78">Bug Fixes</a></li>
</ul>
</li>
<li><a class="reference internal" href="#id17" id="id79">3.0.7 (2012-04-10)</a><ul>
<li><a class="reference internal" href="#id18" id="id80">Changes in Behavior</a></li>
<li><a class="reference internal" href="#id19" id="id81">Bug Fixes</a></li>
</ul>
</li>
<li><a class="reference internal" href="#id20" id="id82">3.0.6 (2012-02-29)</a><ul>
<li><a class="reference internal" href="#id21" id="id83">Highlights</a></li>
<li><a class="reference internal" href="#id22" id="id84">Bug Fixes</a></li>
</ul>
</li>
<li><a class="reference internal" href="#id23" id="id85">3.0.5 (2012-01-30)</a></li>
<li><a class="reference internal" href="#id24" id="id86">3.0.4 (2011-11-22)</a></li>
<li><a class="reference internal" href="#id25" id="id87">3.0.3 (2011-10-05)</a></li>
<li><a class="reference internal" href="#id26" id="id88">3.0.2 (2011-09-23)</a></li>
<li><a class="reference internal" href="#id27" id="id89">3.0.1 (2011-09-12)</a></li>
<li><a class="reference internal" href="#id28" id="id90">3.0.0 (2011-08-23)</a></li>
<li><a class="reference internal" href="#id29" id="id91">2.4.0 (2011-01-10)</a></li>
<li><a class="reference internal" href="#id30" id="id92">2.3.1 (2010-06-03)</a></li>
<li><a class="reference internal" href="#id31" id="id93">2.3 (2010-05-11)</a></li>
<li><a class="reference internal" href="#id32" id="id94">2.2.2 (2009-10-12)</a></li>
<li><a class="reference internal" href="#id33" id="id95">2.2.1 (2009-10-06)</a></li>
<li><a class="reference internal" href="#id34" id="id96">2.2 (2009-09-23)</a></li>
<li><a class="reference internal" href="#id35" id="id97">2.1.1 (2009-04-22)</a></li>
<li><a class="reference internal" href="#id36" id="id98">2.1 (2009-04-14)</a></li>
<li><a class="reference internal" href="#id37" id="id99">2.0.1 (2009-02-03)</a></li>
<li><a class="reference internal" href="#id38" id="id100">2.0 (2009-01-30)</a></li>
<li><a class="reference internal" href="#id40" id="id101">1.4.1 (2008-11-04)</a></li>
<li><a class="reference internal" href="#id41" id="id102">1.4 (2008-07-07)</a></li>
<li><a class="reference internal" href="#id42" id="id103">1.3 (2008-02-22)</a></li>
<li><a class="reference internal" href="#id44" id="id104">1.1 (2007-06-15)</a></li>
<li><a class="reference internal" href="#id45" id="id105">1.0.1 (2006-03-24)</a></li>
<li><a class="reference internal" href="#id46" id="id106">1.0 (2005-11-01)</a></li>
<li><a class="reference internal" href="#id47" id="id107">0.9.6 (2004-11-11)</a></li>
<li><a class="reference internal" href="#id48" id="id108">0.9.3 (2004-07-02)</a></li>
<li><a class="reference internal" href="#id49" id="id109">0.9 (2004-04-27)</a></li>
<li><a class="reference internal" href="#id50" id="id110">0.8.0 (2003-08-19)</a></li>
<li><a class="reference internal" href="#id51" id="id111">0.7.6 (2002-11-22)</a></li>
<li><a class="reference internal" href="#id52" id="id112">0.7.5 (2002-08-16)</a></li>
<li><a class="reference internal" href="#id53" id="id113">0.7.3 (2002-07-12)</a></li>
<li><a class="reference internal" href="#id54" id="id114">0.7.2.1 (2002-06-25)</a></li>
<li><a class="reference internal" href="#id55" id="id115">0.7.2 (2002-06-19)</a></li>
<li><a class="reference internal" href="#id56" id="id116">0.6.2 (2002-02-12)</a></li>
</ul>
</div>
<div class="section" id="unreleased">
<h2><a class="toc-backref" href="#id57">3.2 (unreleased)</a><a class="headerlink" href="#unreleased" title="Permalink to this headline">¶</a></h2>
<div class="section" id="highlights">
<h3><a class="toc-backref" href="#id58">Highlights</a><a class="headerlink" href="#highlights" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li>Rewrote CFITSIO-based backend for handling tile compression of FITS files.
It now uses a standard CFITSIO instead of heavily modified pieces of CFITSIO
as before.  PyFITS ships with its own copy of CFITSIO v3.30, but system
packagers may choose instead to strip this out in favor of a
system-installed version of CFITSIO.  Earlier versions may work, but nothing
earlier than 3.28 has been tested yet. (#169)</li>
</ul>
</div>
<div class="section" id="api-changes">
<h3><a class="toc-backref" href="#id59">API Changes</a><a class="headerlink" href="#api-changes" title="Permalink to this headline">¶</a></h3>
<ul>
<li><p class="first">The <tt class="docutils literal"><span class="pre">updateHeader</span></tt>, <tt class="docutils literal"><span class="pre">updateHeaderData</span></tt>, and <tt class="docutils literal"><span class="pre">updateCompressedData</span></tt>
methods of the <tt class="docutils literal"><span class="pre">CompDataHDU</span></tt> class are pending deprecation and moved to
internal methods.  The operation of these methods depended too much on
internal state to be used safely by users; instead they are invoked
automatically in the appropriate places when reading/writing compressed image
HDUs.</p>
</li>
<li><p class="first">The <tt class="docutils literal"><span class="pre">CompDataHDU.compData</span></tt> attribute is pending deprecation in favor of
the clearer and more PEP-8 compatible <tt class="docutils literal"><span class="pre">CompDataHDU.compressed_data</span></tt>.</p>
</li>
<li><p class="first">The constructor for <tt class="docutils literal"><span class="pre">CompDataHDU</span></tt> has been changed to accept new keyword
arguments.  The new keyword arguments are essentially the same, but are in
underscore_separated format rather than camelCase format.  The old arguments
are still pending deprecation.</p>
</li>
<li><p class="first">The internal attributes of HDU classes <tt class="docutils literal"><span class="pre">_hdrLoc</span></tt>, <tt class="docutils literal"><span class="pre">_datLoc</span></tt>, and
<tt class="docutils literal"><span class="pre">_datSpan</span></tt> have been replaced with <tt class="docutils literal"><span class="pre">_header_offset</span></tt>, <tt class="docutils literal"><span class="pre">_data_offset</span></tt>,
and <tt class="docutils literal"><span class="pre">_data_size</span></tt> respectively.  The old attribute names are still pending
deprecation.  This should only be of interest to advanced users who have
created their own HDU subclasses.</p>
</li>
<li><p class="first">The following previously deprecated functions and methods have been removed
entirely: <tt class="docutils literal"><span class="pre">createCard</span></tt>, <tt class="docutils literal"><span class="pre">createCardFromString</span></tt>, <tt class="docutils literal"><span class="pre">upperKey</span></tt>,
<tt class="docutils literal"><span class="pre">ColDefs.data</span></tt>, <tt class="docutils literal"><span class="pre">setExtensionNameCaseSensitive</span></tt>, <tt class="docutils literal"><span class="pre">_File.getfile</span></tt>,
<tt class="docutils literal"><span class="pre">_TableBaseHDU.get_coldefs</span></tt>, <tt class="docutils literal"><span class="pre">Header.has_key</span></tt>, <tt class="docutils literal"><span class="pre">Header.ascardlist</span></tt>.</p>
<p>If you run your code with a previous version of PyFITS (&gt;= 3.0, &lt; 3.2) with
the <tt class="docutils literal"><span class="pre">python</span> <span class="pre">-Wd</span></tt> argument, warnings for all deprecated interfaces still in
use will be displayed.</p>
</li>
<li><p class="first">Interfaces that were pending deprecation are now fully deprecated.  These
include: <tt class="docutils literal"><span class="pre">create_card</span></tt>, <tt class="docutils literal"><span class="pre">create_card_from_string</span></tt>, <tt class="docutils literal"><span class="pre">upper_key</span></tt>,
<tt class="docutils literal"><span class="pre">Header.get_history</span></tt>, and <tt class="docutils literal"><span class="pre">Header.get_comment</span></tt>.</p>
</li>
</ul>
</div>
<div class="section" id="new-features">
<h3><a class="toc-backref" href="#id60">New Features</a><a class="headerlink" href="#new-features" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li>The new compression code also adds support for the ZQUANTIZ keyword added in
more recent versions of this FITS Tile Compression spec. This includes
support for lossless compression with GZIP. (#198)</li>
</ul>
</div>
</div>
<div class="section" id="id1">
<h2><a class="toc-backref" href="#id61">3.1.3 (unreleased)</a><a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>Disallowed assigning NaN and Inf floating point values as header values,
since the FITS standard does not define a way to represent them in. Because
this is undefined, the previous behavior did not make sense and produced
invalid FITS files. (spacetelescope/PyFITS#11)</li>
</ul>
</div>
<div class="section" id="id2">
<h2><a class="toc-backref" href="#id62">3.0.12 (unreleased)</a><a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>Disallowed assigning NaN and Inf floating point values as header values,
since the FITS standard does not define a way to represent them in. Because
this is undefined, the previous behavior did not make sense and produced
invalid FITS files. (Backported from 3.1.3)</li>
</ul>
</div>
<div class="section" id="id3">
<h2><a class="toc-backref" href="#id63">3.1.2 (2013-04-22)</a><a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>When an error occurs opening a file in fitsdiff the exception message will
now at least mention which file had the error. (#168)</li>
<li>Fixed support for opening gzipped FITS files by filename in a writeable mode
(PyFITS has supported writing to gzip files for some time now, but only
enabled it when GzipFile objects were passed to <tt class="docutils literal"><span class="pre">pyfits.open()</span></tt> due to
some legacy code preventing full gzip support. (#195)</li>
<li>Added a more helpful error message in the case of malformatted FITS files
that contain non-float NULL values in an ASCII table but are missing the
required TNULLn keywords in the header. (#197)</li>
<li>Fixed an (apparently long-standing) issue where writing compressed images
did not correctly write the TFORMn keywords for variable-length array
columns (they ommitted the max array length parameter of the format). (#199)</li>
<li>Slightly refactored how tables containing variable-length array columns are
handled to add two improvements: Fixes an issue where accessing the data
after a call to the <tt class="xref py py-obj docutils literal"><span class="pre">pyfits.getdata</span></tt> convenience function caused an
exception, and allows the VLA data to be read from an existing mmap of the
FITS file. (#200)</li>
<li>Fixed a bug that could occur when opening a table containing
multi-dimensional columns (i.e. via the TDIMn keyword) and then writing it
out to a new file. (#201)</li>
<li>Added use of the console_scripts entry point to install the fitsdiff and
fitscheck scripts, which if nothing else provides better Windows support.
The generated scripts now override the ones explicitly defined in the
scripts/ directory (which were just trivial stubs to begin with). (#202)</li>
<li>Fixed a bug on Python 3 where attempting to open a non-existent file on
Python 3 caused a seemingly unrelated traceback. (#203)</li>
<li>Fixed a bug in fitsdiff that reported two header keywords containing NaN
as value as different. (#204)</li>
<li>Fixed an issue in the tests that caused some tests to fail if pyfits is
installed with read-only permissions. (#208)</li>
<li>Fixed a bug where instantiating a <tt class="docutils literal"><span class="pre">BinTableHDU</span></tt> from a numpy array
containing boolean fields converted all the values to <tt class="docutils literal"><span class="pre">False</span></tt>. (#215)</li>
<li>Fixed an issue where passing an array of integers into the constructor of
<tt class="docutils literal"><span class="pre">Column()</span></tt> when the column type is floats of the same byte width caused the
column array to become garbled. (#218)</li>
<li>Fixed inconsistent behavior in creating CONTINUE cards from byte strings
versus unicode strings in Python 2&#8211;CONTINUE cards can now be created
properly from unicode strings (so long as they are convertable to ASCII).
(spacetelescope/PyFITS#1)</li>
<li>Fixed a couple cases where creating a new table using TDIMn in some of the
columns could caused a crash. (spacetelescope/PyFITS#3)</li>
<li>Fixed a bug in parsing HIERARCH keywords that do not have a space after
the first equals sign (before the value). (spacetelescope/PyFITS#5)</li>
<li>Prevented extra leading whitespace on HIERARCH keywords from being treated
as part of the keyword. (spacetelescope/PyFITS#6)</li>
<li>Fixed a bug where HIERARCH keywords containing lower-case letters was
mistakenly marked as invalid during header validation.
(spacetelescope/PyFITS#7)</li>
<li>Fixed an issue that was ancillary to (spacetelescope/PyFITS#7) where the
<tt class="docutils literal"><span class="pre">Header.index()</span></tt> method did not work correctly with HIERARCH keywords
containing lower-case letters.</li>
</ul>
</div>
<div class="section" id="id4">
<h2><a class="toc-backref" href="#id64">3.0.11 (2013-04-17)</a><a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>Fixed support for opening gzipped FITS files by filename in a writeable mode
(PyFITS has supported writing to gzip files for some time now, but only
enabled it when GzipFile objects were passed to <tt class="docutils literal"><span class="pre">pyfits.open()</span></tt> due to
some legacy code preventing full gzip support. Backported from 3.1.2. (#195)</li>
<li>Added a more helpful error message in the case of malformatted FITS files
that contain non-float NULL values in an ASCII table but are missing the
required TNULLn keywords in the header. Backported from 3.1.2. (#197)</li>
<li>Fixed an (apparently long-standing) issue where writing compressed images did
not correctly write the TFORMn keywords for variable-length array columns
(they ommitted the max array length parameter of the format). Backported from
3.1.2. (#199)</li>
<li>Slightly refactored how tables containing variable-length array columns are
handled to add two improvements: Fixes an issue where accessing the data
after a call to the <tt class="xref py py-obj docutils literal"><span class="pre">pyfits.getdata</span></tt> convenience function caused an
exception, and allows the VLA data to be read from an existing mmap of the
FITS file. Backported from 3.1.2. (#200)</li>
<li>Fixed a bug that could occur when opening a table containing
multi-dimensional columns (i.e. via the TDIMn keyword) and then writing it
out to a new file. Backported from 3.1.2. (#201)</li>
<li>Fixed a bug on Python 3 where attempting to open a non-existent file on
Python 3 caused a seemingly unrelated traceback. Backported from 3.1.2.
(#203)</li>
<li>Fixed a bug in fitsdiff that reported two header keywords containing NaN
as value as different. Backported from 3.1.2. (#204)</li>
<li>Fixed an issue in the tests that caused some tests to fail if pyfits is
installed with read-only permissions. Backported from 3.1.2. (#208)</li>
<li>Fixed a bug where instantiating a <tt class="docutils literal"><span class="pre">BinTableHDU</span></tt> from a numpy array
containing boolean fields converted all the values to <tt class="docutils literal"><span class="pre">False</span></tt>. Backported
from 3.1.2. (#215)</li>
<li>Fixed an issue where passing an array of integers into the constructor of
<tt class="docutils literal"><span class="pre">Column()</span></tt> when the column type is floats of the same byte width caused the
column array to become garbled. Backported from 3.1.2. (#218)</li>
<li>Fixed a couple cases where creating a new table using TDIMn in some of the
columns could caused a crash. Backported from 3.1.2.
(spacetelescope/PyFITS#3)</li>
</ul>
</div>
<div class="section" id="id5">
<h2><a class="toc-backref" href="#id65">3.1.1 (2013-01-02)</a><a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h2>
<p>This is a bug fix release for the 3.1.x series.</p>
<div class="section" id="bug-fixes">
<h3><a class="toc-backref" href="#id66">Bug Fixes</a><a class="headerlink" href="#bug-fixes" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li>Improved handling of scaled images and pseudo-unsigned integer images in
compressed image HDUs.  They now work more transparently like normal image
HDUs with support for the <tt class="docutils literal"><span class="pre">do_not_scale_image_data</span></tt> and <tt class="docutils literal"><span class="pre">uint</span></tt> options,
as well as <tt class="docutils literal"><span class="pre">scale_back</span></tt> and <tt class="docutils literal"><span class="pre">save_backup</span></tt>.  The <tt class="docutils literal"><span class="pre">.scale()</span></tt> method
works better too. (#88)</li>
<li>Permits non-string values for the EXTNAME keyword when reading in a file,
rather than throwing an exception due to the malformatting.  Added
verification for the format of the EXTNAME keyword when writing. (#96)</li>
<li>Added support for EXTNAME and EXTVER in PRIMARY HDUs.  That is, if EXTNAME
is specified in the header, it will also be reflected in the <tt class="docutils literal"><span class="pre">.name</span></tt>
attribute and in <tt class="docutils literal"><span class="pre">pyfits.info()</span></tt>.  These keywords used to be verboten in
PRIMARY HDUs, but the latest version of the FITS standard allows them.
(#151)</li>
<li>HCOMPRESS can again be used to compress data cubes (and higher-dimensional
arrays) so long as the tile size is effectively 2-dimensional. In fact,
PyFITS will automatically use compatible tile sizes even if they&#8217;re not
explicitly specified. (#171)</li>
<li>Added support for the optional <tt class="docutils literal"><span class="pre">endcard</span></tt> parameter in the
<tt class="docutils literal"><span class="pre">Header.fromtextfile()</span></tt> and <tt class="docutils literal"><span class="pre">Header.totextfile()</span></tt> methods.  Although
<tt class="docutils literal"><span class="pre">endcard=False</span></tt> was a reasonable default assumption, there are still text
dumps of FITS headers that include the END card, so this should have been
more flexible. (#176)</li>
<li>Fixed a crash when running fitsdiff on two empty (that is, zero row) tables.
(#178)</li>
<li>Fixed an issue where opening files containing random groups HDUs in update
mode could cause an unnecessary rewrite of the file even if none of the
data is modified. (#179)</li>
<li>Fixed a bug that could caused a deadlock in the filesystem on OSX if PyFITS
is used with Numpy 1.7 in some cases. (#180)</li>
<li>Fixed a crash when generating diff reports from diffs using the
<tt class="docutils literal"><span class="pre">ignore_comments</span></tt> options. (#181)</li>
<li>Fixed some bugs with WCS Paper IV record-valued keyword cards:<ul>
<li>Cards that looked kind of like RVKCs but were not intended to be were
over-permissively treated as such&#8211;commentary keywords like COMMENT and
HISTORY were particularly affected. (#183)</li>
<li>Looking up a card in a header by its standard FITS keyword only should
always return the raw value of that card.  That way cards containing
values that happen to valid RVKCs but were not intended to be will still
be treated like normal cards. (#184)</li>
<li>Looking up a RVKC in a header with only part of the field-specifier (for
example &#8220;DP1.AXIS&#8221; instead of &#8220;DP1.AXIS.1&#8221;) was implicitly treated as a
wildcard lookup. (#184)</li>
</ul>
</li>
<li>Fixed a crash when diffing two FITS files where at least one contains a
compressed image HDU which was not recognized as an image instead of a
table. (#187)</li>
<li>Fixed bugs in the backwards compatibility layer for the <tt class="docutils literal"><span class="pre">CardList.index</span></tt>
and <tt class="docutils literal"><span class="pre">CardList.count</span></tt> methods. (#190)</li>
<li>Improved <tt class="docutils literal"><span class="pre">__repr__</span></tt> and text file representation of cards with long values
that are split into CONTINUE cards. (#193)</li>
<li>Fixed a crash when trying to assign a long (&gt; 72 character) value to blank
(&#8216;&#8217;) keywords. This also changed how blank keywords are represented&#8211;there
are still exactly 8 spaces before any commentary content can begin; this
<em>may</em> affect the exact display of header cards that assumed there could be
fewer spaces in a blank keyword card before the content begins. However, the
current approach is more in line with the requirements of the FITS standard.
(#194)</li>
</ul>
</div>
</div>
<div class="section" id="id6">
<h2><a class="toc-backref" href="#id67">3.0.10 (2013-01-02)</a><a class="headerlink" href="#id6" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>Improved handling of scaled images and pseudo-unsigned integer images in
compressed image HDUs.  They now work more transparently like normal image
HDUs with support for the <tt class="docutils literal"><span class="pre">do_not_scale_image_data</span></tt> and <tt class="docutils literal"><span class="pre">uint</span></tt> options,
as well as <tt class="docutils literal"><span class="pre">scale_back</span></tt> and <tt class="docutils literal"><span class="pre">save_backup</span></tt>.  The <tt class="docutils literal"><span class="pre">.scale()</span></tt> method
works better too.  Backported from 3.1.1. (#88)</li>
<li>Permits non-string values for the EXTNAME keyword when reading in a file,
rather than throwing an exception due to the malformatting.  Added
verification for the format of the EXTNAME keyword when writing.  Backported
from 3.1.1. (#96)</li>
<li>Added support for EXTNAME and EXTVER in PRIMARY HDUs.  That is, if EXTNAME
is specified in the header, it will also be reflected in the <tt class="docutils literal"><span class="pre">.name</span></tt>
attribute and in <tt class="docutils literal"><span class="pre">pyfits.info()</span></tt>.  These keywords used to be verbotten in
PRIMARY HDUs, but the latest version of the FITS standard allows them.
Backported from 3.1.1. (#151)</li>
<li>HCOMPRESS can again be used to compress data cubes (and higher-dimensional
arrays) so long as the tile size is effectively 2-dimensional. In fact,
PyFITS will not automatically use compatible tile sizes even if they&#8217;re not
explicitly specified.  Backported from 3.1.1. (#171)</li>
<li>Fixed a bug when writing out files containing zero-width table columns,
where the TFIELDS keyword would be updated incorrectly, leaving the table
largely unreadable.  Backported from 3.1.0. (#174)</li>
<li>Fixed an issue where opening files containing random groups HDUs in update
mode could cause an unnecessary rewrite of the file even if none of the
data is modified.  Backported from 3.1.1. (#179)</li>
<li>Fixed a bug that could caused a deadlock in the filesystem on OSX if PyFITS
is used with Numpy 1.7 in some cases. Backported from 3.1.1. (#180)</li>
</ul>
</div>
<div class="section" id="id7">
<h2><a class="toc-backref" href="#id68">3.1 (2012-08-08)</a><a class="headerlink" href="#id7" title="Permalink to this headline">¶</a></h2>
<div class="section" id="id8">
<h3><a class="toc-backref" href="#id69">Highlights</a><a class="headerlink" href="#id8" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li>The <tt class="docutils literal"><span class="pre">Header</span></tt> object has been significantly reworked, and <tt class="docutils literal"><span class="pre">CardList</span></tt>
objects are now deprecated (their functionality folded into the <tt class="docutils literal"><span class="pre">Header</span></tt>
class).  See API Changes below for more details.</li>
<li>Memory maps are now used by default to access HDU data.  See API Changes
below for more details.</li>
<li>Now includes a new version of the <tt class="docutils literal"><span class="pre">fitsdiff</span></tt> program for comparing two
FITS files, and a new FITS comparison API used by <tt class="docutils literal"><span class="pre">fitsdiff</span></tt>.  See New
Features below.</li>
</ul>
</div>
<div class="section" id="id9">
<h3><a class="toc-backref" href="#id70">API Changes</a><a class="headerlink" href="#id9" title="Permalink to this headline">¶</a></h3>
<ul>
<li><p class="first">The <tt class="docutils literal"><span class="pre">Header</span></tt> class has been rewritten, and the <tt class="docutils literal"><span class="pre">CardList</span></tt> class is
deprecated.  Most of the basic details of working with FITS headers are
unchanged, and will not be noticed by most users.  But there are differences
in some areas that will be of interest to advanced users, and to application
developers.  For full details of the changes, see the &#8220;Header Interface
Transition Guide&#8221; section in the PyFITS documentation.  See ticket #64 on
the PyFITS Trac for futher details and background. Some highlights are
listed below:</p>
<ul>
<li><p class="first">The Header class now fully implements the Python dict interface, and can
be used interchangably with a dict, where the keys are header keywords.</p>
</li>
<li><p class="first">New keywords can be added to the header using normal keyword assignment
(previously it was necessary to use <tt class="docutils literal"><span class="pre">Header.update</span></tt> to add new
keywords).  For example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">header</span><span class="p">[</span><span class="s">&#39;NAXIS&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="mi">2</span>
</pre></div>
</div>
<p>will update the existing &#8216;FOO&#8217; keyword if it already exists, or add a new
one if it doesn&#8217;t exist, just like a dict.</p>
</li>
<li><p class="first">It is possible to assign both a value and a comment at the same time using
a tuple:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">header</span><span class="p">[</span><span class="s">&#39;NAXIS&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="s">&#39;Number of axes&#39;</span><span class="p">)</span>
</pre></div>
</div>
</li>
<li><p class="first">To add/update a new card and ensure it&#8217;s added in a specific location, use
<tt class="docutils literal"><span class="pre">Header.set()</span></tt>:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">header</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s">&#39;NAXIS&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="s">&#39;Number of axes&#39;</span><span class="p">,</span> <span class="n">after</span><span class="o">=</span><span class="s">&#39;BITPIX&#39;</span><span class="p">)</span>
</pre></div>
</div>
<p>This works the same as the old <tt class="docutils literal"><span class="pre">Header.update()</span></tt>.  <tt class="docutils literal"><span class="pre">Header.update()</span></tt>
still works in the old way too, but is deprecated.</p>
</li>
<li><p class="first">Although <tt class="docutils literal"><span class="pre">Card</span></tt> objects still exist, it generally is not necessary to
work with them directly.  <tt class="docutils literal"><span class="pre">Header.ascardlist()</span></tt>/<tt class="docutils literal"><span class="pre">Header.ascard</span></tt> are
deprecated and should not be used.  To directly access the <tt class="docutils literal"><span class="pre">Card</span></tt>
objects in a header, use <tt class="docutils literal"><span class="pre">Header.cards</span></tt>.</p>
</li>
<li><p class="first">To access card comments, it is still possible to either go through the
card itself, or through <tt class="docutils literal"><span class="pre">Header.comments</span></tt>.  For example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">header</span><span class="o">.</span><span class="n">cards</span><span class="p">[</span><span class="s">&#39;NAXIS&#39;</span><span class="p">]</span><span class="o">.</span><span class="n">comment</span>
<span class="go">Number of axes</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">header</span><span class="o">.</span><span class="n">comments</span><span class="p">[</span><span class="s">&#39;NAXIS&#39;</span><span class="p">]</span>
<span class="go">Number of axes</span>
</pre></div>
</div>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">Card</span></tt> objects can now be used interchangeably with
<tt class="docutils literal"><span class="pre">(keyword,</span> <span class="pre">value,</span> <span class="pre">comment)</span></tt> 3-tuples.  They still have <tt class="docutils literal"><span class="pre">.value</span></tt> and
<tt class="docutils literal"><span class="pre">.comment</span></tt> attributes as well.  The <tt class="docutils literal"><span class="pre">.key</span></tt> attribute has been renamed
to <tt class="docutils literal"><span class="pre">.keyword</span></tt> for consistency, though <tt class="docutils literal"><span class="pre">.key</span></tt> is still supported (but
deprecated).</p>
</li>
</ul>
</li>
<li><p class="first">Memory mapping is now used by default to access HDU data.  That is,
<tt class="docutils literal"><span class="pre">pyfits.open()</span></tt> uses <tt class="docutils literal"><span class="pre">memmap=True</span></tt> as the default.  This provides better
performance in the majority of use cases&#8211;there are only some I/O intensive
applications where it might not be desirable.  Enabling mmap by default also
enabled finding and fixing a large number of bugs in PyFITS&#8217; handling of
memory-mapped data (most of these bug fixes were backported to PyFITS
3.0.5). (#85)</p>
<ul class="simple">
<li>A new <tt class="docutils literal"><span class="pre">pyfits.USE_MEMMAP</span></tt> global variable was added.  Set
<tt class="docutils literal"><span class="pre">pyfits.USE_MEMMAP</span> <span class="pre">=</span> <span class="pre">False</span></tt> to change the default memmap setting for
opening files.  This is especially useful for controlling the behavior in
applications where pyfits is deeply embedded.</li>
<li>Likewise, a new <tt class="docutils literal"><span class="pre">PYFITS_USE_MEMMAP</span></tt> environment variable is supported.
Set <tt class="docutils literal"><span class="pre">PYFITS_USE_MEMMAP</span> <span class="pre">=</span> <span class="pre">0</span></tt> in your environment to change the default
behavior.</li>
</ul>
</li>
<li><p class="first">The <tt class="docutils literal"><span class="pre">size()</span></tt> method on HDU objects is now a <tt class="docutils literal"><span class="pre">.size</span></tt> property&#8211;this
returns the size in bytes of the data portion of the HDU, and in most cases
is equivalent to <tt class="docutils literal"><span class="pre">hdu.data.nbytes</span></tt> (#83)</p>
</li>
<li><p class="first"><tt class="docutils literal"><span class="pre">BinTableHDU.tdump</span></tt> and <tt class="docutils literal"><span class="pre">BinTableHDU.tcreate</span></tt> are deprecated&#8211;use
<tt class="docutils literal"><span class="pre">BinTableHDU.dump</span></tt> and <tt class="docutils literal"><span class="pre">BinTableHDU.load</span></tt> instead.  The new methods
output the table data in a slightly different format from previous versions,
which places quotes around each value.  This format is compatible with data
dumps from previous versions of PyFITS, but not vice-versa due to a parsing
bug in older versions.</p>
</li>
<li><p class="first">Likewise the <tt class="docutils literal"><span class="pre">pyfits.tdump</span></tt> and <tt class="docutils literal"><span class="pre">pyfits.tcreate</span></tt> convenience function
versions of these methods have been renamed <tt class="docutils literal"><span class="pre">pyfits.tabledump</span></tt> and
<tt class="docutils literal"><span class="pre">pyfits.tableload</span></tt>.  The old deprecated, but currently retained for
backwards compatibility. (r1125)</p>
</li>
<li><p class="first">A new global variable <tt class="docutils literal"><span class="pre">pyfits.EXTENSION_NAME_CASE_SENSITIVE</span></tt> was added.
This serves as a replacement for <tt class="docutils literal"><span class="pre">pyfits.setExtensionNameCaseSensitive</span></tt>
which is not deprecated and may be removed in a future version.  To enable
case-sensitivity of extension names (i.e. treat &#8216;sci&#8217; as distict from &#8216;SCI&#8217;)
set <tt class="docutils literal"><span class="pre">pyfits.EXTENSION_NAME_CASE_SENSITIVE</span> <span class="pre">=</span> <span class="pre">True</span></tt>.  The default is
<tt class="docutils literal"><span class="pre">False</span></tt>. (r1139)</p>
</li>
<li><p class="first">A new global configuration variable <tt class="docutils literal"><span class="pre">pyfits.STRIP_HEADER_WHITESPACE</span></tt> was
added.  By default, if a string value in a header contains trailing
whitespace, that whitespace is automatically removed when the value is read.
Now if you set <tt class="docutils literal"><span class="pre">pyfits.STRIP_HEADER_WHITESPACE</span> <span class="pre">=</span> <span class="pre">False</span></tt> all whitespace is
preserved. (#146)</p>
</li>
<li><p class="first">The old <tt class="docutils literal"><span class="pre">classExtensions</span></tt> extension mechanism (which was deprecated in
PyFITS 3.0) is removed outright.  To our knowledge it was no longer used
anywhere. (r1309)</p>
</li>
<li><p class="first">Warning messages from PyFITS issued through the Python warnings API are now
output to stderr instead of stdout, as is the default.  PyFITS no longer
modifies the default behavior of the warnings module with respect to which
stream it outputs to. (r1319)</p>
</li>
<li><p class="first">The <tt class="docutils literal"><span class="pre">checksum</span></tt> argument to <tt class="docutils literal"><span class="pre">pyfits.open()</span></tt> now accepts a value of
&#8216;remove&#8217;, which causes any existing CHECKSUM/DATASUM keywords to be ignored,
and removed when the file is saved.</p>
</li>
</ul>
</div>
<div class="section" id="id10">
<h3><a class="toc-backref" href="#id71">New Features</a><a class="headerlink" href="#id10" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li>Added support for the proposed &#8220;FITS&#8221; extension HDU type.  See
<a class="reference external" href="http://listmgr.cv.nrao.edu/pipermail/fitsbits/2002-April/001094.html">http://listmgr.cv.nrao.edu/pipermail/fitsbits/2002-April/001094.html</a>.  FITS
HDUs contain an entire FITS file embedded in their data section.  <tt class="xref py py-obj docutils literal"><span class="pre">FitsHDU</span></tt>
objects work like other HDU types in PyFITS.  Their <tt class="docutils literal"><span class="pre">.data</span></tt> attribute
returns the raw data array.  However, they have a special <tt class="docutils literal"><span class="pre">.hdulist</span></tt>
attribute which processes the data as a FITS file and returns it as an
in-memory HDUList object.  FitsHDU objects also support a
<tt class="docutils literal"><span class="pre">FitsHDU.fromhdulist()</span></tt> classmethod which returns a new <tt class="xref py py-obj docutils literal"><span class="pre">FitsHDU</span></tt> object
that embeds the supplied HDUList. (#80)</li>
<li>Added a new <tt class="docutils literal"><span class="pre">.is_image</span></tt> attribute on HDU objects, which is True if the HDU
data is an &#8216;image&#8217; as opposed to a table or something else.  Here the
meaning of &#8216;image&#8217; is fairly loose, and mostly just means a Primary or Image
extension HDU, or possibly a compressed image HDU (#71)</li>
<li>Added an <tt class="docutils literal"><span class="pre">HDUList.fromstring</span></tt> classmethod which can parse a FITS file
already in memory and instantiate and <tt class="docutils literal"><span class="pre">HDUList</span></tt> object from it.  This
could be useful for integrating PyFITS with other libraries that work on
FITS file, such as CFITSIO.  It may also be useful in streaming
applications.  The name is a slight misnomer, in that it actually accepts
any Python object that implements the buffer interface, which includes
<tt class="docutils literal"><span class="pre">bytes</span></tt>, <tt class="docutils literal"><span class="pre">bytearray</span></tt>, <tt class="docutils literal"><span class="pre">memoryview</span></tt>, <tt class="docutils literal"><span class="pre">numpy.ndarray</span></tt>, etc. (#90)</li>
<li>Added a new <tt class="docutils literal"><span class="pre">pyfits.diff</span></tt> module which contains facilities for comparing
FITS files.  One can use the <tt class="docutils literal"><span class="pre">pyfits.diff.FITSDiff</span></tt> class to compare two
FITS files in their entirety.  There is also a <tt class="docutils literal"><span class="pre">pyfits.diff.HeaderDiff</span></tt>
class for just comparing two FITS headers, and other similar interfaces.
See the PyFITS Documentation for more details on this interface.  The
<tt class="docutils literal"><span class="pre">pyfits.diff</span></tt> module powers the new <tt class="docutils literal"><span class="pre">fitsdiff</span></tt> program installed with
PyFITS.  After installing PyFITS, run <tt class="docutils literal"><span class="pre">fitsdiff</span> <span class="pre">--help</span></tt> for usage details.</li>
<li><tt class="docutils literal"><span class="pre">pyfits.open()</span></tt> now accepts a <tt class="docutils literal"><span class="pre">scale_back</span></tt> argument.  If set to
<tt class="docutils literal"><span class="pre">True</span></tt>, this automatically scales the data using the original BZERO and
BSCALE parameters the file had when it was first opened, if any, as well as
the original BITPIX.  For example, if the original BITPIX were 16, this
would be equivalent to calling <tt class="docutils literal"><span class="pre">hdu.scale('int16',</span> <span class="pre">'old')</span></tt> just before
calling <tt class="docutils literal"><span class="pre">flush()</span></tt> or <tt class="docutils literal"><span class="pre">close()</span></tt> on the file.  This option applies to all
HDUs in the file. (#120)</li>
<li><tt class="docutils literal"><span class="pre">pyfits.open()</span></tt> now accepts a <tt class="docutils literal"><span class="pre">save_backup</span></tt> argument.  If set to
<tt class="docutils literal"><span class="pre">True</span></tt>, this automatically saves a backup of the original file before
flushing any changes to it (this of course only applies to update and append
mode).  This may be especially useful when working with scaled image data.
(#121)</li>
</ul>
</div>
<div class="section" id="changes-in-behavior">
<h3><a class="toc-backref" href="#id72">Changes in Behavior</a><a class="headerlink" href="#changes-in-behavior" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li>Warnings from PyFITS are not output to stderr by default, instead of stdout
as it has been for some time.  This is contrary to most users&#8217; expectations
and makes it more difficult for them to separate output from PyFITS from the
desired output for their scripts. (r1319)</li>
</ul>
</div>
<div class="section" id="id11">
<h3><a class="toc-backref" href="#id73">Bug Fixes</a><a class="headerlink" href="#id11" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li>Fixed <tt class="docutils literal"><span class="pre">pyfits.tcreate()</span></tt> (now <tt class="docutils literal"><span class="pre">pyfits.tableload()</span></tt>) to be more robust
when encountering blank lines in a column definition file (#14)</li>
<li>Fixed a fairly rare crash that could occur in the handling of CONTINUE cards
when using Numpy 1.4 or lower (though 1.4 is the oldest version supported by
PyFITS). (r1330)</li>
<li>Fixed <tt class="docutils literal"><span class="pre">_BaseHDU.fromstring</span></tt> to actually correctly instantiate an HDU
object from a string/buffer containing the header and data of that HDU.
This allowed for the implementation of <tt class="docutils literal"><span class="pre">HDUList.fromstring</span></tt> described
above. (#90)</li>
<li>Fixed a rare corner case where, in some use cases, (mildly, recoverably)
malformatted float values in headers were not properly returned as floats.
(#137)</li>
<li>Fixed a corollary to the previous bug where float values with a leading zero
before the decimal point had the leading zero unnecessarily removed when
saving changes to the file (eg. &#8220;0.001&#8221; would be written back as &#8221;.001&#8221; even
if no changes were otherwise made to the file). (#137)</li>
<li>When opening a file containing CHECKSUM and/or DATASUM keywords in update
mode, the CHECKSUM/DATASUM are updated and preserved even if the file was
opened with checksum=False.  This change in behavior prevents checksums from
being unintentionally removed. (#148)</li>
<li>Fixed a bug where <tt class="docutils literal"><span class="pre">ImageHDU.scale(option='old')</span></tt> wasn&#8217;t working at all&#8211;it
was not restoring the image to its original BSCALE and BZERO values. (#162)</li>
<li>Fixed a bug when writing out files containing zero-width table columns,
where the TFIELDS keyword would be updated incorrectly, leaving the table
largely unreadable.  This fix will be backported to the 3.0.x series in
version 3.0.10.  (#174)</li>
</ul>
</div>
</div>
<div class="section" id="id12">
<h2><a class="toc-backref" href="#id74">3.0.9 (2012-08-06)</a><a class="headerlink" href="#id12" title="Permalink to this headline">¶</a></h2>
<p>This is a bug fix release for the 3.0.x series.</p>
<div class="section" id="id13">
<h3><a class="toc-backref" href="#id75">Bug Fixes</a><a class="headerlink" href="#id13" title="Permalink to this headline">¶</a></h3>
<ul>
<li><p class="first">Fixed <tt class="docutils literal"><span class="pre">Header.values()</span></tt>/<tt class="docutils literal"><span class="pre">Header.itervalues()</span></tt> and <tt class="docutils literal"><span class="pre">Header.items()</span></tt>/
<tt class="docutils literal"><span class="pre">Header.iteritems()</span></tt> to correctly return the different values for
duplicate keywords (particularly commentary keywords like HISTORY and
COMMENT).  This makes the old Header implementation slightly more compatible
with the new implementation in PyFITS 3.1. (#127)</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">This fix did not change the existing behavior from earlier PyFITS
versions where <tt class="docutils literal"><span class="pre">Header.keys()</span></tt> returns all keywords in the header with
duplicates removed.  PyFITS 3.1 changes that behavior, so that
<tt class="docutils literal"><span class="pre">Header.keys()</span></tt> includes duplicates.</p>
</div>
</li>
<li><p class="first">Fixed a bug where <tt class="docutils literal"><span class="pre">ImageHDU.scale(option='old')</span></tt> wasn&#8217;t working at all&#8211;it
was not restoring the image to its original BSCALE and BZERO values. (#162)</p>
</li>
<li><p class="first">Fixed a bug where opening a file containing compressed image HDUs in
&#8216;update&#8217; mode and then immediately closing it without making any changes
caused the file to be rewritten unncessarily. (#167)</p>
</li>
<li><p class="first">Fixed two memory leaks that could occur when writing compressed image data,
or in some cases when opening files containing compressed image HDUs in
&#8216;update&#8217; mode. (#168)</p>
</li>
</ul>
</div>
</div>
<div class="section" id="id14">
<h2><a class="toc-backref" href="#id76">3.0.8 (2012-06-04)</a><a class="headerlink" href="#id14" title="Permalink to this headline">¶</a></h2>
<div class="section" id="id15">
<h3><a class="toc-backref" href="#id77">Changes in Behavior</a><a class="headerlink" href="#id15" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li>Prior to this release, image data sections did not work with scaled
data&#8211;that is, images with non-trivial BSCALE and/or BZERO values.
Previously, in order to read such images in sections, it was necessary to
manually apply the BSCALE+BZERO to each section.  It&#8217;s worth noting that
sections <em>did</em> support pseudo-unsigned ints (flakily).  This change just
extends that support for general BSCALE+BZERO values.</li>
</ul>
</div>
<div class="section" id="id16">
<h3><a class="toc-backref" href="#id78">Bug Fixes</a><a class="headerlink" href="#id16" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li>Fixed a bug that prevented updates to values in boolean table columns from
being saved.  This turned out to be a symptom of a deeper problem that could
prevent other table updates from being saved as well. (#139)</li>
<li>Fixed a corner case in which a keyword comment ending with the string &#8220;END&#8221;
could, in some circumstances, cause headers (and the rest of the file after
that point) to be misread. (#142)</li>
<li>Fixed support for scaled image data and psuedo-unsigned ints in image data
sections (<tt class="docutils literal"><span class="pre">hdu.section</span></tt>).  Previously this was not supported at all.  At
some point support was supposedly added, but it was buggy and incomplete.
Now the feature seems to work much better. (#143)</li>
<li>Fixed the documentation to point out that image data sections <em>do</em> support
non-contiguous slices (and have for a long time).  The documentation was
never updated to reflect this, and misinformed users that only contiguous
slices were supported, leading to some confusion. (#144)</li>
<li>Fixed a bug where creating an <tt class="docutils literal"><span class="pre">HDUList</span></tt> object containing multiple PRIMARY
HDUs caused an infinite recursion when validating the object prior to
writing to a file. (#145)</li>
<li>Fixed a rare but serious case where saving an update to a file that
previously had a CHECKSUM and/or DATASUM keyword, but removed the checksum
in saving, could cause the file to be slightly corrupted and unreadable.
(#147)</li>
<li>Fixed problems with reading &#8220;non-standard&#8221; FITS files with primary headers
containing SIMPLE = F.  PyFITS has never made many guarantees as to how such
files are handled.  But it should at least be possible to read their
headers, and the data if possible.  Saving changes to such a file should not
try to prepend an unwanted valid PRIMARY HDU. (#157)</li>
<li>Fixed a bug where opening an image with <tt class="docutils literal"><span class="pre">disable_image_compression</span> <span class="pre">=</span> <span class="pre">True</span></tt>
caused compression to be disabled for all subsequent <tt class="docutils literal"><span class="pre">pyfits.open()</span></tt> calls.
(r1651)</li>
</ul>
</div>
</div>
<div class="section" id="id17">
<h2><a class="toc-backref" href="#id79">3.0.7 (2012-04-10)</a><a class="headerlink" href="#id17" title="Permalink to this headline">¶</a></h2>
<div class="section" id="id18">
<h3><a class="toc-backref" href="#id80">Changes in Behavior</a><a class="headerlink" href="#id18" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li>Slices of GroupData objects now return new GroupData objects instead of
extended multi-row _Group objects. This is analogous to how PyFITS 3.0 fixed
FITS_rec slicing, and should have been fixed for GroupData at the same time.
The old behavior caused bugs where functions internal to Numpy expected that
slicing an ndarray would return a new ndarray.  As this is a rare usecase
with a rare feature most users are unlikely to be affected by this change.</li>
<li>The previously internal _Group object for representing individual group
records in a GroupData object are renamed Group and are now a public
interface.  However, there&#8217;s almost no good reason to create Group objects
directly, so it shouldn&#8217;t be considered a &#8220;new feature&#8221;.</li>
<li>An annoyance from PyFITS 3.0.6 was fixed, where the value of the EXTEND
keyword was always being set to F if there are not actually any extension
HDUs.  It was unnecessary to modify this value.</li>
</ul>
</div>
<div class="section" id="id19">
<h3><a class="toc-backref" href="#id81">Bug Fixes</a><a class="headerlink" href="#id19" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li>Fixed GroupData objects to return new GroupData objects when sliced instead
of _Group record objects.  See &#8220;Changes in behavior&#8221; above for more details.</li>
<li>Fixed slicing of Group objects&#8211;previously it was not possible to slice
slice them at all.</li>
<li>Made it possible to assign <tt class="xref py py-obj docutils literal"><span class="pre">np.bool_</span></tt> objects as header values. (#123)</li>
<li>Fixed overly strict handling of the EXTEND keyword; see &#8220;Changes in
behavior&#8221; above. (#124)</li>
<li>Fixed many cases where an HDU&#8217;s header would be marked as &#8220;modified&#8221; by
PyFITS and rewritten, even when no changes to the header are necessary.
(#125)</li>
<li>Fixed a bug where the values of the PTYPEn keywords in a random groups HDU
were forced to be all lower-case when saving the file. (#130)</li>
<li>Removed an unnecessary inline import in <tt class="xref py py-obj docutils literal"><span class="pre">ExtensionHDU.__setattr__</span></tt> that was
causing some slowdown when opening files containing a large number of
extensions, plus a few other small (but not insignficant) performance
improvements thanks to Julian Taylor. (#133)</li>
<li>Fixed a regression where header blocks containing invalid end-of-header
padding (i.e. null bytes instead of spaces) couldn&#8217;t be parsed by PyFITS.
Such headers can be parsed again, but a warning is raised, as such headers
are not valid FITS. (#136)</li>
<li>Fixed a memory leak where table data in random groups HDUs weren&#8217;t being
garbage collected. (#138)</li>
</ul>
</div>
</div>
<div class="section" id="id20">
<h2><a class="toc-backref" href="#id82">3.0.6 (2012-02-29)</a><a class="headerlink" href="#id20" title="Permalink to this headline">¶</a></h2>
<div class="section" id="id21">
<h3><a class="toc-backref" href="#id83">Highlights</a><a class="headerlink" href="#id21" title="Permalink to this headline">¶</a></h3>
<p>The main reason for this release is to fix an issue that was introduced in
PyFITS 3.0.5 where merely opening a file containing scaled data (that is, with
non-trivial BSCALE and BZERO keywords) in &#8216;update&#8217; mode would cause the data
to be automatically rescaled&#8211;possibly converting the data from ints to
floats&#8211;as soon as the file is closed, even if the application did not touch
the data.  Now PyFITS will only rescale the data in an extension when the data
is actually accessed by the application.  So opening a file in &#8216;update&#8217; mode
in order to modify the header or append new extensions will not cause any
change to the data in existing extensions.</p>
<p>This release also fixes a few Windows-specific bugs found through more
extensive Windows testing, and other miscellaneous bugs.</p>
</div>
<div class="section" id="id22">
<h3><a class="toc-backref" href="#id84">Bug Fixes</a><a class="headerlink" href="#id22" title="Permalink to this headline">¶</a></h3>
<ul class="simple">
<li>More accurate error messages when opening files containing invalid header
cards. (#109)</li>
<li>Fixed a possible reference cycle/memory leak that was caught through more
extensive testing on Windows. (#112)</li>
<li>Fixed &#8216;ostream&#8217; mode to open the underlying file in &#8216;wb&#8217; mode instead of &#8216;w&#8217;
mode. (#112)</li>
<li>Fixed a Windows-only issue where trying to save updates to a resized FITS
file could result in a crash due to there being open mmaps on that file.
(#112)</li>
<li>Fixed a crash when trying to create a FITS table (i.e. with new_table())
from a Numpy array containing bool fields. (#113)</li>
<li>Fixed a bug where manually initializing an <tt class="docutils literal"><span class="pre">HDUList</span></tt> with a list of of
HDUs wouldn&#8217;t set the correct EXTEND keyword value on the primary HDU.
(#114)</li>
<li>Fixed a crash that could occur when trying to deepcopy a Header in Python &lt;
2.7. (#115)</li>
<li>Fixed an issue where merely opening a scaled image in &#8216;update&#8217; mode would
cause the data to be converted to floats when the file is closed. (#119)</li>
</ul>
</div>
</div>
<div class="section" id="id23">
<h2><a class="toc-backref" href="#id85">3.0.5 (2012-01-30)</a><a class="headerlink" href="#id23" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>Fixed a crash that could occur when accessing image sections of files
opened with memmap=True. (r1211)</li>
<li>Fixed the inconsistency in the behavior of files opened in &#8216;readonly&#8217; mode
when memmap=True vs. when memmap=False.  In the latter case, although
changes to array data were not saved to disk, it was possible to update the
array data in memory.  On the other hand with memmap=True, &#8216;readonly&#8217; mode
prevented even in-memory modification to the data.  This is what
&#8216;copyonwrite&#8217; mode was for, but difference in behavior was confusing.  Now
&#8216;readonly&#8217; is equivalent to &#8216;copyonwrite&#8217; when using memmap.  If the old
behavior of denying changes to the array data is necessary, a new
&#8216;denywrite&#8217; mode may be used, though it is only applicable to files opened
with memmap. (r1275)</li>
<li>Fixed an issue where files opened with memmap=True would return image data
as a raw numpy.memmap object, which can cause some unexpected
behaviors&#8211;instead memmap object is viewed as a numpy.ndarray. (r1285)</li>
<li>Fixed an issue in Python 3 where a workaround for a bug in Numpy on Python 3
interacted badly with some other software, namely to vo.table package (and
possibly others). (r1320, r1337, and #110)</li>
<li>Fixed buggy behavior in the handling of SIGINTs (i.e. Ctrl-C keyboard
interrupts) while flushing changes to a FITS file.  PyFITS already prevented
SIGINTs from causing an incomplete flush, but did not clean up the signal
handlers properly afterwards, or reraise the keyboard interrupt once the
flush was complete. (r1321)</li>
<li>Fixed a crash that could occur in Python 3 when opening files with checksum
checking enabled. (r1336)</li>
<li>Fixed a small bug that could cause a crash in the <tt class="xref py py-obj docutils literal"><span class="pre">StreamingHDU</span></tt> interface
when using Numpy below version 1.5.</li>
<li>Fixed a crash that could occur when creating a new <tt class="xref py py-obj docutils literal"><span class="pre">CompImageHDU</span></tt> from an
array of big-endian data. (#104)</li>
<li>Fixed a crash when opening a file with extra zero padding at the end.
Though FITS files should not have such padding, it&#8217;s not explictly forbidden
by the format either, and PyFITS shouldn&#8217;t stumble over it. (#106)</li>
<li>Fixed a major slowdown in opening tables containing large columns of string
values.  (#111)</li>
</ul>
</div>
<div class="section" id="id24">
<h2><a class="toc-backref" href="#id86">3.0.4 (2011-11-22)</a><a class="headerlink" href="#id24" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>Fixed a crash when writing HCOMPRESS compressed images that could happen on
Python 2.5 and 2.6. (r1217)</li>
<li>Fixed a crash when slicing an table in a file opened in &#8216;readonly&#8217; mode with
memmap=True. (r1230)</li>
<li>Writing changes to a file or writing to a new file verifies the output in
&#8216;fix&#8217; mode by default instead of &#8216;exception&#8217;&#8211;that is, PyFITS will
automatically fix common FITS format errors rather than raising an
exception. (r1243)</li>
<li>Fixed a bug where convenience functions such as getval() and getheader()
crashed when specifying just &#8216;PRIMARY&#8217; as the extension to use (r1263).</li>
<li>Fixed a bug that prevented passing keyword arguments (beyond the standard
data and header arguments) as positional arguments to the constructors of
extension HDU classes.</li>
<li>Fixed some tests that were failing on Windows&#8211;in this case the tests
themselves failed to close some temp files and Windows refused to delete them
while there were still open handles on them. (r1295)</li>
<li>Fixed an issue with floating point formatting in header values on Python 2.5
for Windows (and possibly other platforms).  The exponent was zero-padded to
3 digits; although the FITS standard makes no specification on this, the
formatting is now normalized to always pad the exponent to two digits.
(r1295)</li>
<li>Fixed a bug where long commentary cards (such as HISTORY and COMMENT) were
broken into multiple CONTINUE cards.  However, commentary cards are not
expected to be found in CONTINUE cards.  Instead these long cards are broken
into multiple commentary cards. (#97)</li>
<li>GZIP/ZIP-compressed FITS files can be detected and opened regardless of
their filename extension. (#99)</li>
<li>Fixed a serious bug where opening scaled images in &#8216;update&#8217; mode and then
closing the file without touching the data would cause the file to be
corrupted. (#101)</li>
</ul>
</div>
<div class="section" id="id25">
<h2><a class="toc-backref" href="#id87">3.0.3 (2011-10-05)</a><a class="headerlink" href="#id25" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>Fixed several small bugs involving corner cases in record-valued keyword
cards (#70)</li>
<li>In some cases HDU creation failed if the first keyword value in the header
was not a string value (#89)</li>
<li>Fixed a crash when trying to compute the HDU checksum when the data array
contains an odd number of bytes (#91)</li>
<li>Disabled an unnecessary warning that was displayed on opening compressed
HDUs with disable_image_compression = True (#92)</li>
<li>Fixed a typo in code for handling HCOMPRESS compressed images.</li>
</ul>
</div>
<div class="section" id="id26">
<h2><a class="toc-backref" href="#id88">3.0.2 (2011-09-23)</a><a class="headerlink" href="#id26" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>The <tt class="docutils literal"><span class="pre">BinTableHDU.tcreate</span></tt> method and by extension the <tt class="docutils literal"><span class="pre">pyfits.tcreate</span></tt>
function don&#8217;t get tripped up by blank lines anymore (#14)</li>
<li>The presence, value, and position of the EXTEND keyword in Primary HDUs is
verified when reading/writing a FITS file (#32)</li>
<li>Improved documentation (in warning messages as well as in the handbook) that
PyFITS uses zero-based indexing (as one would expect for C/Python code, but
contrary to the PyFITS standard which was written with FORTRAN in mind)
(#68)</li>
<li>Fixed a bug where updating a header card comment could cause the value to be
lost if it had not already been read from the card image string.</li>
<li>Fixed a related bug where changes made directly to Card object in a header
(i.e. assigning directly to card.value or card.comment) would not propagate
when flushing changes to the file (#69) [Note: This and the bug above it
were originally reported as being fixed in version 3.0.1, but the fix was
never included in the release.]</li>
<li>Improved file handling, particularly in Python 3 which had a few small file
I/O-related bugs (#76)</li>
<li>Fixed a bug where updating a FITS file would sometimes cause it to lose its
original file permissions (#79)</li>
<li>Fixed the handling of TDIMn keywords; 3.0 added support for them, but got
the axis order backards (they were treated as though they were row-major)
(#82)</li>
<li>Fixed a crash when a FITS file containing scaled data is opened and
immediately written to a new file without explicitly viewing the data first
(#84)</li>
<li>Fixed a bug where creating a table with columns named either &#8216;names&#8217; or
&#8216;formats&#8217; resulted in an infinite recursion (#86)</li>
</ul>
</div>
<div class="section" id="id27">
<h2><a class="toc-backref" href="#id89">3.0.1 (2011-09-12)</a><a class="headerlink" href="#id27" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>Fixed a bug where updating a header card comment could cause the value to be
lost if it had not already been read from the card image string.</li>
<li>Changed <tt class="docutils literal"><span class="pre">_TableBaseHDU.data</span></tt> so that if the data contain an empty table a
<tt class="docutils literal"><span class="pre">FITS_rec</span></tt> object with zero rows is returned rather than <tt class="docutils literal"><span class="pre">None</span></tt>.</li>
<li>The <tt class="docutils literal"><span class="pre">.key</span></tt> attribute of <tt class="docutils literal"><span class="pre">RecordValuedKeywordCards</span></tt> now returns the full
keyword+field-specifier value, instead of just the plain keyword (#46)</li>
<li>Fixed a related bug where changes made directly to Card object in a header
(i.e. assigning directly to card.value or card.comment) would not propagate
when flushing changes to the file (#69)</li>
<li>Fixed a bug where writing a table with zero rows could fail in some cases
(#72)</li>
<li>Miscellanous small bug fixes that were causing some tests to fail,
particularly on Python 3 (#74, #75)</li>
<li>Fixed a bug where creating a table column from an array in non-native byte
order would not preserve the byte order, thus interpreting the column array
using the wrong byte order (#77)</li>
</ul>
</div>
<div class="section" id="id28">
<h2><a class="toc-backref" href="#id90">3.0.0 (2011-08-23)</a><a class="headerlink" href="#id28" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>Contains major changes, bumping the version to 3.0</li>
<li>Large amounts of refactoring and reorganization of the code; tried to
preserve public API backwards-compatibility with older versions (private API
has many changes and is not guaranteed to be backwards-compatible).  There
are a few small public API changes to be aware of:<ul>
<li>The pyfits.rec module has been removed completely.  If your version of
numpy does not have the numpy.core.records module it is too old to be used
with PyFITS.</li>
<li>The <tt class="docutils literal"><span class="pre">Header.ascardlist()</span></tt> method is deprecated&#8211;use the <tt class="docutils literal"><span class="pre">.ascard</span></tt>
attribute instead.</li>
<li><tt class="docutils literal"><span class="pre">Card</span></tt> instances have a new <tt class="docutils literal"><span class="pre">.cardimage</span></tt> attribute that should be used
rather than <tt class="docutils literal"><span class="pre">.ascardimage()</span></tt>, which may become deprecated.</li>
<li>The <tt class="docutils literal"><span class="pre">Card.fromstring()</span></tt> method is now a classmethod.  It returns a new
<tt class="docutils literal"><span class="pre">Card</span></tt> instance rather than modifying an existing instance.</li>
<li>The <tt class="docutils literal"><span class="pre">req_cards()</span></tt> method on HDU instances has changed:  The <tt class="docutils literal"><span class="pre">pos</span></tt>
argument is not longer a string.  It is either an integer value (meaning
the card&#8217;s position must match that value) or it can be a function that
takes the card&#8217;s position as it&#8217;s argument, and returns True if the
position is valid.  Likewise, the <tt class="docutils literal"><span class="pre">test</span></tt> argument no longer takes a
string, but instead a function that validates the card&#8217;s value and returns
True or False.</li>
<li>The <tt class="docutils literal"><span class="pre">get_coldefs()</span></tt> method of table HDUs is deprecated.  Use the
<tt class="docutils literal"><span class="pre">.columns</span></tt> attribute instead.</li>
<li>The <tt class="docutils literal"><span class="pre">ColDefs.data</span></tt> attribute is deprecated&#8211;use <tt class="docutils literal"><span class="pre">ColDefs.columns</span></tt>
instead (though in general you shouldn&#8217;t mess with it directly&#8211;it might
become internal at some point).</li>
<li><tt class="docutils literal"><span class="pre">FITS_record</span></tt> objects take <tt class="docutils literal"><span class="pre">start</span></tt> and <tt class="docutils literal"><span class="pre">end</span></tt> as arguments instead of
<tt class="docutils literal"><span class="pre">startColumn</span></tt> and <tt class="docutils literal"><span class="pre">endColumn</span></tt> (these are rarely created manually, so
it&#8217;s unlikely that this change will affect anyone).</li>
<li><tt class="docutils literal"><span class="pre">BinTableHDU.tcreate()</span></tt> is now a classmethod, and returns a new
<tt class="docutils literal"><span class="pre">BinTableHDU</span></tt> instance.</li>
<li>Use <tt class="docutils literal"><span class="pre">ExtensionHDU</span></tt> and <tt class="docutils literal"><span class="pre">NonstandardExtHDU</span></tt> for making new extension HDU
classes.  They are now public interfaces, wheres previously they were
private and prefixed with underscores.</li>
<li>Possibly others&#8211;please report if you find any changes that cause
difficulties.</li>
</ul>
</li>
<li>Calls to deprecated functions will display a Deprecation warning.  However,
in Python 2.7 and up Deprecation warnings are ignored by default, so run
Python with the <tt class="xref py py-obj docutils literal"><span class="pre">-Wd</span></tt> option to see if you&#8217;re using any deprecated
functions.  If we get close to actually removing any functions, we might
make the Deprecation warnings display by default.</li>
<li>Added basic Python 3 support</li>
<li>Added support for multi-dimensional columns in tables as specified by the
TDIMn keywords (#47)</li>
<li>Fixed a major memory leak that occurred when creating new tables with the
<tt class="docutils literal"><span class="pre">new_table()</span></tt> function (#49)
be padded with zero-bytes) vs ASCII tables (where strings are padded with
spaces) (#15)</li>
<li>Fixed a bug in which the case of Random Access Group parameters names was not
preserved when writing (#41)</li>
<li>Added support for binary table fields with zero width (#42)</li>
<li>Added support for wider integer types in ASCII tables; although this is non-
standard, some GEIS images require it (#45)</li>
<li>Fixed a bug that caused the index_of() method of HDULists to crash when the
HDUList object is created from scratch (#48)</li>
<li>Fixed the behavior of string padding in binary tables (where strings should
be padded with nulls instead of spaces)</li>
<li>Fixed a rare issue that caused excessive memory usage when computing
checksums using a non-standard block size (see r818)</li>
<li>Add support for forced uint data in image sections (#53)</li>
<li>Fixed an issue where variable-length array columns were not extended when
creating a new table with more rows than the original (#54)</li>
<li>Fixed tuple and list-based indexing of FITS_rec objects (#55)</li>
<li>Fixed an issue where BZERO and BSCALE keywords were appended to headers in
the wrong location (#56)</li>
<li><tt class="docutils literal"><span class="pre">FITS_record</span></tt> objects (table rows) have full slicing support, including
stepping, etc. (#59)</li>
<li>Fixed a bug where updating multiple files simultaneously (such as when
running parallel processes) could lead to a race condition with mktemp()
(#61)</li>
<li>Fixed a bug where compressed image headers were not in the order expected by
the funpack utility (#62)</li>
</ul>
</div>
<div class="section" id="id29">
<h2><a class="toc-backref" href="#id91">2.4.0 (2011-01-10)</a><a class="headerlink" href="#id29" title="Permalink to this headline">¶</a></h2>
<p>The following enhancements were added:</p>
<ul class="simple">
<li>Checksum support now correctly conforms to the FITS standard.  pyfits
supports reading and writing both the old checksums and new
standard-compliant checksums.  The <tt class="xref py py-obj docutils literal"><span class="pre">fitscheck</span></tt> command-line utility is
provided to verify and update checksums.</li>
<li>Added a new optional keyword argument <tt class="docutils literal"><span class="pre">do_not_scale_image_data</span></tt>
to the <tt class="docutils literal"><span class="pre">pyfits.open</span></tt> convenience function.  When this argument
is provided as True, and an ImageHDU is read that contains scaled
data, the data is not automatically scaled when it is read.  This
option may be used when opening a fits file for update, when you only
want to update some header data.  Without the use of this argument, if
the header updates required the size of the fits file to change, then
when writing the updated information, the data would be read, scaled,
and written back out in its scaled format (usually with a different
data type) instead of in its non-scaled format.</li>
<li>Added a new optional keyword argument <tt class="docutils literal"><span class="pre">disable_image_compression</span></tt> to the
<tt class="docutils literal"><span class="pre">pyfits.open</span></tt> function.  When <tt class="docutils literal"><span class="pre">True</span></tt>, any compressed image HDU&#8217;s will
be read in like they are binary table HDU&#8217;s.</li>
<li>Added a <tt class="docutils literal"><span class="pre">verify</span></tt> keyword argument to the <tt class="docutils literal"><span class="pre">pyfits.append</span></tt> function.  When
<tt class="docutils literal"><span class="pre">False</span></tt>, <tt class="docutils literal"><span class="pre">append</span></tt> will assume the existing FITS file is already valid
and simply append new content to the end of the file, resulting in a large
speed up appending to large files.</li>
<li>Added HDU methods <tt class="docutils literal"><span class="pre">update_ext_name</span></tt> and <tt class="docutils literal"><span class="pre">update_ext_version</span></tt> for
updating the name and version of an HDU.</li>
<li>Added HDU method <tt class="docutils literal"><span class="pre">filebytes</span></tt> to calculate the number of bytes that will be
written to the file associated with the HDU.</li>
<li>Enhanced the section class to allow reading non-contiguous image data.
Previously, the section class could only be used to read contiguous data.
(CNSHD781626)</li>
<li>Added method <tt class="docutils literal"><span class="pre">HDUList.fileinfo()</span></tt> that returns a dictionary with
information about the location of header and data in the file associated
with the HDU.</li>
</ul>
<p>The following bugs were fixed:</p>
<ul class="simple">
<li>Reading in some malformed FITS headers would cause a <tt class="docutils literal"><span class="pre">NameError</span></tt>
exception, rather than information about the cause of the error.</li>
<li>pyfits can now handle non-compliant <tt class="docutils literal"><span class="pre">CONTINUE</span></tt> cards produced by Java
FITS.</li>
<li><tt class="docutils literal"><span class="pre">BinTable</span></tt> columns with <tt class="docutils literal"><span class="pre">TSCALn</span></tt> are now byte-swapped correctly.</li>
<li>Ensure that floating-point card values are no longer than 20 characters.</li>
<li>Updated <tt class="docutils literal"><span class="pre">flush</span></tt> so that when the data has changed in an HDU for a file
opened in update mode, the header will be updated to match the changed data
before writing out the HDU.</li>
<li>Allow <tt class="docutils literal"><span class="pre">HIERARCH</span></tt> cards to contain a keyword and value whose total
character length is 69 characters.  Previous length was limited at 68
characters.</li>
<li>Calls to <tt class="docutils literal"><span class="pre">FITS_rec['columnName']</span></tt> now return an <tt class="docutils literal"><span class="pre">ndarray</span></tt>. exactly the
same as a call to <tt class="docutils literal"><span class="pre">FITS_rec.field('columnName')</span></tt> or
<tt class="docutils literal"><span class="pre">FITS_rec.columnName</span></tt>.  Previously, <tt class="docutils literal"><span class="pre">FITS_rec['columnName']</span></tt> returned a
much less useful <tt class="docutils literal"><span class="pre">fits_record</span></tt> object. (CNSHD789053)</li>
<li>Corrected the <tt class="docutils literal"><span class="pre">append</span></tt> convenience function to eliminate the reading of
the HDU data from the file that is being appended to.  (CNSHD794738)</li>
<li>Eliminated common symbols between the pyfitsComp module and the cfitsio and
zlib libraries.  These can cause problems on systems that use both PyFITS
and cfitsio or zlib. (CNSHD795046)</li>
</ul>
</div>
<div class="section" id="id30">
<h2><a class="toc-backref" href="#id92">2.3.1 (2010-06-03)</a><a class="headerlink" href="#id30" title="Permalink to this headline">¶</a></h2>
<p>The following bugs were fixed:</p>
<ul class="simple">
<li>Replaced code in the Compressed Image HDU extension which was covered under
a GNU General Public License with code that is covered under a BSD License.
This change allows the distribution of pyfits under a BSD License.</li>
</ul>
</div>
<div class="section" id="id31">
<h2><a class="toc-backref" href="#id93">2.3 (2010-05-11)</a><a class="headerlink" href="#id31" title="Permalink to this headline">¶</a></h2>
<p>The following enhancements were made:</p>
<ul>
<li><p class="first">Completely eliminate support for numarray.</p>
</li>
<li><p class="first">Rework pyfits documention to use Sphinx.</p>
</li>
<li><p class="first">Support python 2.6 and future division.</p>
</li>
<li><p class="first">Added a new method to get the file name associated with an HDUList object.
The method HDUList.filename() returns the name of an associated file.  It
returns None if no file is associated with the HDUList.</p>
</li>
<li><p class="first">Support the python 2.5 &#8216;with&#8217; statement when opening fits files.
(CNSHD766308)  It is now possible to use the following construct:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">__future__</span> <span class="kn">import</span> <span class="n">with_statement</span> <span class="kn">import</span> <span class="nn">pyfits</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">with</span> <span class="n">pyfits</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s">&quot;input.fits&quot;</span><span class="p">)</span> <span class="k">as</span> <span class="n">hdul</span><span class="p">:</span>
<span class="gp">... </span>   <span class="c">#process hdul</span>
<span class="go">&gt;&gt;&gt;</span>
</pre></div>
</div>
</li>
<li><p class="first">Extended the support for reading unsigned integer 16 values from an ImageHDU
to include unsigned integer 32 and unsigned integer 64 values.  ImageHDU
data is considered to be unsigned integer 16 when the data type is signed
integer 16 and BZERO is equal to 2**15 (32784) and BSCALE is equal to 1.
ImageHDU data is considered to be unsigned integer 32 when the data type is
signed integer 32 and BZERO is equal to 2**31 and BSCALE is equal to 1.
ImageHDU data is considered to be unsigned integer 64 when the data type is
signed integer 64 and BZERO is equal to 2**63 and BSCALE is equal to 1.  An
optional keyword argument (uint) was added to the open convenience function
for this purpose.  Supplying a value of True for this argument will cause
data of any of these types to be read in and scaled into the appropriate
unsigned integer array (uint16, uint32, or uint64) instead of into the
normal float 32 or float 64 array.  If an HDU associated with a file that
was opened with the &#8216;int&#8217; option and containing unsigned integer 16, 32, or
64 data is written to a file, the data will be reverse scaled into a signed
integer 16, 32, or 64 array and written out to the file along with the
appropriate BSCALE/BZERO header cards.  Note that for backward
compatability, the &#8216;uint16&#8217; keyword argument will still be accepted in the
open function when handling unsigned integer 16 conversion.</p>
</li>
<li><p class="first">Provided the capability to access the data for a column of a fits table by
indexing the table using the column name.  This is consistent with Record
Arrays in numpy (array with fields).  (CNSHD763378)  The following example
will illustrate this:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">pyfits</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">hdul</span> <span class="o">=</span> <span class="n">pyfits</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s">&#39;input.fits&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">table</span> <span class="o">=</span> <span class="n">hdul</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">data</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">table</span><span class="o">.</span><span class="n">names</span>
<span class="go">[&#39;c1&#39;,&#39;c2&#39;,&#39;c3&#39;,&#39;c4&#39;]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">table</span><span class="o">.</span><span class="n">field</span><span class="p">(</span><span class="s">&#39;c2&#39;</span><span class="p">)</span> <span class="c"># this is the data for column 2</span>
<span class="go">[&#39;abc&#39; &#39;xy&#39;]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">table</span><span class="p">[</span><span class="s">&#39;c2&#39;</span><span class="p">]</span> <span class="c"># this is also the data for column 2</span>
<span class="go">array([&#39;abc&#39;, &#39;xy &#39;], dtype=&#39;|S3&#39;)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">table</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span> <span class="c"># this is the data for row 1</span>
<span class="go">(2, &#39;xy&#39;, 6.6999997138977054, True)</span>
</pre></div>
</div>
</li>
<li><p class="first">Provided capabilities to create a BinaryTableHDU directly from a numpy
Record Array (array with fields). The new capabilities include table
creation, writing a numpy Record Array directly to a fits file using the
pyfits.writeto and pyfits.append convenience functions.  Reading the data
for a BinaryTableHDU from a fits file directly into a numpy Record Array
using the pyfits.getdata convenience function.  (CNSHD749034)  Thanks to
Erin Sheldon at Brookhaven National Laboratory for help with this.</p>
<p>The following should illustrate these new capabilities:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">pyfits</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">numpy</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">t</span><span class="o">=</span><span class="n">numpy</span><span class="o">.</span><span class="n">zeros</span><span class="p">(</span><span class="mi">5</span><span class="p">,</span><span class="n">dtype</span><span class="o">=</span><span class="p">[(</span><span class="s">&#39;x&#39;</span><span class="p">,</span><span class="s">&#39;f4&#39;</span><span class="p">),(</span><span class="s">&#39;y&#39;</span><span class="p">,</span><span class="s">&#39;2i4&#39;</span><span class="p">)])</span> \
<span class="gp">... </span><span class="c"># Create a numpy Record Array with fields</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">hdu</span> <span class="o">=</span> <span class="n">pyfits</span><span class="o">.</span><span class="n">BinTableHDU</span><span class="p">(</span><span class="n">t</span><span class="p">)</span> \
<span class="gp">... </span><span class="c"># Create a Binary Table HDU directly from the Record Array</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">hdu</span><span class="o">.</span><span class="n">data</span>
<span class="go">[(0.0, array([0, 0], dtype=int32))</span>
<span class="go"> (0.0, array([0, 0], dtype=int32))</span>
<span class="go"> (0.0, array([0, 0], dtype=int32))</span>
<span class="go"> (0.0, array([0, 0], dtype=int32))</span>
<span class="go"> (0.0, array([0, 0], dtype=int32))]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">hdu</span><span class="o">.</span><span class="n">writeto</span><span class="p">(</span><span class="s">&#39;test1.fits&#39;</span><span class="p">,</span><span class="n">clobber</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span> \
<span class="gp">... </span><span class="c"># Write the HDU to a file</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pyfits</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s">&#39;test1.fits&#39;</span><span class="p">)</span>
<span class="go">Filename: test1.fits</span>
<span class="go">No.    Name         Type      Cards   Dimensions   Format</span>
<span class="go">0    PRIMARY     PrimaryHDU       4  ()            uint8</span>
<span class="go">1                BinTableHDU     12  5R x 2C       [E, 2J]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pyfits</span><span class="o">.</span><span class="n">writeto</span><span class="p">(</span><span class="s">&#39;test.fits&#39;</span><span class="p">,</span> <span class="n">t</span><span class="p">,</span> <span class="n">clobber</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span> \
<span class="gp">... </span><span class="c"># Write the Record Array directly to a file</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pyfits</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="s">&#39;test.fits&#39;</span><span class="p">,</span> <span class="n">t</span><span class="p">)</span> \
<span class="gp">... </span><span class="c"># Append another Record Array to the file</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pyfits</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s">&#39;test.fits&#39;</span><span class="p">)</span>
<span class="go">Filename: test.fits</span>
<span class="go">No.    Name         Type      Cards   Dimensions   Format</span>
<span class="go">0    PRIMARY     PrimaryHDU       4  ()            uint8</span>
<span class="go">1                BinTableHDU     12  5R x 2C       [E, 2J]</span>
<span class="go">2                BinTableHDU     12  5R x 2C       [E, 2J]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">d</span><span class="o">=</span><span class="n">pyfits</span><span class="o">.</span><span class="n">getdata</span><span class="p">(</span><span class="s">&#39;test.fits&#39;</span><span class="p">,</span><span class="n">ext</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span> \
<span class="gp">... </span><span class="c"># Get the first extension from the file as a FITS_rec</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="nb">type</span><span class="p">(</span><span class="n">d</span><span class="p">)</span>
<span class="go">&lt;class &#39;pyfits.core.FITS_rec&#39;&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">d</span>
<span class="go">[(0.0, array([0, 0], dtype=int32))</span>
<span class="go"> (0.0, array([0, 0], dtype=int32))</span>
<span class="go"> (0.0, array([0, 0], dtype=int32))</span>
<span class="go"> (0.0, array([0, 0], dtype=int32))</span>
<span class="go"> (0.0, array([0, 0], dtype=int32))]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">d</span><span class="o">=</span><span class="n">pyfits</span><span class="o">.</span><span class="n">getdata</span><span class="p">(</span><span class="s">&#39;test.fits&#39;</span><span class="p">,</span><span class="n">ext</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span><span class="n">view</span><span class="o">=</span><span class="n">numpy</span><span class="o">.</span><span class="n">ndarray</span><span class="p">)</span> \
<span class="gp">... </span><span class="c"># Get the first extension from the file as a numpy Record</span>
<span class="go">      Array</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="nb">type</span><span class="p">(</span><span class="n">d</span><span class="p">)</span>
<span class="go">&lt;type &#39;numpy.ndarray&#39;&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">d</span>
<span class="go">[(0.0, [0, 0]) (0.0, [0, 0]) (0.0, [0, 0]) (0.0, [0, 0])</span>
<span class="go"> (0.0, [0, 0])]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">d</span><span class="o">.</span><span class="n">dtype</span>
<span class="go">[(&#39;x&#39;, &#39;&gt;f4&#39;), (&#39;y&#39;, &#39;&gt;i4&#39;, 2)]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">d</span><span class="o">=</span><span class="n">pyfits</span><span class="o">.</span><span class="n">getdata</span><span class="p">(</span><span class="s">&#39;test.fits&#39;</span><span class="p">,</span><span class="n">ext</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span><span class="n">upper</span><span class="o">=</span><span class="bp">True</span><span class="p">,</span>
<span class="gp">... </span>                 <span class="n">view</span><span class="o">=</span><span class="n">pyfits</span><span class="o">.</span><span class="n">FITS_rec</span><span class="p">)</span> \
<span class="gp">... </span><span class="c"># Force the Record Array field names to be in upper case</span>
<span class="go">      regardless of how they are stored in the file</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">d</span><span class="o">.</span><span class="n">dtype</span>
<span class="go">[(&#39;X&#39;, &#39;&gt;f4&#39;), (&#39;Y&#39;, &#39;&gt;i4&#39;, 2)]</span>
</pre></div>
</div>
</li>
<li><p class="first">Provided support for writing fits data to file-like objects that do not
support the random access methods seek() and tell().  Most pyfits functions
or methods will treat these file-like objects as an empty file that cannot
be read, only written.  It is also expected that the file-like object is in
a writable condition (ie. opened) when passed into a pyfits function or
method.  The following methods and functions will allow writing to a
non-random access file-like object: HDUList.writeto(), HDUList.flush(),
pyfits.writeto(), and pyfits.append().  The pyfits.open() convenience
function may be used to create an HDUList object that is associated with the
provided file-like object.  (CNSHD770036)</p>
<p>An illustration of the new capabilities follows.  In this example fits data
is written to standard output which is associated with a file opened in
write-only mode:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">pyfits</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">numpy</span> <span class="kn">as</span> <span class="nn">np</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">sys</span>
<span class="go">&gt;&gt;&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">hdu</span> <span class="o">=</span> <span class="n">pyfits</span><span class="o">.</span><span class="n">PrimaryHDU</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">100</span><span class="p">,</span><span class="n">dtype</span><span class="o">=</span><span class="n">np</span><span class="o">.</span><span class="n">int32</span><span class="p">))</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">hdul</span> <span class="o">=</span> <span class="n">pyfits</span><span class="o">.</span><span class="n">HDUList</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">hdul</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">hdu</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tmpfile</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="s">&#39;tmpfile.py&#39;</span><span class="p">,</span><span class="s">&#39;w&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sys</span><span class="o">.</span><span class="n">stdout</span> <span class="o">=</span> <span class="n">tmpfile</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">hdul</span><span class="o">.</span><span class="n">writeto</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">stdout</span><span class="p">,</span> <span class="n">clobber</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">sys</span><span class="o">.</span><span class="n">stdout</span> <span class="o">=</span> <span class="n">sys</span><span class="o">.</span><span class="n">__stdout__</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tmpfile</span><span class="o">.</span><span class="n">close</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pyfits</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s">&#39;tmpfile.py&#39;</span><span class="p">)</span>
<span class="go">Filename: tmpfile.py</span>
<span class="go">No.    Name         Type      Cards   Dimensions   Format</span>
<span class="go">0    PRIMARY     PrimaryHDU       5  (100,)        int32</span>
<span class="go">&gt;&gt;&gt;</span>
</pre></div>
</div>
</li>
<li><p class="first">Provided support for slicing a FITS_record object.  The FITS_record object
represents the data from a row of a table.  Pyfits now supports the slice
syntax to retrieve values from the row.  The following illustrates this new
syntax:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">hdul</span> <span class="o">=</span> <span class="n">pyfits</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s">&#39;table.fits&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">row</span> <span class="o">=</span> <span class="n">hdul</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">data</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">row</span>
<span class="go">(&#39;clear&#39;, &#39;nicmos&#39;, 1, 30, &#39;clear&#39;, &#39;idno= 100&#39;)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">,</span> <span class="n">c</span><span class="p">,</span> <span class="n">d</span><span class="p">,</span> <span class="n">e</span> <span class="o">=</span> <span class="n">row</span><span class="p">[</span><span class="mi">0</span><span class="p">:</span><span class="mi">5</span><span class="p">]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">a</span>
<span class="go">&#39;clear&#39;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">b</span>
<span class="go">&#39;nicmos&#39;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">c</span>
<span class="go">1</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">d</span>
<span class="go">30</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">e</span>
<span class="go">&#39;clear&#39;</span>
<span class="go">&gt;&gt;&gt;</span>
</pre></div>
</div>
</li>
<li><p class="first">Allow the assignment of a row value for a pyfits table using a tuple or a
list as input.  The following example illustrates this new feature:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">c1</span><span class="o">=</span><span class="n">pyfits</span><span class="o">.</span><span class="n">Column</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&#39;target&#39;</span><span class="p">,</span><span class="n">format</span><span class="o">=</span><span class="s">&#39;10A&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">c2</span><span class="o">=</span><span class="n">pyfits</span><span class="o">.</span><span class="n">Column</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&#39;counts&#39;</span><span class="p">,</span><span class="n">format</span><span class="o">=</span><span class="s">&#39;J&#39;</span><span class="p">,</span><span class="n">unit</span><span class="o">=</span><span class="s">&#39;DN&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">c3</span><span class="o">=</span><span class="n">pyfits</span><span class="o">.</span><span class="n">Column</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&#39;notes&#39;</span><span class="p">,</span><span class="n">format</span><span class="o">=</span><span class="s">&#39;A10&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">c4</span><span class="o">=</span><span class="n">pyfits</span><span class="o">.</span><span class="n">Column</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&#39;spectrum&#39;</span><span class="p">,</span><span class="n">format</span><span class="o">=</span><span class="s">&#39;5E&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">c5</span><span class="o">=</span><span class="n">pyfits</span><span class="o">.</span><span class="n">Column</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&#39;flag&#39;</span><span class="p">,</span><span class="n">format</span><span class="o">=</span><span class="s">&#39;L&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">coldefs</span><span class="o">=</span><span class="n">pyfits</span><span class="o">.</span><span class="n">ColDefs</span><span class="p">([</span><span class="n">c1</span><span class="p">,</span><span class="n">c2</span><span class="p">,</span><span class="n">c3</span><span class="p">,</span><span class="n">c4</span><span class="p">,</span><span class="n">c5</span><span class="p">])</span>
<span class="go">&gt;&gt;&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tbhdu</span><span class="o">=</span><span class="n">pyfits</span><span class="o">.</span><span class="n">new_table</span><span class="p">(</span><span class="n">coldefs</span><span class="p">,</span> <span class="n">nrows</span> <span class="o">=</span> <span class="mi">5</span><span class="p">)</span>
<span class="go">&gt;&gt;&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c"># Assigning data to a table&#39;s row using a tuple</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tbhdu</span><span class="o">.</span><span class="n">data</span><span class="p">[</span><span class="mi">2</span><span class="p">]</span> <span class="o">=</span> <span class="p">(</span><span class="s">&#39;NGC1&#39;</span><span class="p">,</span><span class="mi">312</span><span class="p">,</span><span class="s">&#39;A Note&#39;</span><span class="p">,</span>
<span class="gp">... </span><span class="n">num</span><span class="o">.</span><span class="n">array</span><span class="p">([</span><span class="mf">1.1</span><span class="p">,</span><span class="mf">2.2</span><span class="p">,</span><span class="mf">3.3</span><span class="p">,</span><span class="mf">4.4</span><span class="p">,</span><span class="mf">5.5</span><span class="p">],</span><span class="n">dtype</span><span class="o">=</span><span class="n">num</span><span class="o">.</span><span class="n">float32</span><span class="p">),</span>
<span class="gp">... </span><span class="bp">True</span><span class="p">)</span>
<span class="go">&gt;&gt;&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c"># Assigning data to a tables row using a list</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tbhdu</span><span class="o">.</span><span class="n">data</span><span class="p">[</span><span class="mi">3</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="s">&#39;JIM1&#39;</span><span class="p">,</span><span class="s">&#39;33&#39;</span><span class="p">,</span><span class="s">&#39;A Note&#39;</span><span class="p">,</span>
<span class="gp">... </span><span class="n">num</span><span class="o">.</span><span class="n">array</span><span class="p">([</span><span class="mf">1.</span><span class="p">,</span><span class="mf">2.</span><span class="p">,</span><span class="mf">3.</span><span class="p">,</span><span class="mf">4.</span><span class="p">,</span><span class="mf">5.</span><span class="p">],</span><span class="n">dtype</span><span class="o">=</span><span class="n">num</span><span class="o">.</span><span class="n">float32</span><span class="p">),</span><span class="bp">True</span><span class="p">]</span>
</pre></div>
</div>
</li>
<li><p class="first">Allow the creation of a Variable Length Format (P format) column from a list
of data.  The following example illustrates this new feature:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">a</span> <span class="o">=</span> <span class="p">[</span><span class="n">num</span><span class="o">.</span><span class="n">array</span><span class="p">([</span><span class="mf">7.2e-20</span><span class="p">,</span><span class="mf">7.3e-20</span><span class="p">]),</span><span class="n">num</span><span class="o">.</span><span class="n">array</span><span class="p">([</span><span class="mf">0.0</span><span class="p">]),</span>
<span class="gp">... </span><span class="n">num</span><span class="o">.</span><span class="n">array</span><span class="p">([</span><span class="mf">0.0</span><span class="p">])]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">acol</span> <span class="o">=</span> <span class="n">pyfits</span><span class="o">.</span><span class="n">Column</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&#39;testa&#39;</span><span class="p">,</span><span class="n">format</span><span class="o">=</span><span class="s">&#39;PD()&#39;</span><span class="p">,</span><span class="n">array</span><span class="o">=</span><span class="n">a</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">acol</span><span class="o">.</span><span class="n">array</span>
<span class="go">_VLF([[  7.20000000e-20   7.30000000e-20], [ 0.], [ 0.]],</span>
<span class="go">dtype=object)</span>
<span class="go">&gt;&gt;&gt;</span>
</pre></div>
</div>
</li>
<li><p class="first">Allow the assignment of multiple rows in a table using the slice syntax. The
following example illustrates this new feature:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">counts</span> <span class="o">=</span> <span class="n">num</span><span class="o">.</span><span class="n">array</span><span class="p">([</span><span class="mi">312</span><span class="p">,</span><span class="mi">334</span><span class="p">,</span><span class="mi">308</span><span class="p">,</span><span class="mi">317</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">names</span> <span class="o">=</span> <span class="n">num</span><span class="o">.</span><span class="n">array</span><span class="p">([</span><span class="s">&#39;NGC1&#39;</span><span class="p">,</span><span class="s">&#39;NGC2&#39;</span><span class="p">,</span><span class="s">&#39;NGC3&#39;</span><span class="p">,</span><span class="s">&#39;NCG4&#39;</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">c1</span><span class="o">=</span><span class="n">pyfits</span><span class="o">.</span><span class="n">Column</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&#39;target&#39;</span><span class="p">,</span><span class="n">format</span><span class="o">=</span><span class="s">&#39;10A&#39;</span><span class="p">,</span><span class="n">array</span><span class="o">=</span><span class="n">names</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">c2</span><span class="o">=</span><span class="n">pyfits</span><span class="o">.</span><span class="n">Column</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&#39;counts&#39;</span><span class="p">,</span><span class="n">format</span><span class="o">=</span><span class="s">&#39;J&#39;</span><span class="p">,</span><span class="n">unit</span><span class="o">=</span><span class="s">&#39;DN&#39;</span><span class="p">,</span>
<span class="gp">... </span><span class="n">array</span><span class="o">=</span><span class="n">counts</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">c3</span><span class="o">=</span><span class="n">pyfits</span><span class="o">.</span><span class="n">Column</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&#39;notes&#39;</span><span class="p">,</span><span class="n">format</span><span class="o">=</span><span class="s">&#39;A10&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">c4</span><span class="o">=</span><span class="n">pyfits</span><span class="o">.</span><span class="n">Column</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&#39;spectrum&#39;</span><span class="p">,</span><span class="n">format</span><span class="o">=</span><span class="s">&#39;5E&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">c5</span><span class="o">=</span><span class="n">pyfits</span><span class="o">.</span><span class="n">Column</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&#39;flag&#39;</span><span class="p">,</span><span class="n">format</span><span class="o">=</span><span class="s">&#39;L&#39;</span><span class="p">,</span><span class="n">array</span><span class="o">=</span><span class="p">[</span><span class="mi">1</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">1</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">coldefs</span><span class="o">=</span><span class="n">pyfits</span><span class="o">.</span><span class="n">ColDefs</span><span class="p">([</span><span class="n">c1</span><span class="p">,</span><span class="n">c2</span><span class="p">,</span><span class="n">c3</span><span class="p">,</span><span class="n">c4</span><span class="p">,</span><span class="n">c5</span><span class="p">])</span>
<span class="go">&gt;&gt;&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tbhdu1</span><span class="o">=</span><span class="n">pyfits</span><span class="o">.</span><span class="n">new_table</span><span class="p">(</span><span class="n">coldefs</span><span class="p">)</span>
<span class="go">&gt;&gt;&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">counts</span> <span class="o">=</span> <span class="n">num</span><span class="o">.</span><span class="n">array</span><span class="p">([</span><span class="mi">112</span><span class="p">,</span><span class="mi">134</span><span class="p">,</span><span class="mi">108</span><span class="p">,</span><span class="mi">117</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">names</span> <span class="o">=</span> <span class="n">num</span><span class="o">.</span><span class="n">array</span><span class="p">([</span><span class="s">&#39;NGC5&#39;</span><span class="p">,</span><span class="s">&#39;NGC6&#39;</span><span class="p">,</span><span class="s">&#39;NGC7&#39;</span><span class="p">,</span><span class="s">&#39;NCG8&#39;</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">c1</span><span class="o">=</span><span class="n">pyfits</span><span class="o">.</span><span class="n">Column</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&#39;target&#39;</span><span class="p">,</span><span class="n">format</span><span class="o">=</span><span class="s">&#39;10A&#39;</span><span class="p">,</span><span class="n">array</span><span class="o">=</span><span class="n">names</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">c2</span><span class="o">=</span><span class="n">pyfits</span><span class="o">.</span><span class="n">Column</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&#39;counts&#39;</span><span class="p">,</span><span class="n">format</span><span class="o">=</span><span class="s">&#39;J&#39;</span><span class="p">,</span><span class="n">unit</span><span class="o">=</span><span class="s">&#39;DN&#39;</span><span class="p">,</span>
<span class="gp">... </span><span class="n">array</span><span class="o">=</span><span class="n">counts</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">c3</span><span class="o">=</span><span class="n">pyfits</span><span class="o">.</span><span class="n">Column</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&#39;notes&#39;</span><span class="p">,</span><span class="n">format</span><span class="o">=</span><span class="s">&#39;A10&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">c4</span><span class="o">=</span><span class="n">pyfits</span><span class="o">.</span><span class="n">Column</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&#39;spectrum&#39;</span><span class="p">,</span><span class="n">format</span><span class="o">=</span><span class="s">&#39;5E&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">c5</span><span class="o">=</span><span class="n">pyfits</span><span class="o">.</span><span class="n">Column</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s">&#39;flag&#39;</span><span class="p">,</span><span class="n">format</span><span class="o">=</span><span class="s">&#39;L&#39;</span><span class="p">,</span><span class="n">array</span><span class="o">=</span><span class="p">[</span><span class="mi">0</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">0</span><span class="p">,</span><span class="mi">0</span><span class="p">])</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">coldefs</span><span class="o">=</span><span class="n">pyfits</span><span class="o">.</span><span class="n">ColDefs</span><span class="p">([</span><span class="n">c1</span><span class="p">,</span><span class="n">c2</span><span class="p">,</span><span class="n">c3</span><span class="p">,</span><span class="n">c4</span><span class="p">,</span><span class="n">c5</span><span class="p">])</span>
<span class="go">&gt;&gt;&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tbhdu</span><span class="o">=</span><span class="n">pyfits</span><span class="o">.</span><span class="n">new_table</span><span class="p">(</span><span class="n">coldefs</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tbhdu</span><span class="o">.</span><span class="n">data</span><span class="p">[</span><span class="mi">0</span><span class="p">][</span><span class="mi">3</span><span class="p">]</span> <span class="o">=</span> <span class="n">num</span><span class="o">.</span><span class="n">array</span><span class="p">([</span><span class="mf">1.</span><span class="p">,</span><span class="mf">2.</span><span class="p">,</span><span class="mf">3.</span><span class="p">,</span><span class="mf">4.</span><span class="p">,</span><span class="mf">5.</span><span class="p">],</span>
<span class="gp">... </span><span class="n">dtype</span><span class="o">=</span><span class="n">num</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span>
<span class="go">&gt;&gt;&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tbhdu2</span><span class="o">=</span><span class="n">pyfits</span><span class="o">.</span><span class="n">new_table</span><span class="p">(</span><span class="n">tbhdu1</span><span class="o">.</span><span class="n">data</span><span class="p">,</span> <span class="n">nrows</span><span class="o">=</span><span class="mi">9</span><span class="p">)</span>
<span class="go">&gt;&gt;&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="c"># Assign the 4 rows from the second table to rows 5 thru</span>
<span class="gp">... </span>  <span class="mi">8</span> <span class="n">of</span> <span class="n">the</span> <span class="n">new</span> <span class="n">table</span><span class="o">.</span>  <span class="n">Note</span> <span class="n">that</span> <span class="n">the</span> <span class="n">last</span> <span class="n">row</span> <span class="n">of</span> <span class="n">the</span> <span class="n">new</span>
<span class="gp">... </span>  <span class="n">table</span> <span class="n">will</span> <span class="n">still</span> <span class="n">be</span> <span class="n">initialized</span> <span class="n">to</span> <span class="n">the</span> <span class="n">default</span> <span class="n">values</span><span class="o">.</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">tbhdu2</span><span class="o">.</span><span class="n">data</span><span class="p">[</span><span class="mi">4</span><span class="p">:]</span> <span class="o">=</span> <span class="n">tbhdu</span><span class="o">.</span><span class="n">data</span>
<span class="go">&gt;&gt;&gt;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">tbhdu2</span><span class="o">.</span><span class="n">data</span>
<span class="go">[ (&#39;NGC1&#39;, 312, &#39;0.0&#39;, array([ 0.,  0.,  0.,  0.,  0.],</span>
<span class="go">dtype=float32), True)</span>
<span class="go">  (&#39;NGC2&#39;, 334, &#39;0.0&#39;, array([ 0.,  0.,  0.,  0.,  0.],</span>
<span class="go">dtype=float32), False)</span>
<span class="go">  (&#39;NGC3&#39;, 308, &#39;0.0&#39;, array([ 0.,  0.,  0.,  0.,  0.],</span>
<span class="go">dtype=float32), True)</span>
<span class="go">  (&#39;NCG4&#39;, 317, &#39;0.0&#39;, array([ 0.,  0.,  0.,  0.,  0.],</span>
<span class="go">dtype=float32), True)</span>
<span class="go">  (&#39;NGC5&#39;, 112, &#39;0.0&#39;, array([ 1.,  2.,  3.,  4.,  5.],</span>
<span class="go">dtype=float32), False)</span>
<span class="go">  (&#39;NGC6&#39;, 134, &#39;0.0&#39;, array([ 0.,  0.,  0.,  0.,  0.],</span>
<span class="go">dtype=float32), True)</span>
<span class="go">  (&#39;NGC7&#39;, 108, &#39;0.0&#39;, array([ 0.,  0.,  0.,  0.,  0.],</span>
<span class="go">dtype=float32), False)</span>
<span class="go">  (&#39;NCG8&#39;, 117, &#39;0.0&#39;, array([ 0.,  0.,  0.,  0.,  0.],</span>
<span class="go">dtype=float32), False)</span>
<span class="go">  (&#39;0.0&#39;, 0, &#39;0.0&#39;, array([ 0.,  0.,  0.,  0.,  0.],</span>
<span class="go">dtype=float32), False)]</span>
<span class="go">&gt;&gt;&gt;</span>
</pre></div>
</div>
</li>
</ul>
<p>The following bugs were fixed:</p>
<ul>
<li><p class="first">Corrected bugs in HDUList.append and HDUList.insert to correctly handle the
situation where you want to insert or append a Primary HDU as something
other than the first HDU in an HDUList and the situation where you want to
insert or append an Extension HDU as the first HDU in an HDUList.</p>
</li>
<li><p class="first">Corrected a bug involving scaled images (both compressed and not compressed)
that include a BLANK, or ZBLANK card in the header.  When the image values
match the BLANK or ZBLANK value, the value should be replaced with NaN after
scaling.  Instead, pyfits was scaling the BLANK or ZBLANK value and
returning it. (CNSHD766129)</p>
</li>
<li><p class="first">Corrected a byteswapping bug that occurs when writing certain column data.
(CNSHD763307)</p>
</li>
<li><p class="first">Corrected a bug that occurs when creating a column from a chararray when one
or more elements are shorter than the specified format length.  The bug
wrote nulls instead of spaces to the file. (CNSHD695419)</p>
</li>
<li><p class="first">Corrected a bug in the HDU verification software to ensure that the header
contains no NAXISn cards where n &gt; NAXIS.</p>
</li>
<li><p class="first">Corrected a bug involving reading and writing compressed image data.  When
written, the header keyword card ZTENSION will always have the value &#8216;IMAGE&#8217;
and when read, if the ZTENSION value is not &#8216;IMAGE&#8217; the user will receive a
warning, but the data will still be treated as image data.</p>
</li>
<li><p class="first">Corrected a bug that restricted the ability to create a custom HDU class and
use it with pyfits.  The bug fix will allow something like this:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">pyfits</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">class</span> <span class="nc">MyPrimaryHDU</span><span class="p">(</span><span class="n">pyfits</span><span class="o">.</span><span class="n">PrimaryHDU</span><span class="p">):</span>
<span class="gp">... </span>    <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">header</span><span class="o">=</span><span class="bp">None</span><span class="p">):</span>
<span class="gp">... </span>        <span class="n">pyfits</span><span class="o">.</span><span class="n">PrimaryHDU</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="p">,</span> <span class="n">header</span><span class="p">)</span>
<span class="gp">... </span>    <span class="k">def</span> <span class="nf">_summary</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
<span class="gp">... </span>        <span class="sd">&quot;&quot;&quot;</span>
<span class="gp">... </span><span class="sd">        Reimplement a method of the class.</span>
<span class="gp">... </span><span class="sd">        &quot;&quot;&quot;</span>
<span class="gp">... </span>        <span class="n">s</span> <span class="o">=</span> <span class="n">pyfits</span><span class="o">.</span><span class="n">PrimaryHDU</span><span class="o">.</span><span class="n">_summary</span><span class="p">(</span><span class="bp">self</span><span class="p">)</span>
<span class="gp">... </span>        <span class="c"># change the behavior to suit me.</span>
<span class="gp">... </span>        <span class="n">s1</span> <span class="o">=</span> <span class="s">&#39;MyPRIMARY &#39;</span> <span class="o">+</span> <span class="n">s</span><span class="p">[</span><span class="mi">11</span><span class="p">:]</span>
<span class="gp">... </span>        <span class="k">return</span> <span class="n">s1</span>
<span class="gp">...</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">hdul</span><span class="o">=</span><span class="n">pyfits</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s">&quot;pix.fits&quot;</span><span class="p">,</span>
<span class="gp">... </span><span class="n">classExtensions</span><span class="o">=</span><span class="p">{</span><span class="n">pyfits</span><span class="o">.</span><span class="n">PrimaryHDU</span><span class="p">:</span> <span class="n">MyPrimaryHDU</span><span class="p">})</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">hdul</span><span class="o">.</span><span class="n">info</span><span class="p">()</span>
<span class="go">Filename: pix.fits</span>
<span class="go">No.    Name         Type      Cards   Dimensions   Format</span>
<span class="go">0    MyPRIMARY  MyPrimaryHDU     59  (512, 512)    int16</span>
<span class="go">&gt;&gt;&gt;</span>
</pre></div>
</div>
</li>
<li><p class="first">Modified ColDefs.add_col so that instead of returning a new ColDefs object
with the column added to the end, it simply appends the new column to the
current ColDefs object in place.  (CNSHD768778)</p>
</li>
<li><p class="first">Corrected a bug in ColDefs.del_col which raised a KeyError exception when
deleting a column from a ColDefs object.</p>
</li>
<li><p class="first">Modified the open convenience function so that when a file is opened in
readonly mode and the file contains no HDU&#8217;s an IOError is raised.</p>
</li>
<li><p class="first">Modified _TableBaseHDU to ensure that all locations where data is referenced
in the object actually reference the same ndarray, instead of copies of the
array.</p>
</li>
<li><p class="first">Corrected a bug in the Column class that failed to initialize data when the
data is a boolean array.  (CNSHD779136)</p>
</li>
<li><p class="first">Corrected a bug that caused an exception to be raised when creating a
variable length format column from character data (PA format).</p>
</li>
<li><p class="first">Modified installation code so that when installing on Windows, when a C++
compiler compatable with the Python binary is not found, the installation
completes with a warning that all optional extension modules failed to
build.  Previously, an Error was issued and the installation stopped.</p>
</li>
</ul>
</div>
<div class="section" id="id32">
<h2><a class="toc-backref" href="#id94">2.2.2 (2009-10-12)</a><a class="headerlink" href="#id32" title="Permalink to this headline">¶</a></h2>
<p>Updates described in this release are only supported in the NUMPY version of
pyfits.</p>
<p>The following bugs were fixed:</p>
<ul class="simple">
<li>Corrected a bug that caused an exception to be raised when creating a
CompImageHDU using an initial header that does not match the image data in
terms of the number of axis.</li>
</ul>
</div>
<div class="section" id="id33">
<h2><a class="toc-backref" href="#id95">2.2.1 (2009-10-06)</a><a class="headerlink" href="#id33" title="Permalink to this headline">¶</a></h2>
<p>Updates described in this release are only supported in the NUMPY version of
pyfits.</p>
<p>The following bugs were fixed:</p>
<ul class="simple">
<li>Corrected a bug that prevented the opening of a fits file where a header
contained a CHECKSUM card but no DATASUM card.</li>
<li>Corrected a bug that caused NULLs to be written instead of blanks when an
ASCII table was created using a numpy chararray in which the original data
contained trailing blanks.  (CNSHD695419)</li>
</ul>
</div>
<div class="section" id="id34">
<h2><a class="toc-backref" href="#id96">2.2 (2009-09-23)</a><a class="headerlink" href="#id34" title="Permalink to this headline">¶</a></h2>
<p>Updates described in this release are only supported in the NUMPY version of
pyfits.</p>
<p>The following enhancements were made:</p>
<ul>
<li><p class="first">Provide support for the FITS Checksum Keyword Convention.  (CNSHD754301)</p>
</li>
<li><p class="first">Adding the checksum=True keyword argument to the open convenience function
will cause checksums to be verified on file open:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">hdul</span><span class="o">=</span><span class="n">pyfits</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s">&#39;in.fits&#39;</span><span class="p">,</span> <span class="n">checksum</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
</pre></div>
</div>
</li>
<li><p class="first">On output, CHECKSUM and DATASUM cards may be output to all HDU&#8217;s in a fits
file by using the keyword argument checksum=True in calls to the writeto
convenience function, the HDUList.writeto method, the writeto methods of all
of the HDU classes, and the append convenience function:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">hdul</span><span class="o">.</span><span class="n">writeto</span><span class="p">(</span><span class="s">&#39;out.fits&#39;</span><span class="p">,</span> <span class="n">checksum</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
</pre></div>
</div>
</li>
<li><p class="first">Implemented a new insert method to the HDUList class that allows for the
insertion of a HDU into a HDUList at a given index:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">hdul</span><span class="o">.</span><span class="n">insert</span><span class="p">(</span><span class="mi">2</span><span class="p">,</span><span class="n">hdu</span><span class="p">)</span>
</pre></div>
</div>
</li>
<li><p class="first">Provided the capability to handle unicode input for file names.</p>
</li>
<li><p class="first">Provided support for integer division required by Python 3.0.</p>
</li>
</ul>
<p>The following bugs were fixed:</p>
<ul>
<li><p class="first">Corrected a bug that caused an index out of bounds exception to be raised
when iterating over the rows of a binary table HDU using the syntax  &#8220;for
row in tbhdu.data:   &#8221;.  (CNSHD748609)</p>
</li>
<li><p class="first">Corrected a bug that prevented the use of the writeto convenience function
for writing table data to a file.  (CNSHD749024)</p>
</li>
<li><p class="first">Modified the code to raise an IOError exception with the comment &#8220;Header
missing END card.&#8221; when pyfits can&#8217;t find a valid END card for a header when
opening a file.</p>
<ul>
<li><p class="first">This change addressed a problem with a non-standard fits file that
contained several new-line characters at the end of each header and at the
end of the file.  However, since some people want to be able to open these
non-standard files anyway, an option was added to the open convenience
function to allow these files to be opened without exception:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">pyfits</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s">&#39;infile.fits&#39;</span><span class="p">,</span><span class="n">ignore_missing_end</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
</pre></div>
</div>
</li>
</ul>
</li>
<li><p class="first">Corrected a bug that prevented the use of StringIO objects as fits files
when reading and writing table data.  Previously, only image data was
supported.  (CNSHD753698)</p>
</li>
<li><p class="first">Corrected a bug that caused a bus error to be generated when compressing
image data using GZIP_1 under the Solaris operating system.</p>
</li>
<li><p class="first">Corrected bugs that prevented pyfits from properly reading Random Groups
HDU&#8217;s using numpy.  (CNSHD756570)</p>
</li>
<li><p class="first">Corrected a bug that can occur when writing a fits file.  (CNSHD757508)</p>
<ul class="simple">
<li>If no default SIGINT signal handler has not been assigned, before the
write, a TypeError exception is raised in the _File.flush() method when
attempting to return the signal handler to its previous state.  Notably
this occurred when using mod_python.  The code was changed to use SIG_DFL
when no old handler was defined.</li>
</ul>
</li>
<li><p class="first">Corrected a bug in CompImageHDU that prevented rescaling the image data
using hdu.scale(option=&#8217;old&#8217;).</p>
</li>
</ul>
</div>
<div class="section" id="id35">
<h2><a class="toc-backref" href="#id97">2.1.1 (2009-04-22)</a><a class="headerlink" href="#id35" title="Permalink to this headline">¶</a></h2>
<p>Updates described in this release are only supported in the NUMPY version of
pyfits.</p>
<p>The following bugs were fixed:</p>
<ul class="simple">
<li>Corrected a bug that caused an exception to be raised when closing a file
opened for append, where an HDU was appended to the file, after data was
accessed from the file.  This exception was only raised when running on a
Windows platform.</li>
<li>Updated the installation scripts, compression source code, and benchmark
test scripts to properly install, build, and execute on a Windows platform.</li>
</ul>
</div>
<div class="section" id="id36">
<h2><a class="toc-backref" href="#id98">2.1 (2009-04-14)</a><a class="headerlink" href="#id36" title="Permalink to this headline">¶</a></h2>
<p>Updates described in this release are only supported in the NUMPY version of
pyfits.</p>
<p>The following enhancements were made:</p>
<ul>
<li><p class="first">Added new tdump and tcreate capabilities to pyfits.</p>
<ul class="simple">
<li>The new tdump convenience function allows the contents of a binary table
HDU to be dumped to a set of three files in ASCII format.  One file will
contain column definitions, the second will contain header parameters, and
the third will contain header data.</li>
<li>The new tcreate convenience function allows the creation of a binary table
HDU from the three files dumped by the tdump convenience function.</li>
<li>The primary use for the tdump/tcreate methods are to allow editing in a
standard text editor of the binary table data and parameters.</li>
</ul>
</li>
<li><p class="first">Added support for case sensitive values of the EXTNAME card in an extension
header.  (CNSHD745784)</p>
<ul>
<li><p class="first">By default, pyfits converts the value of EXTNAME cards to upper case when
reading from a file.  A new convenience function
(setExtensionNameCaseSensitive) was implemented to allow a user to
circumvent this behavior so that the EXTNAME value remains in the same
case as it is in the file.</p>
</li>
<li><p class="first">With the following function call, pyfits will maintain the case of all
characters in the EXTNAME card values of all extension HDU&#8217;s during the
entire python session, or until another call to the function is made:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">pyfits</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">pyfits</span><span class="o">.</span><span class="n">setExtensionNameCaseSensitive</span><span class="p">()</span>
</pre></div>
</div>
</li>
<li><p class="first">The following function call will return pyfits to its default (all upper
case) behavior:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">pyfits</span><span class="o">.</span><span class="n">setExtensionNameCaseSensitive</span><span class="p">(</span><span class="bp">False</span><span class="p">)</span>
</pre></div>
</div>
</li>
</ul>
</li>
<li><p class="first">Added support for reading and writing FITS files in which the value of the
first card in the header is &#8216;SIMPLE=F&#8217;.  In this case, the pyfits open
function returns an HDUList object that contains a single HDU of the new
type _NonstandardHDU.  The header for this HDU is like a normal header (with
the exception that the first card contains SIMPLE=F instead of SIMPLE=T).
Like normal HDU&#8217;s the reading of the data is delayed until actually
requested.  The data is read from the file into a string starting from the
first byte after the header END card and continuing till the end of the
file.  When written, the header is written, followed by the data string.  No
attempt is made to pad the data string so that it fills into a standard 2880
byte FITS block.  (CNSHD744730)</p>
</li>
<li><p class="first">Added support for FITS files containing  extensions with unknown XTENSION
card values.  (CNSHD744730)  Standard FITS files support extension HDU&#8217;s of
types TABLE, IMAGE, BINTABLE, and A3DTABLE.  Accessing a nonstandard
extension from a FITS file will now create a _NonstandardExtHDU object.
Accessing the data of this object will cause the data to be read from the
file into a string.  If the HDU is written back to a file the string data is
written after the Header and padded to fill a standard 2880 byte FITS block.</p>
</li>
</ul>
<p>The following bugs were fixed:</p>
<ul class="simple">
<li>Extensive changes were made to the tiled image compression code to support
the latest enhancements made in CFITSIO version 3.13 to support this
convention.</li>
<li>Eliminated a memory leak in the tiled image compression code.</li>
<li>Corrected a bug in the FITS_record.__setitem__ method which raised a
NameError exception when attempting to set a value in a FITS_record object.
(CNSHD745844)</li>
<li>Corrected a bug that caused a TypeError exception to be raised when reading
fits files containing large table HDU&#8217;s (&gt;2Gig).  (CNSHD745522)</li>
<li>Corrected a bug that caused a TypeError exception to be raised for all calls
to the warnings module when running under Python 2.6.  The formatwarning
method in the warnings module was changed in Python 2.6 to include a new
argument.  (CNSHD746592)</li>
<li>Corrected the behavior of the membership (in) operator in the Header class
to check against header card keywords instead of card values.  (CNSHD744730)</li>
<li>Corrected the behavior of iteration on a Header object.  The new behavior
iterates over the unique card keywords instead of the card values.</li>
</ul>
</div>
<div class="section" id="id37">
<h2><a class="toc-backref" href="#id99">2.0.1 (2009-02-03)</a><a class="headerlink" href="#id37" title="Permalink to this headline">¶</a></h2>
<p>Updates described in this release are only supported in the NUMPY version of
pyfits.</p>
<p>The following bugs were fixed:</p>
<ul class="simple">
<li>Eliminated a memory leak when reading Table HDU&#8217;s from a fits file.
(CNSHD741877)</li>
</ul>
</div>
<div class="section" id="id38">
<h2><a class="toc-backref" href="#id100">2.0 (2009-01-30)</a><a class="headerlink" href="#id38" title="Permalink to this headline">¶</a></h2>
<p>Updates described in this release are only supported in the NUMPY version of
pyfits.</p>
<p>The following enhancements were made:</p>
<ul>
<li><p class="first">Provide initial support for an image compression convention known as the
&#8220;Tiled Image Compression Convention&#8221; <a class="reference external" href="http://fits.gsfc.nasa.gov/registry/tilecompression.html">[1]</a>.</p>
<ul>
<li><p class="first">The principle used in this convention is to first divide the n-dimensional
image into a rectangular grid of subimages or &#8220;tiles&#8221;.  Each tile is then
compressed as a continuous block of data, and the resulting compressed
byte stream is stored in a row of a variable length column in a FITS
binary table.  Several commonly used algorithms for compressing image
tiles are supported.  These include, GZIP, RICE, H-Compress and IRAF pixel
list (PLIO).</p>
</li>
<li><p class="first">Support for compressed image data is provided using the optional
&#8220;pyfitsComp&#8221; module contained in a C shared library (pyfitsCompmodule.so).</p>
</li>
<li><p class="first">The header of a compressed image HDU appears to the user like any image
header.  The actual header stored in the FITS file is that of a binary
table HDU with a set of special keywords, defined by the convention, to
describe the structure of the compressed image.  The conversion between
binary table HDU header and image HDU header is all performed behind the
scenes.  Since the HDU is actually a binary table, it may not appear as a
primary HDU in a FITS file.</p>
</li>
<li><p class="first">The data of a compressed image HDU appears to the user as standard
uncompressed image data.  The actual data is stored in the fits file as
Binary Table data containing at least one column (COMPRESSED_DATA).  Each
row of this variable-length column contains the byte stream that was
generated as a result of compressing the corresponding image tile.
Several optional columns may also appear.  These include,
UNCOMPRESSED_DATA to hold the uncompressed pixel values for tiles that
cannot be compressed, ZSCALE and ZZERO to hold the linear scale factor and
zero point offset which may be needed to transform the raw uncompressed
values back to the original image pixel values, and ZBLANK to hold the
integer value used to represent undefined pixels (if any) in the image.</p>
</li>
<li><p class="first">To create a compressed image HDU from scratch, simply construct a
CompImageHDU object from an uncompressed image data array and its
associated image header.  From there, the HDU can be treated just like any
image HDU:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">hdu</span><span class="o">=</span><span class="n">pyfits</span><span class="o">.</span><span class="n">CompImageHDU</span><span class="p">(</span><span class="n">imageData</span><span class="p">,</span><span class="n">imageHeader</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">hdu</span><span class="o">.</span><span class="n">writeto</span><span class="p">(</span><span class="s">&#39;compressed_image.fits&#39;</span><span class="p">)</span>
</pre></div>
</div>
</li>
<li><p class="first">The signature for the CompImageHDU initializer method describes the
possible options for constructing a CompImageHDU object:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">data</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">header</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
             <span class="n">compressionType</span><span class="o">=</span><span class="s">&#39;RICE_1&#39;</span><span class="p">,</span>
             <span class="n">tileSize</span><span class="o">=</span><span class="bp">None</span><span class="p">,</span>
             <span class="n">hcompScale</span><span class="o">=</span><span class="mf">0.</span><span class="p">,</span>
             <span class="n">hcompSmooth</span><span class="o">=</span><span class="mi">0</span><span class="p">,</span>
             <span class="n">quantizeLevel</span><span class="o">=</span><span class="mf">16.</span><span class="p">):</span>
    <span class="sd">&quot;&quot;&quot;</span>
<span class="sd">        data:            data of the image</span>
<span class="sd">        header:          header to be associated with the</span>
<span class="sd">                         image</span>
<span class="sd">        name:            the EXTNAME value; if this value</span>
<span class="sd">                         is None, then the name from the</span>
<span class="sd">                         input image header will be used;</span>
<span class="sd">                         if there is no name in the input</span>
<span class="sd">                         image header then the default name</span>
<span class="sd">                         &#39;COMPRESSED_IMAGE&#39; is used</span>
<span class="sd">        compressionType: compression algorithm &#39;RICE_1&#39;,</span>
<span class="sd">                         &#39;PLIO_1&#39;, &#39;GZIP_1&#39;, &#39;HCOMPRESS_1&#39;</span>
<span class="sd">        tileSize:        compression tile sizes default</span>
<span class="sd">                         treats each row of image as a tile</span>
<span class="sd">        hcompScale:      HCOMPRESS scale parameter</span>
<span class="sd">        hcompSmooth:     HCOMPRESS smooth parameter</span>
<span class="sd">        quantizeLevel:   floating point quantization level;</span>
<span class="sd">    &quot;&quot;&quot;</span>
</pre></div>
</div>
</li>
</ul>
</li>
<li><p class="first">Added two new convenience functions.  The setval function allows the setting
of the value of a single header card in a fits file.  The delval function
allows the deletion of a single header card in a fits file.</p>
</li>
<li><p class="first">A modification was made to allow the reading of data from a fits file
containing a Table HDU that has duplicate field names.  It is normally a
requirement that the field names in a Table HDU be unique.  Prior to this
change a ValueError was raised, when the data was accessed, to indicate that
the HDU contained duplicate field names.  Now, a warning is issued and the
field names are made unique in the internal record array.  This will not
change the TTYPEn header card values.  You will be able to get the data from
all fields using the field name, including the first field containing the
name that is duplicated.  To access the data of the other fields with the
duplicated names you will need to use the field number instead of the field
name.  (CNSHD737193)</p>
</li>
<li><p class="first">An enhancement was made to allow the reading of unsigned integer 16 values
from an ImageHDU when the data is signed integer 16 and BZERO is equal to
32784 and BSCALE is equal to 1 (the standard way for scaling unsigned
integer 16 data).  A new optional keyword argument (uint16) was added to the
open convenience function.  Supplying a value of True for this argument will
cause data of this type to be read in and scaled into an unsigned integer 16
array, instead of a float 32 array.  If a HDU associated with a file that
was opened with the uint16 option and containing unsigned integer 16 data is
written to a file, the data will be reverse scaled into an integer 16 array
and written out to the file and the BSCALE/BZERO header cards will be
written with the values 1 and 32768 respectively.  (CHSHD736064) Reference
the following example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">pyfits</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">hdul</span><span class="o">=</span><span class="n">pyfits</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s">&#39;o4sp040b0_raw.fits&#39;</span><span class="p">,</span><span class="n">uint16</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">hdul</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">data</span>
<span class="go">array([[1507, 1509, 1505, ..., 1498, 1500, 1487],</span>
<span class="go">       [1508, 1507, 1509, ..., 1498, 1505, 1490],</span>
<span class="go">       [1505, 1507, 1505, ..., 1499, 1504, 1491],</span>
<span class="go">       ...,</span>
<span class="go">       [1505, 1506, 1507, ..., 1497, 1502, 1487],</span>
<span class="go">       [1507, 1507, 1504, ..., 1495, 1499, 1486],</span>
<span class="go">       [1515, 1507, 1504, ..., 1492, 1498, 1487]], dtype=uint16)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">hdul</span><span class="o">.</span><span class="n">writeto</span><span class="p">(</span><span class="s">&#39;tmp.fits&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">hdul1</span><span class="o">=</span><span class="n">pyfits</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s">&#39;tmp.fits&#39;</span><span class="p">,</span><span class="n">uint16</span><span class="o">=</span><span class="mi">1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">hdul1</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">data</span>
<span class="go">array([[1507, 1509, 1505, ..., 1498, 1500, 1487],</span>
<span class="go">       [1508, 1507, 1509, ..., 1498, 1505, 1490],</span>
<span class="go">       [1505, 1507, 1505, ..., 1499, 1504, 1491],</span>
<span class="go">       ...,</span>
<span class="go">       [1505, 1506, 1507, ..., 1497, 1502, 1487],</span>
<span class="go">       [1507, 1507, 1504, ..., 1495, 1499, 1486],</span>
<span class="go">       [1515, 1507, 1504, ..., 1492, 1498, 1487]], dtype=uint16)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">hdul1</span><span class="o">=</span><span class="n">pyfits</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s">&#39;tmp.fits&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">hdul1</span><span class="p">[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">data</span>
<span class="go">array([[ 1507.,  1509.,  1505., ...,  1498.,  1500.,  1487.],</span>
<span class="go">       [ 1508.,  1507.,  1509., ...,  1498.,  1505.,  1490.],</span>
<span class="go">       [ 1505.,  1507.,  1505., ...,  1499.,  1504.,  1491.],</span>
<span class="go">       ...,</span>
<span class="go">       [ 1505.,  1506.,  1507., ...,  1497.,  1502.,  1487.],</span>
<span class="go">       [ 1507.,  1507.,  1504., ...,  1495.,  1499.,  1486.],</span>
<span class="go">       [ 1515.,  1507.,  1504., ...,  1492.,  1498.,  1487.]], dtype=float32)</span>
</pre></div>
</div>
</li>
<li><p class="first">Enhanced the message generated when a ValueError exception is raised when
attempting to access a header card with an unparsable value.  The message
now includes the Card name.</p>
</li>
</ul>
<p>The following bugs were fixed:</p>
<ul class="simple">
<li>Corrected a bug that occurs when appending a binary table HDU to a fits
file.  Data was not being byteswapped on little endian machines.
(CNSHD737243)</li>
<li>Corrected a bug that occurs when trying to write an ImageHDU that is missing
the required PCOUNT card in the header.  An UnboundLocalError exception
complaining that the local variable &#8216;insert_pos&#8217; was referenced before
assignment was being raised in the method _ValidHDU.req_cards.  The code was
modified so that it would properly issue a more meaningful ValueError
exception with a description of what required card is missing in the header.</li>
<li>Eliminated a redundant warning message about the PCOUNT card when validating
an ImageHDU header with a PCOUNT card that is missing or has a value other
than 0.</li>
</ul>
</div>
<div class="section" id="id40">
<h2><a class="toc-backref" href="#id101">1.4.1 (2008-11-04)</a><a class="headerlink" href="#id40" title="Permalink to this headline">¶</a></h2>
<p>Updates described in this release are only supported in the NUMPY version of
pyfits.</p>
<p>The following enhancements were made:</p>
<ul class="simple">
<li>Enhanced the way import errors are reported to provide more information.</li>
</ul>
<p>The following bugs were fixed:</p>
<ul class="simple">
<li>Corrected a bug that occurs when a card value is a string and contains a
colon but is not a record-valued keyword card.</li>
<li>Corrected a bug where pyfits fails to properly handle a record-valued
keyword card with values using exponential notation and trailing blanks.</li>
</ul>
</div>
<div class="section" id="id41">
<h2><a class="toc-backref" href="#id102">1.4 (2008-07-07)</a><a class="headerlink" href="#id41" title="Permalink to this headline">¶</a></h2>
<p>Updates described in this release are only supported in the NUMPY version of
pyfits.</p>
<p>The following enhancements were made:</p>
<ul>
<li><p class="first">Added support for file objects and file like objects.</p>
<ul class="simple">
<li>All convenience functions and class methods that take a file name will now
also accept a file object or file like object.  File like objects
supported are StringIO and GzipFile objects.  Other file like objects will
work only if they implement all of the standard file object methods.</li>
<li>For the most part, file or file like objects may be either opened or
closed at function call.  An opened object must be opened with the proper
mode depending on the function or method called.  Whenever possible, if
the object is opened before the method is called, it will remain open
after the call.  This will not be possible when writing a HDUList that has
been resized or when writing to a GzipFile object regardless of whether it
is resized.  If the object is closed at the time of the function call,
only the name from the object is used, not the object itself.  The pyfits
code will extract the file name used by the object and use that to create
an underlying file object on which the function will be performed.</li>
</ul>
</li>
<li><p class="first">Added support for record-valued keyword cards as introduced in the &#8220;FITS WCS
Paper IV proposal for representing a more general distortion model&#8221;.</p>
<ul>
<li><p class="first">Record-valued keyword cards are string-valued cards where the string is
interpreted as a definition giving a record field name, and its floating
point value.  In a FITS header they have the following syntax:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">keyword</span><span class="o">=</span> <span class="s">&#39;field-specifier: float&#39;</span>
</pre></div>
</div>
<p>where keyword is a standard eight-character FITS keyword name, float is
the standard FITS ASCII representation of a floating point number, and
these are separated by a colon followed by a single blank.</p>
<p>The grammer for field-specifier is:</p>
<div class="highlight-python"><pre>field-specifier:
    field
    field-specifier.field

field:
    identifier
    identifier.index</pre>
</div>
<p>where identifier is a sequence of letters (upper or lower case),
underscores, and digits of which the first character must not be a digit,
and index is a sequence of digits.  No blank characters may occur in the
field-specifier.  The index is provided primarily for defining array
elements though it need not be used for that purpose.</p>
<p>Multiple record-valued keywords of the same name but differing values may
be present in a FITS header.  The field-specifier may be viewed as part of
the keyword name.</p>
<p>Some examples follow:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="n">DP1</span>     <span class="o">=</span> <span class="s">&#39;NAXIS: 2&#39;</span>
<span class="n">DP1</span>     <span class="o">=</span> <span class="s">&#39;AXIS.1: 1&#39;</span>
<span class="n">DP1</span>     <span class="o">=</span> <span class="s">&#39;AXIS.2: 2&#39;</span>
<span class="n">DP1</span>     <span class="o">=</span> <span class="s">&#39;NAUX: 2&#39;</span>
<span class="n">DP1</span>     <span class="o">=</span> <span class="s">&#39;AUX.1.COEFF.0: 0&#39;</span>
<span class="n">DP1</span>     <span class="o">=</span> <span class="s">&#39;AUX.1.POWER.0: 1&#39;</span>
<span class="n">DP1</span>     <span class="o">=</span> <span class="s">&#39;AUX.1.COEFF.1: 0.00048828125&#39;</span>
<span class="n">DP1</span>     <span class="o">=</span> <span class="s">&#39;AUX.1.POWER.1: 1&#39;</span>
</pre></div>
</div>
</li>
<li><p class="first">As with standard header cards, the value of a record-valued keyword card
can be accessed using either the index of the card in a HDU&#8217;s header or
via the keyword name.  When accessing using the keyword name, the user may
specify just the card keyword or the card keyword followed by a period
followed by the field-specifier.  Note that while the card keyword is case
insensitive, the field-specifier is not.  Thus, hdu[&#8216;abc.def&#8217;],
hdu[&#8216;ABC.def&#8217;], or hdu[&#8216;aBc.def&#8217;] are all equivalent but hdu[&#8216;ABC.DEF&#8217;] is
not.</p>
</li>
<li><p class="first">When accessed using the card index of the HDU&#8217;s header the value returned
will be the entire string value of the card.  For example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">hdr</span><span class="p">[</span><span class="mi">10</span><span class="p">]</span>
<span class="go">NAXIS: 2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">hdr</span><span class="p">[</span><span class="mi">11</span><span class="p">]</span>
<span class="go">AXIS.1: 1</span>
</pre></div>
</div>
</li>
<li><p class="first">When accessed using the keyword name exclusive of the field-specifier, the
entire string value of the header card with the lowest index having that
keyword name will be returned.  For example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">hdr</span><span class="p">[</span><span class="s">&#39;DP1&#39;</span><span class="p">]</span>
<span class="go">NAXIS: 2</span>
</pre></div>
</div>
</li>
<li><p class="first">When accessing using the keyword name and the field-specifier, the value
returned will be the floating point value associated with the
record-valued keyword card.  For example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">hdr</span><span class="p">[</span><span class="s">&#39;DP1.NAXIS&#39;</span><span class="p">]</span>
<span class="go">2.0</span>
</pre></div>
</div>
</li>
<li><p class="first">Any attempt to access a non-existent record-valued keyword card value will
cause an exception to be raised (IndexError exception for index access or
KeyError for keyword name access).</p>
</li>
<li><p class="first">Updating the value of a record-valued keyword card can also be
accomplished using either index or keyword name.  For example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">hdr</span><span class="p">[</span><span class="s">&#39;DP1.NAXIS&#39;</span><span class="p">]</span>
<span class="go">2.0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">hdr</span><span class="p">[</span><span class="s">&#39;DP1.NAXIS&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="mf">3.0</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">hdr</span><span class="p">[</span><span class="s">&#39;DP1.NAXIS&#39;</span><span class="p">]</span>
<span class="go">3.0</span>
</pre></div>
</div>
</li>
<li><p class="first">Adding a new record-valued keyword card to an existing header is
accomplished using the Header.update() method just like any other card.
For example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">hdr</span><span class="o">.</span><span class="n">update</span><span class="p">(</span><span class="s">&#39;DP1&#39;</span><span class="p">,</span> <span class="s">&#39;AXIS.3: 1&#39;</span><span class="p">,</span> <span class="s">&#39;a comment&#39;</span><span class="p">,</span> <span class="n">after</span><span class="o">=</span><span class="s">&#39;DP1.AXIS.2&#39;</span><span class="p">)</span>
</pre></div>
</div>
</li>
<li><p class="first">Deleting a record-valued keyword card from an existing header is
accomplished using the standard list deletion syntax just like any other
card.  For example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="k">del</span> <span class="n">hdr</span><span class="p">[</span><span class="s">&#39;DP1.AXIS.1&#39;</span><span class="p">]</span>
</pre></div>
</div>
</li>
<li><p class="first">In addition to accessing record-valued keyword cards individually using a
card index or keyword name, cards can be accessed in groups using a set of
special pattern matching keys.  This access is made available via the
standard list indexing operator providing a keyword name string that
contains one or more of the special pattern matching keys.  Instead of
returning a value, a CardList object will be returned containing shared
instances of the Cards in the header that match the given keyword
specification.</p>
</li>
<li><p class="first">There are three special pattern matching keys.  The first key &#8216;*&#8217; will
match any string of zero or more characters within the current level of
the field-specifier.  The second key &#8216;?&#8217; will match a single character.
The third key &#8216;...&#8217; must appear at the end of the keyword name string and
will match all keywords that match the preceding pattern down all levels
of the field-specifier.  All combinations of ?, *, and ... are permitted
(though ... is only permitted at the end).  Some examples follow:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">cl</span><span class="o">=</span><span class="n">hdr</span><span class="p">[</span><span class="s">&#39;DP1.AXIS.*&#39;</span><span class="p">]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">cl</span>
<span class="go">DP1     = &#39;AXIS.1: 1&#39;</span>
<span class="go">DP1     = &#39;AXIS.2: 2&#39;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">cl</span><span class="o">=</span><span class="n">hdr</span><span class="p">[</span><span class="s">&#39;DP1.*&#39;</span><span class="p">]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">cl</span>
<span class="go">DP1     = &#39;NAXIS: 2&#39;</span>
<span class="go">DP1     = &#39;NAUX: 2&#39;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">cl</span><span class="o">=</span><span class="n">hdr</span><span class="p">[</span><span class="s">&#39;DP1.AUX...&#39;</span><span class="p">]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">cl</span>
<span class="go">DP1     = &#39;AUX.1.COEFF.0: 0&#39;</span>
<span class="go">DP1     = &#39;AUX.1.POWER.0: 1&#39;</span>
<span class="go">DP1     = &#39;AUX.1.COEFF.1: 0.00048828125&#39;</span>
<span class="go">DP1     = &#39;AUX.1.POWER.1: 1&#39;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">cl</span><span class="o">=</span><span class="n">hdr</span><span class="p">[</span><span class="s">&#39;DP?.NAXIS&#39;</span><span class="p">]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">cl</span>
<span class="go">DP1     = &#39;NAXIS: 2&#39;</span>
<span class="go">DP2     = &#39;NAXIS: 2&#39;</span>
<span class="go">DP3     = &#39;NAXIS: 2&#39;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">cl</span><span class="o">=</span><span class="n">hdr</span><span class="p">[</span><span class="s">&#39;DP1.A*S.*&#39;</span><span class="p">]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">cl</span>
<span class="go">DP1     = &#39;AXIS.1: 1&#39;</span>
<span class="go">DP1     = &#39;AXIS.2: 2&#39;</span>
</pre></div>
</div>
</li>
<li><p class="first">The use of the special pattern matching keys for adding or updating header
cards in an existing header is not allowed.  However, the deletion of
cards from the header using the special keys is allowed.  For example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="k">del</span> <span class="n">hdr</span><span class="p">[</span><span class="s">&#39;DP3.A*...&#39;</span><span class="p">]</span>
</pre></div>
</div>
</li>
</ul>
</li>
<li><p class="first">As noted above, accessing pyfits Header object using the special pattern
matching keys will return a CardList object.  This CardList object can
itself be searched in order to further refine the list of Cards.  For
example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">cl</span><span class="o">=</span><span class="n">hdr</span><span class="p">[</span><span class="s">&#39;DP1...&#39;</span><span class="p">]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">cl</span>
<span class="go">DP1     = &#39;NAXIS: 2&#39;</span>
<span class="go">DP1     = &#39;AXIS.1: 1&#39;</span>
<span class="go">DP1     = &#39;AXIS.2: 2&#39;</span>
<span class="go">DP1     = &#39;NAUX: 2&#39;</span>
<span class="go">DP1     = &#39;AUX.1.COEFF.1: 0.000488&#39;</span>
<span class="go">DP1     = &#39;AUX.2.COEFF.2: 0.00097656&#39;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">cl1</span><span class="o">=</span><span class="n">cl</span><span class="p">[</span><span class="s">&#39;*.*AUX...&#39;</span><span class="p">]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">cl1</span>
<span class="go">DP1     = &#39;NAUX: 2&#39;</span>
<span class="go">DP1     = &#39;AUX.1.COEFF.1: 0.000488&#39;</span>
<span class="go">DP1     = &#39;AUX.2.COEFF.2: 0.00097656&#39;</span>
</pre></div>
</div>
<ul>
<li><p class="first">The CardList keys() method will allow the retrivial of all of the key
values in the CardList.  For example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">cl</span><span class="o">=</span><span class="n">hdr</span><span class="p">[</span><span class="s">&#39;DP1.AXIS.*&#39;</span><span class="p">]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">cl</span>
<span class="go">DP1     = &#39;AXIS.1: 1&#39;</span>
<span class="go">DP1     = &#39;AXIS.2: 2&#39;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">cl</span><span class="o">.</span><span class="n">keys</span><span class="p">()</span>
<span class="go">[&#39;DP1.AXIS.1&#39;, &#39;DP1.AXIS.2&#39;]</span>
</pre></div>
</div>
</li>
<li><p class="first">The CardList values() method will allow the retrivial of all of the values
in the CardList.  For example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">cl</span><span class="o">=</span><span class="n">hdr</span><span class="p">[</span><span class="s">&#39;DP1.AXIS.*&#39;</span><span class="p">]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">cl</span>
<span class="go">DP1     = &#39;AXIS.1: 1&#39;</span>
<span class="go">DP1     = &#39;AXIS.2: 2&#39;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">cl</span><span class="o">.</span><span class="n">values</span><span class="p">()</span>
<span class="go">[1.0, 2.0]</span>
</pre></div>
</div>
</li>
<li><p class="first">Individual cards can be retrieved from the list using standard list
indexing.  For example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">cl</span><span class="o">=</span><span class="n">hdr</span><span class="p">[</span><span class="s">&#39;DP1.AXIS.*&#39;</span><span class="p">]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">c</span><span class="o">=</span><span class="n">cl</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">c</span>
<span class="go">DP1     = &#39;AXIS.1: 1&#39;</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">c</span><span class="o">=</span><span class="n">cl</span><span class="p">[</span><span class="s">&#39;DP1.AXIS.2&#39;</span><span class="p">]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">c</span>
<span class="go">DP1     = &#39;AXIS.2: 2&#39;</span>
</pre></div>
</div>
</li>
<li><p class="first">Individual card values can be retrieved from the list using the value
attribute of the card.  For example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">cl</span><span class="o">=</span><span class="n">hdr</span><span class="p">[</span><span class="s">&#39;DP1.AXIS.*&#39;</span><span class="p">]</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">cl</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span><span class="o">.</span><span class="n">value</span>
<span class="go">1.0</span>
</pre></div>
</div>
</li>
<li><p class="first">The cards in the CardList are shared instances of the cards in the source
header.  Therefore, modifying a card in the CardList also modifies it in
the source header.  However, making an addition or a deletion to the
CardList will not affect the source header.  For example:</p>
<div class="highlight-python"><pre>&gt;&gt;&gt; hdr['DP1.AXIS.1']
1.0
&gt;&gt;&gt; cl=hdr['DP1.AXIS.*']
&gt;&gt;&gt; cl[0].value = 4.0
&gt;&gt;&gt; hdr['DP1.AXIS.1']
4.0
&gt;&gt;&gt; del cl[0]
&gt;&gt;&gt; print cl['DP1.AXIS.1']
Traceback (most recent call last):
File "&lt;stdin&gt;", line 1, in &lt;module&gt;
File "NP_pyfits.py", line 977, in __getitem__
  return self.ascard[key].value
File "NP_pyfits.py", line 1258, in __getitem__
  _key = self.index_of(key)
File "NP_pyfits.py", line 1403, in index_of
  raise KeyError, 'Keyword %s not found.' % `key`
KeyError: "Keyword 'DP1.AXIS.1' not found."
&gt;&gt;&gt; hdr['DP1.AXIS.1']
4.0</pre>
</div>
</li>
<li><p class="first">A FITS header consists of card images.  In pyfits each card image is
manifested by a Card object.  A pyfits Header object contains a list of
Card objects in the form of a CardList object.  A record-valued keyword
card image is represented in pyfits by a RecordValuedKeywordCard object.
This object inherits from a Card object and has all of the methods and
attributes of a Card object.</p>
</li>
<li><p class="first">A new RecordValuedKeywordCard object is created with the
RecordValuedKeywordCard constructor: RecordValuedKeywordCard(key, value,
comment).  The key and value arguments may be specified in two ways.  The
key value may be given as the 8 character keyword only, in which case the
value must be a character string containing the field-specifier, a colon
followed by a space, followed by the actual value.  The second option is
to provide the key as a string containing the keyword and field-specifier,
in which case the value must be the actual floating point value.  For
example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">c1</span> <span class="o">=</span> <span class="n">pyfits</span><span class="o">.</span><span class="n">RecordValuedKeywordCard</span><span class="p">(</span><span class="s">&#39;DP1&#39;</span><span class="p">,</span> <span class="s">&#39;NAXIS: 2&#39;</span><span class="p">,</span> <span class="s">&#39;Number of variables&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">c2</span> <span class="o">=</span> <span class="n">pyfits</span><span class="o">.</span><span class="n">RecordValuedKeywordCard</span><span class="p">(</span><span class="s">&#39;DP1.AXIS.1&#39;</span><span class="p">,</span> <span class="mf">1.0</span><span class="p">,</span> <span class="s">&#39;Axis number&#39;</span><span class="p">)</span>
</pre></div>
</div>
</li>
<li><p class="first">RecordValuedKeywordCards have attributes .key, .field_specifier, .value,
and .comment.  Both .value and .comment can be changed but not .key or
.field_specifier.  The constructor will extract the field-specifier from
the input key or value, whichever is appropriate.  The .key attribute is
the 8 character keyword.</p>
</li>
<li><p class="first">Just like standard Cards, a RecordValuedKeywordCard may be constructed
from a string using the fromstring() method or verified using the verify()
method.  For example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">c1</span> <span class="o">=</span> <span class="n">pyfits</span><span class="o">.</span><span class="n">RecordValuedKeywordCard</span><span class="p">()</span><span class="o">.</span><span class="n">fromstring</span><span class="p">(</span>
<span class="go">         &quot;DP1     = &#39;NAXIS: 2&#39; / Number of independent variables&quot;)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">c2</span> <span class="o">=</span> <span class="n">pyfits</span><span class="o">.</span><span class="n">RecordValuedKeywordCard</span><span class="p">()</span><span class="o">.</span><span class="n">fromstring</span><span class="p">(</span>
<span class="go">         &quot;DP1     = &#39;AXIS.1: X&#39; / Axis number&quot;)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="n">c1</span><span class="p">;</span> <span class="k">print</span> <span class="n">c2</span>
<span class="go">DP1     = &#39;NAXIS: 2&#39; / Number of independent variables</span>
<span class="go">DP1     = &#39;AXIS.1: X&#39; / Axis number</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">c2</span><span class="o">.</span><span class="n">verify</span><span class="p">()</span>
<span class="go">Output verification result:</span>
<span class="go">Card image is not FITS standard (unparsable value string).</span>
</pre></div>
</div>
</li>
<li><p class="first">A standard card that meets the criteria of a RecordValuedKeywordCard may
be turned into a RecordValuedKeywordCard using the class method coerce.
If the card object does not meet the required criteria then the original
card object is just returned.</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">c1</span> <span class="o">=</span> <span class="n">pyfits</span><span class="o">.</span><span class="n">Card</span><span class="p">(</span><span class="s">&#39;DP1&#39;</span><span class="p">,</span><span class="s">&#39;AUX: 1&#39;</span><span class="p">,</span><span class="s">&#39;comment&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">c2</span> <span class="o">=</span> <span class="n">pyfits</span><span class="o">.</span><span class="n">RecordValuedKeywordCard</span><span class="o">.</span><span class="n">coerce</span><span class="p">(</span><span class="n">c1</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="nb">type</span><span class="p">(</span><span class="n">c2</span><span class="p">)</span>
<span class="go">&lt;&#39;pyfits.NP_pyfits.RecordValuedKeywordCard&#39;&gt;</span>
</pre></div>
</div>
</li>
<li><p class="first">Two other card creation methods are also available as
RecordVauedKeywordCard class methods.  These are createCard() which will
create the appropriate card object (Card or RecordValuedKeywordCard) given
input key, value, and comment, and createCardFromString which will create
the appropriate card object given an input string.  These two methods are
also available as convenience functions:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">c1</span> <span class="o">=</span> <span class="n">pyfits</span><span class="o">.</span><span class="n">RecordValuedKeywordCard</span><span class="o">.</span><span class="n">createCard</span><span class="p">(</span><span class="s">&#39;DP1&#39;</span><span class="p">,</span><span class="s">&#39;AUX: 1&#39;</span><span class="p">,</span><span class="s">&#39;comment)</span>
</pre></div>
</div>
<p>or</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">c1</span> <span class="o">=</span> <span class="n">pyfits</span><span class="o">.</span><span class="n">createCard</span><span class="p">(</span><span class="s">&#39;DP1&#39;</span><span class="p">,</span><span class="s">&#39;AUX: 1&#39;</span><span class="p">,</span><span class="s">&#39;comment)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="nb">type</span><span class="p">(</span><span class="n">c1</span><span class="p">)</span>
<span class="go">&lt;&#39;pyfits.NP_pyfits.RecordValuedKeywordCard&#39;&gt;</span>
</pre></div>
</div>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">c1</span> <span class="o">=</span> <span class="n">pyfits</span><span class="o">.</span><span class="n">RecordValuedKeywordCard</span><span class="o">.</span><span class="n">createCard</span><span class="p">(</span><span class="s">&#39;DP1&#39;</span><span class="p">,</span><span class="s">&#39;AUX 1&#39;</span><span class="p">,</span><span class="s">&#39;comment)</span>
</pre></div>
</div>
<p>or</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">c1</span> <span class="o">=</span> <span class="n">pyfits</span><span class="o">.</span><span class="n">createCard</span><span class="p">(</span><span class="s">&#39;DP1&#39;</span><span class="p">,</span><span class="s">&#39;AUX 1&#39;</span><span class="p">,</span><span class="s">&#39;comment)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="nb">type</span><span class="p">(</span><span class="n">c1</span><span class="p">)</span>
<span class="go">&lt;&#39;pyfits.NP_pyfits.Card&#39;&gt;</span>
</pre></div>
</div>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">c1</span> <span class="o">=</span> <span class="n">pyfits</span><span class="o">.</span><span class="n">RecordValuedKeywordCard</span><span class="o">.</span><span class="n">createCardFromString</span> \
<span class="go">         (&quot;DP1 = &#39;AUX: 1.0&#39; / comment&quot;)</span>
</pre></div>
</div>
<p>or</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">c1</span> <span class="o">=</span> <span class="n">pyfits</span><span class="o">.</span><span class="n">createCardFromString</span><span class="p">(</span><span class="s">&quot;DP1     = &#39;AUX: 1.0&#39; / comment&quot;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="nb">type</span><span class="p">(</span><span class="n">c1</span><span class="p">)</span>
<span class="go">&lt;&#39;pyfits.NP_pyfits.RecordValuedKeywordCard&#39;&gt;</span>
</pre></div>
</div>
</li>
</ul>
</li>
</ul>
<p>The following bugs were fixed:</p>
<ul class="simple">
<li>Corrected a bug that occurs when writing a HDU out to a file.  During the
write, any Keyboard Interrupts are trapped so that the write completes
before the interrupt is handled.  Unfortunately, the Keyboard Interrupt was
not properly reinstated after the write completed.  This was fixed.
(CNSHD711138)</li>
<li>Corrected a bug when using ipython, where temporary files created with the
tempFile.NamedTemporaryFile method are not automatically removed.  This can
happen for instance when opening a Gzipped fits file or when open a fits
file over the internet.  The files will now be removed.  (CNSHD718307)</li>
<li>Corrected a bug in the append convenience function&#8217;s call to the writeto
convenience function.  The classExtensions argument must be passed as a
keyword argument.</li>
<li>Corrected a bug that occurs when retrieving variable length character arrays
from binary table HDUs (PA() format) and using slicing to obtain rows of
data containing variable length arrays.  The code issued a TypeError
exception.  The data can now be accessed with no exceptions. (CNSHD718749)</li>
<li>Corrected a bug that occurs when retrieving data from a fits file opened in
memory map mode when the file contains multiple image extensions or ASCII
table or binary table HDUs.  The code issued a TypeError exception.  The
data can now be accessed with no exceptions.  (CNSHD707426)</li>
<li>Corrected a bug that occurs when attempting to get a subset of data from a
Binary Table HDU and then use the data to create a new Binary Table HDU
object.  A TypeError exception was raised.  The data can now be subsetted
and used to create a new HDU.  (CNSHD723761)</li>
<li>Corrected a bug that occurs when attempting to scale an Image HDU back to
its original data type using the _ImageBaseHDU.scale method.  The code was
not resetting the BITPIX header card back to the original data type.  This
has been corrected.</li>
<li>Changed the code to issue a KeyError exception instead of a NameError
exception when accessing a non-existent field in a table.</li>
</ul>
</div>
<div class="section" id="id42">
<h2><a class="toc-backref" href="#id103">1.3 (2008-02-22)</a><a class="headerlink" href="#id42" title="Permalink to this headline">¶</a></h2>
<p>Updates described in this release are only supported in the NUMPY version of
pyfits.</p>
<p>The following enhancements were made:</p>
<ul>
<li><p class="first">Provided support for a new extension to pyfits called <em>stpyfits</em>.</p>
<ul class="simple">
<li>The <em>stpyfits</em> module is a wrapper around pyfits.  It provides all of the
features and functions of pyfits along with some STScI specific features.
Currently, the only new feature supported by stpyfits is the ability to
read and write fits files that contain image data quality extensions with
constant data value arrays.  See stpyfits <a class="reference external" href="http://stsdas.stsci.edu/stsci_python_sphinxdocs_2.13/tools/stpyfits.html">[2]</a> for more details on
stpyfits.</li>
</ul>
</li>
<li><p class="first">Added a new feature to allow trailing HDUs to be deleted from a fits file
without actually reading the data from the file.</p>
<ul class="simple">
<li>This supports a JWST requirement to delete a trailing HDU from a file
whose primary Image HDU is too large to be read on a 32 bit machine.</li>
</ul>
</li>
<li><p class="first">Updated pyfits to use the warnings module to issue warnings.  All warnings
will still be issued to stdout, exactly as they were before, however, you
may now suppress warnings with the -Wignore command line option.  For
example, to run a script that will ignore warnings use the following command
line syntax:</p>
<blockquote>
<div><p>python -Wignore yourscript.py</p>
</div></blockquote>
</li>
<li><p class="first">Updated the open convenience function to allow the input of an already
opened file object in place of a file name when opening a fits file.</p>
</li>
<li><p class="first">Updated the writeto convenience function to allow it to accept the
output_verify option.</p>
<ul class="simple">
<li>In this way, the user can use the argument output_verify=&#8217;fix&#8217; to allow
pyfits to correct any errors it encounters in the provided header before
writing the data to the file.</li>
</ul>
</li>
<li><p class="first">Updated the verification code to provide additional detail with a
VerifyError exception.</p>
</li>
<li><p class="first">Added the capability to create a binary table HDU directly from a
numpy.ndarray.  This may be done using either the new_table convenience
function or the BinTableHDU constructor.</p>
</li>
</ul>
<p>The following performance improvements were made:</p>
<ul class="simple">
<li>Modified the import logic to dramatically decrease the time it takes to
import pyfits.</li>
<li>Modified the code to provide performance improvements when copying and
examining header cards.</li>
</ul>
<p>The following bugs were fixed:</p>
<ul class="simple">
<li>Corrected a bug that occurs when reading the data from a fits file that
includes BZERO/BSCALE scaling.  When the data is read in from the file,
pyfits automatically scales the data using the BZERO/BSCALE values in the
header.  In the previous release, pyfits created a 32 bit floating point
array to hold the scaled data.  This could cause a problem when the value of
BZERO is so large that the scaled value will not fit into the float 32.  For
this release, when the input data is 32 bit integer, a 64 bit floating point
array is used for the scaled data.</li>
<li>Corrected a bug that caused an exception to be raised when attempting to
scale image data using the ImageHDU.scale method.</li>
<li>Corrected a bug in the new_table convenience function that occurred when a
binary table was created using a ColDefs object as input and supplying an
nrows argument for a number of rows that is greater than the number of rows
present in the input ColDefs object.  The previous version of pyfits failed
to allocate the necessary memory for the additional rows.</li>
<li>Corrected a bug in the new_table convenience function that caused an
exception to be thrown when creating an ASCII table.</li>
<li>Corrected a bug in the new_table convenience function that will allow the
input of a ColDefs object that was read from a file as a binary table with a
data value equal to None.</li>
<li>Corrected a bug in the construction of ASCII tables from Column objects that
are created with noncontinuous start columns.</li>
<li>Corrected bugs in a number of areas that would sometimes cause a failure to
improperly raise an exception when an error occurred.</li>
<li>Corrected a bug where attempting to open a non-existent fits file on a
windows platform using a drive letter in the file specification caused a
misleading IOError exception to be raised.</li>
</ul>
</div>
<div class="section" id="id44">
<h2><a class="toc-backref" href="#id104">1.1 (2007-06-15)</a><a class="headerlink" href="#id44" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li>Modified to use either NUMPY or NUMARRAY.</li>
<li>New file writing modes have been provided to allow streaming data to
extensions without requiring the whole output extension image in memory. See
documentation on StreamingHDU.</li>
<li>Improvements to minimize byteswapping and memory usage by byteswapping in
place.</li>
<li>Now supports &#8216;:&#8217; characters in filenames.</li>
<li>Handles keyboard interrupts during long operations.</li>
<li>Preserves the byte order of the input image arrays.</li>
</ul>
</div>
<div class="section" id="id45">
<h2><a class="toc-backref" href="#id105">1.0.1 (2006-03-24)</a><a class="headerlink" href="#id45" title="Permalink to this headline">¶</a></h2>
<p>The changes to PyFITS were primarily to improve the docstrings and to
reclassify some public functions and variables as private. Readgeis and
fitsdiff which were distributed with PyFITS in previous releases were moved to
pytools. This release of PyFITS is v1.0.1. The next release of PyFITS will
support both numarray and numpy (and will be available separately from
stsci_python, as are all the python packages contained within stsci_python).
An alpha release for PyFITS numpy support will be made around the time of this
stsci_python release.</p>
<ul class="simple">
<li>Updated docstrings for public functions.</li>
<li>Made some previously public functions private.</li>
</ul>
</div>
<div class="section" id="id46">
<h2><a class="toc-backref" href="#id106">1.0 (2005-11-01)</a><a class="headerlink" href="#id46" title="Permalink to this headline">¶</a></h2>
<p>Major Changes since v0.9.6:</p>
<ul class="simple">
<li>Added support for the HEIRARCH convention</li>
<li>Added support for iteration and slicing for HDU lists</li>
<li>PyFITS now uses the standard setup.py installation script</li>
<li>Add utility functions at the module level, they include:<ul>
<li>getheader</li>
<li>getdata</li>
<li>getval</li>
<li>writeto</li>
<li>append</li>
<li>update</li>
<li>info</li>
</ul>
</li>
</ul>
<p>Minor changes since v0.9.6:</p>
<ul class="simple">
<li>Fix a bug to make single-column ASCII table work.</li>
<li>Fix a bug so a new table constructed from an existing table with X-formatted
columns will work.</li>
<li>Fix a problem in verifying HDUList right after the open statement.</li>
<li>Verify that elements in an HDUList, besides the first one, are ExtensionHDU.</li>
<li>Add output verification in methods flush() and close().</li>
<li>Modify the the design of the open() function to remove the output_verify
argument.</li>
<li>Remove the groups argument in GroupsHDU&#8217;s contructor.</li>
<li>Redesign the column definition class to make its column components more
accessible.  Also to make it conducive for higher level functionalities,
e.g. combining two column definitions.</li>
<li>Replace the Boolean class with the Python Boolean type.  The old TRUE/FALSE
will still work.</li>
<li>Convert classes to the new style.</li>
<li>Better format when printing card or card list.</li>
<li>Add the optional argument clobber to all writeto() functions and methods.</li>
<li>If adding a blank card, will not use existing blank card&#8217;s space.</li>
</ul>
<p>PyFITS Version 1.0 REQUIRES Python 2.3 or later.</p>
</div>
<div class="section" id="id47">
<h2><a class="toc-backref" href="#id107">0.9.6 (2004-11-11)</a><a class="headerlink" href="#id47" title="Permalink to this headline">¶</a></h2>
<p>Major changes since v0.9.3:</p>
<ul class="simple">
<li>Support for variable length array tables.</li>
<li>Support for writing ASCII table extensions.</li>
<li>Support for random groups, both reading and writing.</li>
</ul>
<p>Some minor changes:</p>
<ul class="simple">
<li>Support for numbers with leading zeros in an ASCII table extension.</li>
<li>Changed scaled columns&#8217; data type from Float32 to Float64 to preserve
precision.</li>
<li>Made Column constructor more flexible in accepting format specification.</li>
</ul>
</div>
<div class="section" id="id48">
<h2><a class="toc-backref" href="#id108">0.9.3 (2004-07-02)</a><a class="headerlink" href="#id48" title="Permalink to this headline">¶</a></h2>
<p>Changes since v0.9.0:</p>
<ul class="simple">
<li>Lazy instanciation of full Headers/Cards for all HDU&#8217;s when the file is
opened.  At the open, only extracts vital info (e.g. NAXIS&#8217;s) from the
header parts.  This change will speed up the performance if the user only
needs to access one extension in a multi-extension FITS file.</li>
<li>Support the X format (bit flags) columns, both reading and writing, in a
binary table.  At the user interface, they are converted to Boolean arrays
for easy manipulation.  For example, if the column&#8217;s TFORM is &#8220;11X&#8221;,
internally the data is stored in 2 bytes, but the user will see, at each row
of this column, a Boolean array of 11 elements.</li>
<li>Fix a bug such that when a table extension has no data, it will not try to
scale the data when updating/writing the HDU list.</li>
</ul>
</div>
<div class="section" id="id49">
<h2><a class="toc-backref" href="#id109">0.9 (2004-04-27)</a><a class="headerlink" href="#id49" title="Permalink to this headline">¶</a></h2>
<p>Changes since v0.8.0:</p>
<ul class="simple">
<li>Rewriting of the Card class to separate the parsing and verification of
header cards</li>
<li>Restructure the keyword indexing scheme which speed up certain applications
(update large number of new keywords and reading a header with larger
numbers of cards) by a factor of 30 or more</li>
<li>Change the default to be lenient FITS standard checking on input and strict
FITS standard checking on output</li>
<li>Support CONTINUE cards, both reading and writing</li>
<li>Verification can now be performed at any of the HDUList, HDU, and Card
levels</li>
<li>Support (contiguous) subsection (attribute .section) of images to reduce
memory usage for large images</li>
</ul>
</div>
<div class="section" id="id50">
<h2><a class="toc-backref" href="#id110">0.8.0 (2003-08-19)</a><a class="headerlink" href="#id50" title="Permalink to this headline">¶</a></h2>
<p><strong>NOTE:</strong> This version will only work with numarray Version 0.6.  In addition,
earlier versions of PyFITS will not work with numarray 0.6.  Therefore, both
must be updated simultaneously.</p>
<p>Changes since 0.7.6:</p>
<ul class="simple">
<li>Compatible with numarray 0.6/records 2.0</li>
<li>For binary tables, now it is possible to update the original array if a
scaled field is updated.</li>
<li>Support of complex columns</li>
<li>Modify the __getitem__ method in FITS_rec.  In order to make sure the scaled
quantities are also viewing ths same data as the original FITS_rec, all
fields need to be &#8220;touched&#8221; when __getitem__ is called.</li>
<li>Add a new attribute mmobject for HDUList, and close the memmap object when
close HDUList object.  Earlier version does not close memmap object and can
cause memory lockup.</li>
<li>Enable &#8216;update&#8217; as a legitimate memmap mode.</li>
<li>Do not print message when closing an HDUList object which is not created
from reading a FITS file.  Such message is confusing.</li>
<li>remove the internal attribute &#8220;closed&#8221; and related method (__getattr__ in
HDUList).  It is redundant.</li>
</ul>
</div>
<div class="section" id="id51">
<h2><a class="toc-backref" href="#id111">0.7.6 (2002-11-22)</a><a class="headerlink" href="#id51" title="Permalink to this headline">¶</a></h2>
<p><strong>NOTE:</strong> This version will only work with numarray Version 0.4.</p>
<p>Changes since 0.7.5:</p>
<ul>
<li><p class="first">Change x*=n to numarray.multiply(x, n, x) where n is a floating number, in
order to make pyfits to work under Python 2.2. (2 occurrences)</p>
</li>
<li><p class="first">Modify the &#8220;update&#8221; method in the Header class to use the &#8220;fixed-format&#8221;
card even if the card already exists.  This is to avoid the mis-alignment as
shown below:</p>
<p>After running drizzle on ACS images it creates a CD matrix whose elements
have very many digits, <em>e.g.</em>:</p>
<blockquote>
<div><p>CD1_1   =  1.1187596304411E-05 / partial of first axis coordinate w.r.t. x
CD1_2   = -8.502767249350019E-06 / partial of first axis coordinate w.r.t. y</p>
</div></blockquote>
<p>with pyfits, an &#8220;update&#8221; on these header items and write in new values which
has fewer digits, <em>e.g.</em>:</p>
<blockquote>
<div><p>CD1_1   =        1.0963011E-05 / partial of first axis coordinate w.r.t. x
CD1_2   =          -8.527229E-06 / partial of first axis coordinate w.r.t. y</p>
</div></blockquote>
</li>
<li><p class="first">Change some internal variables to make their appearance more consistent:</p>
<blockquote>
<div><p>old name                new name</p>
<p>__octalRegex            _octalRegex
__readblock()           _readblock()
__formatter()           _formatter().
__value_RE              _value_RE
__numr                  _numr
__comment_RE            _comment_RE
__keywd_RE              _keywd_RE
__number_RE             _number_RE.
tmpName()               _tmpName()
dimShape                _dimShape
ErrList                 _ErrList</p>
</div></blockquote>
</li>
<li><p class="first">Move up the module description.  Move the copywright statement to the bottom
and assign to the variable __credits__.</p>
</li>
<li><p class="first">change the following line:</p>
<blockquote>
<div><p>self.__dict__ = input.__dict__</p>
</div></blockquote>
<p>to</p>
<blockquote>
<div><p>self.__setstate__(input.__getstate__())</p>
</div></blockquote>
<p>in order for pyfits to run under numarray 0.4.</p>
</li>
<li><p class="first">edit _readblock to add the (optional) firstblock argument and raise IOError
if the the first 8 characters in the first block is not &#8216;SIMPLE  &#8216; or
&#8216;XTENSION&#8217;.  Edit the function open to check for IOError to skip the last
null filled block(s).  Edit readHDU to add the firstblock argument.</p>
</li>
</ul>
</div>
<div class="section" id="id52">
<h2><a class="toc-backref" href="#id112">0.7.5 (2002-08-16)</a><a class="headerlink" href="#id52" title="Permalink to this headline">¶</a></h2>
<p>Changes since v0.7.3:</p>
<ul>
<li><p class="first">Memory mapping now works for readonly mode, both for images and binary
tables.</p>
<p>Usage:  pyfits.open(&#8216;filename&#8217;, memmap=1)</p>
</li>
<li><p class="first">Edit the field method in FITS_rec class to make the column scaling for
numbers use less temporary memory.  (does not work under 2.2, due to Python
&#8220;bug&#8221; of array *=)</p>
</li>
<li><p class="first">Delete bscale/bzero in the ImageBaseHDU constructor.</p>
</li>
<li><p class="first">Update bitpix in BaseImageHDU.__getattr__  after deleting bscale/bzero. (bug
fix)</p>
</li>
<li><p class="first">In BaseImageHDU.__getattr__  point self.data to raw_data if float and if not
memmap.  (bug fix).</p>
</li>
<li><p class="first">Change the function get_tbdata() to private: _get_tbdata().</p>
</li>
</ul>
</div>
<div class="section" id="id53">
<h2><a class="toc-backref" href="#id113">0.7.3 (2002-07-12)</a><a class="headerlink" href="#id53" title="Permalink to this headline">¶</a></h2>
<p>Changes since v0.7.2:</p>
<ul>
<li><p class="first">It will scale all integer image data to Float32, if BSCALE/BZERO != 1/0.  It
will also expunge the BSCALE/BZERO keywords.</p>
</li>
<li><p class="first">Add the scale() method for ImageBaseHDU, so data can be scaled just before
being written to the file.  It has the following arguments:</p>
<p>type: destination data type (string), e.g. Int32, Float32, UInt8, etc.</p>
<p>option: scaling scheme. if &#8216;old&#8217;, use the old BSCALE/BZERO values.  if
&#8216;minmax&#8217;, use the data range to fit into the full range of specified integer
type.  Float destination data type will not be scaled for this option.</p>
<p>bscale/bzero: user specifiable BSCALE/BZERO values.  They overwrite the
&#8220;option&#8221;.</p>
</li>
<li><p class="first">Deal with data area resizing in &#8216;update&#8217; mode.</p>
</li>
<li><p class="first">Make the data scaling (both input and output) faster and use less memory.</p>
</li>
<li><p class="first">Bug fix to make column name change takes effect for field.</p>
</li>
<li><p class="first">Bug fix to avoid exception if the key is not present in the header already.
This affects (fixes) add_history(), add_comment(), and add_blank().</p>
</li>
<li><p class="first">Bug fix in __getattr__() in Card class.  The change made in 0.7.2 to rstrip
the comment must be string type to avoid exception.</p>
</li>
</ul>
</div>
<div class="section" id="id54">
<h2><a class="toc-backref" href="#id114">0.7.2.1 (2002-06-25)</a><a class="headerlink" href="#id54" title="Permalink to this headline">¶</a></h2>
<p>A couple of bugs were addressed in this version.</p>
<ul class="simple">
<li>Fix a bug in _add_commentary(). Due to a change in index_of() during version
0.6.5.5, _add_commentary needs to be modified to avoid exception if the key
is not present in the header already. This affects (fixes) add_history(),
add_comment(), and add_blank().</li>
<li>Fix a bug in __getattr__() in Card class. The change made in 0.7.2 to rstrip
the comment must be string type to avoid exception.</li>
</ul>
</div>
<div class="section" id="id55">
<h2><a class="toc-backref" href="#id115">0.7.2 (2002-06-19)</a><a class="headerlink" href="#id55" title="Permalink to this headline">¶</a></h2>
<p>The two major improvements from Version 0.6.2 are:</p>
<ul class="simple">
<li>support reading tables  with &#8220;scaled&#8221; columns (e.g.  tscal/tzero, Boolean,
and ASCII tables)</li>
<li>a prototype output verification.</li>
</ul>
<p>This version of PyFITS requires numarray version 0.3.4.</p>
<p>Other changes include:</p>
<ul class="simple">
<li>Implement the new HDU hierarchy proposed earlier this year.  This in turn
reduces some of the redundant methods common to several HDU classes.</li>
<li>Add 3 new methods to the Header class: add_history, add_comment, and
add_blank.</li>
<li>The table attributes _columns are now .columns and the attributes in ColDefs
are now all without the underscores.  So, a user can get a list of column
names by: hdu.columns.names.</li>
<li>The &#8220;fill&#8221; argument in the new_table method now has a new meaning:&lt;br&gt; If
set to true (=1), it will fill the entire new table with zeros/blanks.
Otherwise (=0), just the extra rows/cells are filled with zeros/blanks.
Fill values other than zero/blank are now not possible.</li>
<li>Add the argument output_verify to the open method and writeto method.  Not
in the flush or close methods yet, due to possible complication.</li>
<li>A new copy method for tables, the copy is totally independent from the table
it copies from.</li>
<li>The tostring() call in writeHDUdata takes up extra space to store the string
object.  Use tofile() instead, to save space.</li>
<li>Make changes from _byteswap to _byteorder, following corresponding changes
in numarray and recarray.</li>
<li>Insert(update) EXTEND in PrimaryHDU only when header is None.</li>
<li>Strip the trailing blanks for the comment value of a card.</li>
<li>Add seek(0) right after the __buildin__.open(0), because for the &#8216;ab+&#8217; mode,
the pointer is at the end after open in Linux, but it is at the beginning in
Solaris.</li>
<li>Add checking of data against header, update header keywords (NAXIS&#8217;s,
BITPIX) when they don&#8217;t agree with the data.</li>
<li>change version to __version__.</li>
</ul>
<p>There are also many other minor internal bug fixes and
technical changes.</p>
</div>
<div class="section" id="id56">
<h2><a class="toc-backref" href="#id116">0.6.2 (2002-02-12)</a><a class="headerlink" href="#id56" title="Permalink to this headline">¶</a></h2>
<p>This version requires numarray version 0.2.</p>
<p>Things not yet supported but are part of future development:</p>
<ul class="simple">
<li>Verification and/or correction of FITS objects being written to disk so that
they are legal FITS. This is being added now and should be available in
about a month.  Currently, one may construct FITS headers that are
inconsistent with the data and write such FITS objects to disk. Future
versions will provide options to either a) correct discrepancies and warn,
b) correct discrepancies silently, c) throw a Python exception, or d) write
illegal FITS (for test purposes!).</li>
<li>Support for ascii tables or random groups format. Support for ASCII tables
will be done soon (~1 month). When random group support is added is
uncertain.</li>
<li>Support for memory mapping FITS data (to reduce memory demands). We expect
to provide this capability in about 3 months.</li>
<li>Support for columns in binary tables having scaled values (e.g. BSCALE or
BZERO) or boolean values. Currently booleans are stored as Int8 arrays and
users must explicitly convert them into a boolean array. Likewise, scaled
columns must be copied with scaling and offset by testing for those
attributes explicitly. Future versions will produce such copies
automatically.</li>
<li>Support for tables with TNULL values. This awaits an enhancement to numarray
to support mask arrays (planned).  (At least a couple of months off).</li>
</ul>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper"><h3>Page Contents</h3>
<ul>
<li><a class="reference internal" href="#">astropy.io.fits History</a><ul>
<li><a class="reference internal" href="#unreleased">3.2 (unreleased)</a><ul>
<li><a class="reference internal" href="#highlights">Highlights</a></li>
<li><a class="reference internal" href="#api-changes">API Changes</a></li>
<li><a class="reference internal" href="#new-features">New Features</a></li>
</ul>
</li>
<li><a class="reference internal" href="#id1">3.1.3 (unreleased)</a></li>
<li><a class="reference internal" href="#id2">3.0.12 (unreleased)</a></li>
<li><a class="reference internal" href="#id3">3.1.2 (2013-04-22)</a></li>
<li><a class="reference internal" href="#id4">3.0.11 (2013-04-17)</a></li>
<li><a class="reference internal" href="#id5">3.1.1 (2013-01-02)</a><ul>
<li><a class="reference internal" href="#bug-fixes">Bug Fixes</a></li>
</ul>
</li>
<li><a class="reference internal" href="#id6">3.0.10 (2013-01-02)</a></li>
<li><a class="reference internal" href="#id7">3.1 (2012-08-08)</a><ul>
<li><a class="reference internal" href="#id8">Highlights</a></li>
<li><a class="reference internal" href="#id9">API Changes</a></li>
<li><a class="reference internal" href="#id10">New Features</a></li>
<li><a class="reference internal" href="#changes-in-behavior">Changes in Behavior</a></li>
<li><a class="reference internal" href="#id11">Bug Fixes</a></li>
</ul>
</li>
<li><a class="reference internal" href="#id12">3.0.9 (2012-08-06)</a><ul>
<li><a class="reference internal" href="#id13">Bug Fixes</a></li>
</ul>
</li>
<li><a class="reference internal" href="#id14">3.0.8 (2012-06-04)</a><ul>
<li><a class="reference internal" href="#id15">Changes in Behavior</a></li>
<li><a class="reference internal" href="#id16">Bug Fixes</a></li>
</ul>
</li>
<li><a class="reference internal" href="#id17">3.0.7 (2012-04-10)</a><ul>
<li><a class="reference internal" href="#id18">Changes in Behavior</a></li>
<li><a class="reference internal" href="#id19">Bug Fixes</a></li>
</ul>
</li>
<li><a class="reference internal" href="#id20">3.0.6 (2012-02-29)</a><ul>
<li><a class="reference internal" href="#id21">Highlights</a></li>
<li><a class="reference internal" href="#id22">Bug Fixes</a></li>
</ul>
</li>
<li><a class="reference internal" href="#id23">3.0.5 (2012-01-30)</a></li>
<li><a class="reference internal" href="#id24">3.0.4 (2011-11-22)</a></li>
<li><a class="reference internal" href="#id25">3.0.3 (2011-10-05)</a></li>
<li><a class="reference internal" href="#id26">3.0.2 (2011-09-23)</a></li>
<li><a class="reference internal" href="#id27">3.0.1 (2011-09-12)</a></li>
<li><a class="reference internal" href="#id28">3.0.0 (2011-08-23)</a></li>
<li><a class="reference internal" href="#id29">2.4.0 (2011-01-10)</a></li>
<li><a class="reference internal" href="#id30">2.3.1 (2010-06-03)</a></li>
<li><a class="reference internal" href="#id31">2.3 (2010-05-11)</a></li>
<li><a class="reference internal" href="#id32">2.2.2 (2009-10-12)</a></li>
<li><a class="reference internal" href="#id33">2.2.1 (2009-10-06)</a></li>
<li><a class="reference internal" href="#id34">2.2 (2009-09-23)</a></li>
<li><a class="reference internal" href="#id35">2.1.1 (2009-04-22)</a></li>
<li><a class="reference internal" href="#id36">2.1 (2009-04-14)</a></li>
<li><a class="reference internal" href="#id37">2.0.1 (2009-02-03)</a></li>
<li><a class="reference internal" href="#id38">2.0 (2009-01-30)</a></li>
<li><a class="reference internal" href="#id40">1.4.1 (2008-11-04)</a></li>
<li><a class="reference internal" href="#id41">1.4 (2008-07-07)</a></li>
<li><a class="reference internal" href="#id42">1.3 (2008-02-22)</a></li>
<li><a class="reference internal" href="#id44">1.1 (2007-06-15)</a></li>
<li><a class="reference internal" href="#id45">1.0.1 (2006-03-24)</a></li>
<li><a class="reference internal" href="#id46">1.0 (2005-11-01)</a></li>
<li><a class="reference internal" href="#id47">0.9.6 (2004-11-11)</a></li>
<li><a class="reference internal" href="#id48">0.9.3 (2004-07-02)</a></li>
<li><a class="reference internal" href="#id49">0.9 (2004-04-27)</a></li>
<li><a class="reference internal" href="#id50">0.8.0 (2003-08-19)</a></li>
<li><a class="reference internal" href="#id51">0.7.6 (2002-11-22)</a></li>
<li><a class="reference internal" href="#id52">0.7.5 (2002-08-16)</a></li>
<li><a class="reference internal" href="#id53">0.7.3 (2002-07-12)</a></li>
<li><a class="reference internal" href="#id54">0.7.2.1 (2002-06-25)</a></li>
<li><a class="reference internal" href="#id55">0.7.2 (2002-06-19)</a></li>
<li><a class="reference internal" href="#id56">0.6.2 (2002-02-12)</a></li>
</ul>
</li>
</ul>


        </div>
      </div>
      <div class="clearer"></div>
    </div>
<footer class="footer">
  <p class="pull-right">
    <a href="http://github.com/astropy/astropy/tree/v0.2.4/docs/io/fits/appendix/history.rst">Edit This Page on Github</a> &nbsp;
    <a href="../../../_sources/io/fits/appendix/history.txt"
       rel="nofollow">Page Source</a> &nbsp;
    <a href="#">Back to Top</a></p>
  <p>
    &copy; Copyright 2011-2013, The Astropy Developers.<br/>
    Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3. &nbsp;
    Last built 22 Oct 2013. <br/>
  </p>
</footer>
  </body>
</html>