Page MenuHomec4science

PyfitsModule.html
No OneTemporary

File Metadata

Created
Mon, Sep 23, 19:51

PyfitsModule.html

<!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>the pyfits module &mdash; pNbody v4 documentation</title>
<link rel="stylesheet" href="../_static/default.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '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>
<link rel="top" title="pNbody v4 documentation" href="../index.html" />
<link rel="up" title="Reference" href="Reference.html" />
<link rel="next" title="the rec module" href="RecModule.html" />
<link rel="prev" title="the talkgdisp module" href="TalkgdispModule.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="../np-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="RecModule.html" title="the rec module"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="TalkgdispModule.html" title="the talkgdisp module"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">pNbody v4 documentation</a> &raquo;</li>
<li><a href="Reference.html" accesskey="U">Reference</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="module-pNbody.pyfits">
<span id="the-pyfits-module"></span><h1>the pyfits module<a class="headerlink" href="#module-pNbody.pyfits" title="Permalink to this headline"></a></h1>
<p>A module for reading and writing FITS files and manipulating their contents.</p>
<p>A module for reading and writing Flexible Image Transport System
(FITS) files. This file format was endorsed by the International
Astronomical Union in 1999 and mandated by NASA as the standard format
for storing high energy astrophysics data. For details of the FITS
standard, see the NASA/Science Office of Standards and Technology
publication, NOST 100-2.0.</p>
<p>License: <a class="reference external" href="http://www.stsci.edu/resources/software_hardware/pyraf/LICENSE">http://www.stsci.edu/resources/software_hardware/pyraf/LICENSE</a></p>
<p>For detailed examples of usage, see the I{PyFITS User&#8217;s Manual} available from
U{<a class="reference external" href="http://www.stsci.edu/resources/software_hardware/pyfits/Users_Manual1.pdf">http://www.stsci.edu/resources/software_hardware/pyfits/Users_Manual1.pdf</a>}</p>
<p>Epydoc markup used for all docstrings in this module.</p>
<dl class="docutils">
<dt>&#64;group Header-related Classes: Card, CardList, _Card_with_continue,</dt>
<dd>Header, _Hierarch</dd>
<dt>&#64;group HDU Classes: _AllHDU, BinTableHDU, _CorruptedHDU, _ExtensionHDU,</dt>
<dd>GroupsHDU, ImageHDU, _ImageBaseHDU, PrimaryHDU, TableHDU,
_TableBaseHDU, _TempHDU, _ValidHDU</dd>
<dt>&#64;group Table-related Classes: ColDefs, Column, FITS_rec, _FormatP,</dt>
<dd>_FormatX, _VLF</dd>
</dl>
<dl class="class">
<dt id="pNbody.pyfits.BinTableHDU">
<em class="property">class </em><tt class="descclassname">pNbody.pyfits.</tt><tt class="descname">BinTableHDU</tt><big>(</big><em>data=None</em>, <em>header=None</em>, <em>name=None</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.BinTableHDU" title="Permalink to this definition"></a></dt>
<dd><p>Binary table HDU class.</p>
<p class="rubric">Methods</p>
</dd></dl>
<dl class="class">
<dt id="pNbody.pyfits.CardList">
<em class="property">class </em><tt class="descclassname">pNbody.pyfits.</tt><tt class="descname">CardList</tt><big>(</big><em>cards=</em><span class="optional">[</span><span class="optional">]</span>, <em>keylist=None</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.CardList" title="Permalink to this definition"></a></dt>
<dd><p>FITS header card list class.</p>
<p class="rubric">Methods</p>
<dl class="method">
<dt id="pNbody.pyfits.CardList.append">
<tt class="descname">append</tt><big>(</big><em>card</em>, <em>useblanks=1</em>, <em>bottom=0</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.CardList.append" title="Permalink to this definition"></a></dt>
<dd><p>Append a Card to the CardList.</p>
<p>card: The Card to be appended.
useblanks: Use any <em>extra</em> blank cards? default=1.</p>
<blockquote>
<div>If useblanks != 0, and if there are blank cards directly
before END, it will use this space first, instead of
appending after these blank cards, so the total space
will not increase (default). When useblanks == 0, the
card will be appended at the end, even if there are
blank cards in front of END.</div></blockquote>
<dl class="docutils">
<dt>bottom: If =0 (default) the card will be appended after the last</dt>
<dd>non-commentary card. If =1, the card will be appended
after the last non-blank card.</dd>
</dl>
</dd></dl>
<dl class="method">
<dt id="pNbody.pyfits.CardList.copy">
<tt class="descname">copy</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.pyfits.CardList.copy" title="Permalink to this definition"></a></dt>
<dd><p>Make a (deep)copy of the CardList.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.pyfits.CardList.count_blanks">
<tt class="descname">count_blanks</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.pyfits.CardList.count_blanks" title="Permalink to this definition"></a></dt>
<dd><p>Find out how many blank cards are <em>directly</em> before the END card.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.pyfits.CardList.index_of">
<tt class="descname">index_of</tt><big>(</big><em>key</em>, <em>backward=0</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.CardList.index_of" title="Permalink to this definition"></a></dt>
<dd><p>Get the index of a keyword in the CardList.</p>
<p>key: the keyword name (a string) or the index (an integer).
backward: search the index from the END, i.e. backward? default=0.</p>
<blockquote>
<div>If backward = 1, search from the end.</div></blockquote>
</dd></dl>
<dl class="method">
<dt id="pNbody.pyfits.CardList.insert">
<tt class="descname">insert</tt><big>(</big><em>pos</em>, <em>card</em>, <em>useblanks=1</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.CardList.insert" title="Permalink to this definition"></a></dt>
<dd><p>Insert a Card to the CardList.</p>
<dl class="docutils">
<dt>pos: The position (index, keyword name will not be allowed) to</dt>
<dd>insert. The new card will be inserted before it.</dd>
</dl>
<p>card: The Card to be inserted.
useblanks: Use any <em>extra</em> blank cards? default=1.</p>
<blockquote>
<div>If useblanks != 0, and if there are blank cards directly
before END, it will use this space first, instead of
appending after these blank cards, so the total space
will not increase (default). When useblanks == 0, the
card will be appended at the end, even if there are
blank cards in front of END.</div></blockquote>
</dd></dl>
<dl class="method">
<dt id="pNbody.pyfits.CardList.keys">
<tt class="descname">keys</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.pyfits.CardList.keys" title="Permalink to this definition"></a></dt>
<dd><p>Return a list of all keywords from the CardList.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="pNbody.pyfits.ColDefs">
<em class="property">class </em><tt class="descclassname">pNbody.pyfits.</tt><tt class="descname">ColDefs</tt><big>(</big><em>input</em>, <em>tbtype='BinTableHDU'</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.ColDefs" title="Permalink to this definition"></a></dt>
<dd><p>Column definitions class. It has attributes corresponding to the
Column attributes (e.g. ColDefs has the attribute .names while Column
has .name), Each attribute in ColDefs is a list of corresponding
attribute values from all Columns.</p>
<p class="rubric">Methods</p>
<dl class="method">
<dt id="pNbody.pyfits.ColDefs.add_col">
<tt class="descname">add_col</tt><big>(</big><em>column</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.ColDefs.add_col" title="Permalink to this definition"></a></dt>
<dd><p>Append one Column to the column definition.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.pyfits.ColDefs.change_attrib">
<tt class="descname">change_attrib</tt><big>(</big><em>col_name</em>, <em>attrib</em>, <em>new_value</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.ColDefs.change_attrib" title="Permalink to this definition"></a></dt>
<dd><p>Change an attribute (in the commonName list) of a Column.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.pyfits.ColDefs.change_name">
<tt class="descname">change_name</tt><big>(</big><em>col_name</em>, <em>new_name</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.ColDefs.change_name" title="Permalink to this definition"></a></dt>
<dd><p>Change a Column&#8217;s name.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.pyfits.ColDefs.change_unit">
<tt class="descname">change_unit</tt><big>(</big><em>col_name</em>, <em>new_unit</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.ColDefs.change_unit" title="Permalink to this definition"></a></dt>
<dd><p>Change a Column&#8217;s unit.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.pyfits.ColDefs.del_col">
<tt class="descname">del_col</tt><big>(</big><em>col_name</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.ColDefs.del_col" title="Permalink to this definition"></a></dt>
<dd><p>Delete (the definition of) one Column.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.pyfits.ColDefs.info">
<tt class="descname">info</tt><big>(</big><em>attrib='all'</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.ColDefs.info" title="Permalink to this definition"></a></dt>
<dd><p>Get attribute(s) information of the column definition.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="pNbody.pyfits.Column">
<em class="property">class </em><tt class="descclassname">pNbody.pyfits.</tt><tt class="descname">Column</tt><big>(</big><em>name=None</em>, <em>format=None</em>, <em>unit=None</em>, <em>null=None</em>, <em>bscale=None</em>, <em>bzero=None</em>, <em>disp=None</em>, <em>start=None</em>, <em>dim=None</em>, <em>array=None</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.Column" title="Permalink to this definition"></a></dt>
<dd><p>Column class which contains the definition of one column, e.g.
ttype, tform, etc. and the array. Does not support theap yet.</p>
<p class="rubric">Methods</p>
</dd></dl>
<dl class="class">
<dt id="pNbody.pyfits.Delayed">
<em class="property">class </em><tt class="descclassname">pNbody.pyfits.</tt><tt class="descname">Delayed</tt><big>(</big><em>hdu=None</em>, <em>field=None</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.Delayed" title="Permalink to this definition"></a></dt>
<dd><p>Delayed file-reading data.</p>
</dd></dl>
<dl class="class">
<dt id="pNbody.pyfits.ErrorURLopener">
<em class="property">class </em><tt class="descclassname">pNbody.pyfits.</tt><tt class="descname">ErrorURLopener</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.ErrorURLopener" title="Permalink to this definition"></a></dt>
<dd><p>A class to use with urlretrieve to allow IOError exceptions to be
raised when a file specified by a URL cannot be accessed</p>
<p class="rubric">Methods</p>
</dd></dl>
<dl class="class">
<dt id="pNbody.pyfits.FITS_rec">
<em class="property">class </em><tt class="descclassname">pNbody.pyfits.</tt><tt class="descname">FITS_rec</tt><a class="headerlink" href="#pNbody.pyfits.FITS_rec" title="Permalink to this definition"></a></dt>
<dd><p>FITS record array class. FITS record array is the data part of a
table HDU&#8217;s data part. This is a layer over the recarray, so we
can deal with scaled columns.</p>
<p class="rubric">Methods</p>
<dl class="method">
<dt id="pNbody.pyfits.FITS_rec.field">
<tt class="descname">field</tt><big>(</big><em>key</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.FITS_rec.field" title="Permalink to this definition"></a></dt>
<dd><p>A view of a Column&#8217;s data as an array.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="pNbody.pyfits.FITS_record">
<em class="property">class </em><tt class="descclassname">pNbody.pyfits.</tt><tt class="descname">FITS_record</tt><big>(</big><em>input</em>, <em>row=0</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.FITS_record" title="Permalink to this definition"></a></dt>
<dd><p>FITS record class. FITS record class is used to access records of
the FITS_rec object. This will allow us to deal with scaled columns.
The FITS_record class expects a FITS_rec object as input</p>
<p class="rubric">Methods</p>
<dl class="method">
<dt id="pNbody.pyfits.FITS_record.field">
<tt class="descname">field</tt><big>(</big><em>fieldName</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.FITS_record.field" title="Permalink to this definition"></a></dt>
<dd><p>Get the field data of the record.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.pyfits.FITS_record.setfield">
<tt class="descname">setfield</tt><big>(</big><em>fieldName</em>, <em>value</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.FITS_record.setfield" title="Permalink to this definition"></a></dt>
<dd><p>Set the field data of the record.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="pNbody.pyfits.GroupData">
<em class="property">class </em><tt class="descclassname">pNbody.pyfits.</tt><tt class="descname">GroupData</tt><a class="headerlink" href="#pNbody.pyfits.GroupData" title="Permalink to this definition"></a></dt>
<dd><p>Random groups data object.</p>
<p>Allows structured access to FITS Group data in a manner analogous to tables</p>
<p class="rubric">Methods</p>
<dl class="method">
<dt id="pNbody.pyfits.GroupData.par">
<tt class="descname">par</tt><big>(</big><em>parName</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.GroupData.par" title="Permalink to this definition"></a></dt>
<dd><p>Get the group parameter values.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.pyfits.GroupData.setpar">
<tt class="descname">setpar</tt><big>(</big><em>parName</em>, <em>value</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.GroupData.setpar" title="Permalink to this definition"></a></dt>
<dd><p>Set the group parameter values.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="pNbody.pyfits.GroupsHDU">
<em class="property">class </em><tt class="descclassname">pNbody.pyfits.</tt><tt class="descname">GroupsHDU</tt><big>(</big><em>data=None</em>, <em>header=None</em>, <em>name=None</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.GroupsHDU" title="Permalink to this definition"></a></dt>
<dd><p>FITS Random Groups HDU class.</p>
<p class="rubric">Methods</p>
<dl class="method">
<dt id="pNbody.pyfits.GroupsHDU.size">
<tt class="descname">size</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.pyfits.GroupsHDU.size" title="Permalink to this definition"></a></dt>
<dd><p>Returns the size (in bytes) of the HDU&#8217;s data part.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="pNbody.pyfits.HDUList">
<em class="property">class </em><tt class="descclassname">pNbody.pyfits.</tt><tt class="descname">HDUList</tt><big>(</big><em>hdus=</em><span class="optional">[</span><span class="optional">]</span>, <em>file=None</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.HDUList" title="Permalink to this definition"></a></dt>
<dd><p>HDU list class. This is the top-level FITS object. When a FITS
file is opened, a HDUList object is returned.</p>
<p class="rubric">Methods</p>
<dl class="method">
<dt id="pNbody.pyfits.HDUList.append">
<tt class="descname">append</tt><big>(</big><em>hdu</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.HDUList.append" title="Permalink to this definition"></a></dt>
<dd><p>Append a new HDU to the HDUList.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.pyfits.HDUList.close">
<tt class="descname">close</tt><big>(</big><em>output_verify='exception'</em>, <em>verbose=0</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.HDUList.close" title="Permalink to this definition"></a></dt>
<dd><p>Close the associated FITS file and memmap object, if any.</p>
<p>output_verify: output verification option, default = &#8216;exception&#8217;.
verbose: print out verbose messages? default = 0.</p>
<p>This simply calls the close method of the _File class. It has this
two-tier calls because _File has ts own private attribute __file.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.pyfits.HDUList.flush">
<tt class="descname">flush</tt><big>(</big><em>output_verify='exception'</em>, <em>verbose=0</em>, <em>classExtensions={}</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.HDUList.flush" title="Permalink to this definition"></a></dt>
<dd><p>Force a write of the HDUList back to the file (for append and
update modes only).</p>
<p>output_verify: output verification option, default = &#8216;exception&#8217;.
verbose: print out verbose messages? default = 0.
classExtensions: A dictionary that maps pyfits classes to extensions</p>
<blockquote>
<div>of those classes. When present in the dictionary,
the extension class will be constructed in place of
the pyfits class.</div></blockquote>
</dd></dl>
<dl class="method">
<dt id="pNbody.pyfits.HDUList.index_of">
<tt class="descname">index_of</tt><big>(</big><em>key</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.HDUList.index_of" title="Permalink to this definition"></a></dt>
<dd><p>Get the index of an HDU from the HDUList. The key can be an
integer, a string, or a tuple of (string, integer).</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.pyfits.HDUList.info">
<tt class="descname">info</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.pyfits.HDUList.info" title="Permalink to this definition"></a></dt>
<dd><p>Summarize the info of the HDU&#8217;s in this HDUList.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.pyfits.HDUList.readall">
<tt class="descname">readall</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.pyfits.HDUList.readall" title="Permalink to this definition"></a></dt>
<dd><p>Read data of all HDU&#8217;s into memory.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.pyfits.HDUList.update_extend">
<tt class="descname">update_extend</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.pyfits.HDUList.update_extend" title="Permalink to this definition"></a></dt>
<dd><p>Make sure if the primary header needs the keyword EXTEND or if
it has the proper value.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.pyfits.HDUList.update_tbhdu">
<tt class="descname">update_tbhdu</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.pyfits.HDUList.update_tbhdu" title="Permalink to this definition"></a></dt>
<dd><p>Update all table HDU&#8217;s for scaled fields.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.pyfits.HDUList.writeto">
<tt class="descname">writeto</tt><big>(</big><em>name</em>, <em>output_verify='exception'</em>, <em>clobber=False</em>, <em>classExtensions={}</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.HDUList.writeto" title="Permalink to this definition"></a></dt>
<dd><p>Write the HDUList to a new file.</p>
<p>name: output FITS file name to be written to.
output_verify: output verification option, default = &#8216;exception&#8217;.
clobber: Overwrite the output file if exists, default = False.
classExtensions: A dictionary that maps pyfits classes to extensions</p>
<blockquote>
<div>of those classes. When present in the dictionary,
the extension class will be constructed in place of
the pyfits class.</div></blockquote>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="pNbody.pyfits.Header">
<em class="property">class </em><tt class="descclassname">pNbody.pyfits.</tt><tt class="descname">Header</tt><big>(</big><em>cards=</em><span class="optional">[</span><span class="optional">]</span><big>)</big><a class="headerlink" href="#pNbody.pyfits.Header" title="Permalink to this definition"></a></dt>
<dd><p>FITS header class.</p>
<p class="rubric">Methods</p>
<dl class="method">
<dt id="pNbody.pyfits.Header.add_blank">
<tt class="descname">add_blank</tt><big>(</big><em>value=''</em>, <em>before=None</em>, <em>after=None</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.Header.add_blank" title="Permalink to this definition"></a></dt>
<dd><p>Add a blank card.</p>
<p>value: Text to be added.
before: [same as in update()]
after: [same as in update()]</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.pyfits.Header.add_comment">
<tt class="descname">add_comment</tt><big>(</big><em>value</em>, <em>before=None</em>, <em>after=None</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.Header.add_comment" title="Permalink to this definition"></a></dt>
<dd><p>Add a COMMENT card.</p>
<p>value: Comment text to be added.
before: [same as in update()]
after: [same as in update()]</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.pyfits.Header.add_history">
<tt class="descname">add_history</tt><big>(</big><em>value</em>, <em>before=None</em>, <em>after=None</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.Header.add_history" title="Permalink to this definition"></a></dt>
<dd><p>Add a HISTORY card.</p>
<p>value: History text to be added.
before: [same as in update()]
after: [same as in update()]</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.pyfits.Header.ascardlist">
<tt class="descname">ascardlist</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.pyfits.Header.ascardlist" title="Permalink to this definition"></a></dt>
<dd><p>Returns a CardList.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.pyfits.Header.copy">
<tt class="descname">copy</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.pyfits.Header.copy" title="Permalink to this definition"></a></dt>
<dd><p>Make a copy of the Header.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.pyfits.Header.get">
<tt class="descname">get</tt><big>(</big><em>key</em>, <em>default=None</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.Header.get" title="Permalink to this definition"></a></dt>
<dd><p>Get a keyword value from the CardList.
If no keyword is found, return the default value.</p>
<p>key: keyword name or index
default: if no keyword is found, the value to be returned.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.pyfits.Header.get_comment">
<tt class="descname">get_comment</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.pyfits.Header.get_comment" title="Permalink to this definition"></a></dt>
<dd><p>Get all comments as a list of string texts.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.pyfits.Header.get_history">
<tt class="descname">get_history</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.pyfits.Header.get_history" title="Permalink to this definition"></a></dt>
<dd><p>Get all histories as a list of string texts.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.pyfits.Header.has_key">
<tt class="descname">has_key</tt><big>(</big><em>key</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.Header.has_key" title="Permalink to this definition"></a></dt>
<dd><p>Check for existence of a keyword. Returns 1 if found, otherwise, 0.</p>
<p>key: keyword name. If given an index, always returns 0.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.pyfits.Header.items">
<tt class="descname">items</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.pyfits.Header.items" title="Permalink to this definition"></a></dt>
<dd><p>Return a list of all keyword-value pairs from the CardList.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.pyfits.Header.rename_key">
<tt class="descname">rename_key</tt><big>(</big><em>oldkey</em>, <em>newkey</em>, <em>force=0</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.Header.rename_key" title="Permalink to this definition"></a></dt>
<dd><p>Rename a card&#8217;s keyword in the header.</p>
<p>oldkey: old keyword, can be a name or index.
newkey: new keyword, must be a string.
force: if new key name already exist, force to have duplicate name.</p>
</dd></dl>
<dl class="method">
<dt id="pNbody.pyfits.Header.update">
<tt class="descname">update</tt><big>(</big><em>key</em>, <em>value</em>, <em>comment=None</em>, <em>before=None</em>, <em>after=None</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.Header.update" title="Permalink to this definition"></a></dt>
<dd><p>Update one header card.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="pNbody.pyfits.ImageHDU">
<em class="property">class </em><tt class="descclassname">pNbody.pyfits.</tt><tt class="descname">ImageHDU</tt><big>(</big><em>data=None</em>, <em>header=None</em>, <em>name=None</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.ImageHDU" title="Permalink to this definition"></a></dt>
<dd><p>FITS image extension HDU class.</p>
<p class="rubric">Methods</p>
</dd></dl>
<dl class="class">
<dt id="pNbody.pyfits.PrimaryHDU">
<em class="property">class </em><tt class="descclassname">pNbody.pyfits.</tt><tt class="descname">PrimaryHDU</tt><big>(</big><em>data=None</em>, <em>header=None</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.PrimaryHDU" title="Permalink to this definition"></a></dt>
<dd><p>FITS primary HDU class.</p>
<p class="rubric">Methods</p>
</dd></dl>
<dl class="class">
<dt id="pNbody.pyfits.Section">
<em class="property">class </em><tt class="descclassname">pNbody.pyfits.</tt><tt class="descname">Section</tt><big>(</big><em>hdu</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.Section" title="Permalink to this definition"></a></dt>
<dd><p>Image section.</p>
</dd></dl>
<dl class="class">
<dt id="pNbody.pyfits.StreamingHDU">
<em class="property">class </em><tt class="descclassname">pNbody.pyfits.</tt><tt class="descname">StreamingHDU</tt><big>(</big><em>name</em>, <em>header</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.StreamingHDU" title="Permalink to this definition"></a></dt>
<dd><p>A class that provides the capability to stream data to a FITS file
instead of requiring data to all be written at once.</p>
<p>The following psudo code illustrates its use:</p>
<p>header = pyfits.Header()</p>
<dl class="docutils">
<dt>for all the cards you need in the header:</dt>
<dd>header.update(key,value,comment)</dd>
</dl>
<p>shdu = pyfits.StreamingHDU(&#8216;filename.fits&#8217;,header)</p>
<dl class="docutils">
<dt>for each piece of data:</dt>
<dd>shdu.write(data)</dd>
</dl>
<p>shdu.close()</p>
<p class="rubric">Methods</p>
<dl class="method">
<dt id="pNbody.pyfits.StreamingHDU.close">
<tt class="descname">close</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.pyfits.StreamingHDU.close" title="Permalink to this definition"></a></dt>
<dd><p>Close the &#8216;physical&#8217; FITS file.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters :</th><td class="field-body">None</td>
</tr>
<tr class="field"><th class="field-name">Returns :</th><td class="field-body">None</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="pNbody.pyfits.StreamingHDU.size">
<tt class="descname">size</tt><big>(</big><big>)</big><a class="headerlink" href="#pNbody.pyfits.StreamingHDU.size" title="Permalink to this definition"></a></dt>
<dd><p>Return the size (in bytes) of the data portion of the HDU.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters :</th><td class="field-body"><p class="first">None</p>
</td>
</tr>
<tr class="field"><th class="field-name">Returns :</th><td class="field-body"><dl class="first last docutils">
<dt>size <span class="classifier-delimiter">:</span> <span class="classifier">integer</span></dt>
<dd><p class="first last">The number of bytes of data required to fill the stream
per the header provided in the constructor.</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="pNbody.pyfits.StreamingHDU.write">
<tt class="descname">write</tt><big>(</big><em>data</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.StreamingHDU.write" title="Permalink to this definition"></a></dt>
<dd><p>Write the given data to the stream.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters :</th><td class="field-body"><dl class="first docutils">
<dt>data <span class="classifier-delimiter">:</span> <span class="classifier">ndarray</span></dt>
<dd><p class="first last">Data to stream to the file.</p>
</dd>
</dl>
</td>
</tr>
<tr class="field"><th class="field-name">Returns :</th><td class="field-body"><dl class="first last docutils">
<dt>writeComplete <span class="classifier-delimiter">:</span> <span class="classifier">integer </span></dt>
<dd><p class="first last">Flag that when true indicates that all of the required data
has been written to the stream.</p>
</dd>
</dl>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>Only the amount of data specified in the header provided to the
class constructor may be written to the stream. If the provided
data would cause the stream to overflow, an IOError exception is
raised and the data is not written. Once sufficient data has been
written to the stream to satisfy the amount specified in the header,
the stream is padded to fill a complete FITS block and no more data
will be accepted. An attempt to write more data after the stream
has been filled will raise an IOError exception. If the dtype of
the input data does not match what is expected by the header, a
TypeError exception is raised.</p>
</dd></dl>
</dd></dl>
<dl class="class">
<dt id="pNbody.pyfits.TableHDU">
<em class="property">class </em><tt class="descclassname">pNbody.pyfits.</tt><tt class="descname">TableHDU</tt><big>(</big><em>data=None</em>, <em>header=None</em>, <em>name=None</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.TableHDU" title="Permalink to this definition"></a></dt>
<dd><p>FITS ASCII table extension HDU class.</p>
<p class="rubric">Methods</p>
</dd></dl>
<dl class="class">
<dt id="pNbody.pyfits.Undefined">
<em class="property">class </em><tt class="descclassname">pNbody.pyfits.</tt><tt class="descname">Undefined</tt><a class="headerlink" href="#pNbody.pyfits.Undefined" title="Permalink to this definition"></a></dt>
<dd><p>Undefined value.</p>
</dd></dl>
<dl class="exception">
<dt id="pNbody.pyfits.VerifyError">
<em class="property">exception </em><tt class="descclassname">pNbody.pyfits.</tt><tt class="descname">VerifyError</tt><a class="headerlink" href="#pNbody.pyfits.VerifyError" title="Permalink to this definition"></a></dt>
<dd><p>Verify exception class.</p>
</dd></dl>
<dl class="function">
<dt id="pNbody.pyfits.append">
<tt class="descclassname">pNbody.pyfits.</tt><tt class="descname">append</tt><big>(</big><em>filename</em>, <em>data</em>, <em>header=None</em>, <em>classExtensions={}</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.append" title="Permalink to this definition"></a></dt>
<dd><p>Append the header/data to FITS file if filename exists, create if not.</p>
<p>If only data is supplied, a minimal header is created</p>
<blockquote>
<div><p>&#64;type filename: string
&#64;param filename: name of the file to append to
&#64;type data: array, table, or group data object
&#64;param data: the new data used for appending
&#64;type header: L{Header} object or None
&#64;param header: the header associated with &#8216;data&#8217;, if None,</p>
<blockquote>
<div>an appropriate header will be created for the data object
supplied.</div></blockquote>
<p>&#64;type classExtensions: dictionary
&#64;param classExtensions: A dictionary that maps pyfits classes to</p>
<blockquote>
<div>extensions of those classes. When present in
the dictionary, the extension class will be
constructed in place of the pyfits class.</div></blockquote>
</div></blockquote>
</dd></dl>
<dl class="function">
<dt id="pNbody.pyfits.fitsopen">
<tt class="descclassname">pNbody.pyfits.</tt><tt class="descname">fitsopen</tt><big>(</big><em>name</em>, <em>mode='copyonwrite'</em>, <em>memmap=0</em>, <em>classExtensions={}</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.fitsopen" title="Permalink to this definition"></a></dt>
<dd><p>Factory function to open a FITS file and return an HDUList object.</p>
<p>name: Name of the FITS file to be opened or already opened file object.
mode: Open mode, &#8216;readonly&#8217; (default), &#8216;update&#8217;, or &#8216;append&#8217;.
memmap: Is memmory mapping to be used? default=0.
classExtensions: A dictionary that maps pyfits classes to extensions of</p>
<blockquote>
<div>those classes. When present in the dictionary, the
extension class will be constructed in place of the
pyfits class.</div></blockquote>
</dd></dl>
<dl class="function">
<dt id="pNbody.pyfits.getdata">
<tt class="descclassname">pNbody.pyfits.</tt><tt class="descname">getdata</tt><big>(</big><em>filename</em>, <em>*ext</em>, <em>**extkeys</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.getdata" title="Permalink to this definition"></a></dt>
<dd><p>Get the data from an extension of a FITS file (and optionally the header).</p>
<p>&#64;type filename: string
&#64;param filename: input FITS file name</p>
<dl class="docutils">
<dt>&#64;keyword classExtensions: (optional) A dictionary that maps pyfits </dt>
<dd>classes to extensions of those classes. When present in the
dictionary, the extension class will be constructed in place
of the pyfits class.</dd>
</dl>
<p>&#64;param ext: The rest of the arguments are for extension specification. They are
flexible and are best illustrated by examples:</p>
<p>No extra arguments implies the primary header</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">getdata</span><span class="p">(</span><span class="s">&#39;in.fits&#39;</span><span class="p">)</span>
</pre></div>
</div>
<p>By extension number:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">getdata</span><span class="p">(</span><span class="s">&#39;in.fits&#39;</span><span class="p">,</span> <span class="mi">0</span><span class="p">)</span> <span class="c"># the primary header </span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">getdata</span><span class="p">(</span><span class="s">&#39;in.fits&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span> <span class="c"># the second extension</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">getdata</span><span class="p">(</span><span class="s">&#39;in.fits&#39;</span><span class="p">,</span> <span class="n">ext</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span> <span class="c"># the second extension</span>
</pre></div>
</div>
<p>By name, i.e., EXTNAME value (if unique):</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">getdata</span><span class="p">(</span><span class="s">&#39;in.fits&#39;</span><span class="p">,</span> <span class="s">&#39;sci&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">getdata</span><span class="p">(</span><span class="s">&#39;in.fits&#39;</span><span class="p">,</span> <span class="n">extname</span><span class="o">=</span><span class="s">&#39;sci&#39;</span><span class="p">)</span> <span class="c"># equivalent</span>
</pre></div>
</div>
<p>Note EXTNAMEs are not case sensitive</p>
<p>By combination of EXTNAME and EXTVER, as separate arguments or as a tuple:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">getdata</span><span class="p">(</span><span class="s">&#39;in.fits&#39;</span><span class="p">,</span> <span class="s">&#39;sci&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span> <span class="c"># EXTNAME=&#39;SCI&#39; &amp; EXTVER=2</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">getdata</span><span class="p">(</span><span class="s">&#39;in.fits&#39;</span><span class="p">,</span> <span class="n">extname</span><span class="o">=</span><span class="s">&#39;sci&#39;</span><span class="p">,</span> <span class="n">extver</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span> <span class="c"># equivalent</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">getdata</span><span class="p">(</span><span class="s">&#39;in.fits&#39;</span><span class="p">,</span> <span class="p">(</span><span class="s">&#39;sci&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">))</span> <span class="c"># equivalent</span>
</pre></div>
</div>
<p>Ambiguous or conflicting specifications will raise an exception, e.g.,</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">getdata</span><span class="p">(</span><span class="s">&#39;in.fits&#39;</span><span class="p">,</span> <span class="n">ext</span><span class="o">=</span><span class="p">(</span><span class="s">&#39;sci&#39;</span><span class="p">,</span><span class="mi">1</span><span class="p">),</span> <span class="n">extname</span><span class="o">=</span><span class="s">&#39;err&#39;</span><span class="p">,</span> <span class="n">extver</span><span class="o">=</span><span class="mi">2</span><span class="p">)</span>
</pre></div>
</div>
<p>&#64;return: an array, record array (i.e. table), or groups data object
depending on the type of the extension being referenced
If the optional keyword &#8216;header&#8217; is set to True, this function will
return a (data, header) tuple.</p>
</dd></dl>
<dl class="function">
<dt id="pNbody.pyfits.getheader">
<tt class="descclassname">pNbody.pyfits.</tt><tt class="descname">getheader</tt><big>(</big><em>filename</em>, <em>*ext</em>, <em>**extkeys</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.getheader" title="Permalink to this definition"></a></dt>
<dd><p>Get the header from an extension of a FITS file.</p>
<p>&#64;param filename: input FITS file name
&#64;type: string
&#64;keyword classExtensions: (optional) A dictionary that maps pyfits</p>
<blockquote>
<div>classes to extensions of those classes. When present in the
dictionary, the extension class will be constructed in place
of the pyfits class.</div></blockquote>
<dl class="docutils">
<dt>&#64;param ext: The rest of the arguments are for extension specification.</dt>
<dd>See L{getdata} for explanations/examples.</dd>
</dl>
<p>&#64;rtype: L{Header} object
&#64;return: header</p>
</dd></dl>
<dl class="function">
<dt id="pNbody.pyfits.getval">
<tt class="descclassname">pNbody.pyfits.</tt><tt class="descname">getval</tt><big>(</big><em>filename</em>, <em>key</em>, <em>*ext</em>, <em>**extkeys</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.getval" title="Permalink to this definition"></a></dt>
<dd><p>Get a keyword&#8217;s value from a header in a FITS file.</p>
<p>&#64;type filename: string
&#64;param filename: input FITS file name
&#64;type key: string
&#64;param key: keyword name
&#64;keyword classExtensions: (optional) A dictionary that maps pyfits</p>
<blockquote>
<div>classes to extensions of those classes. When present in the
dictionary, the extension class will be constructed in place
of the pyfits class.</div></blockquote>
<dl class="docutils">
<dt>&#64;param ext: The rest of the arguments are for extension specification.</dt>
<dd>See L{getdata} for explanations/examples.</dd>
</dl>
<p>&#64;return: keyword value
&#64;rtype: string, integer, or float</p>
</dd></dl>
<dl class="function">
<dt id="pNbody.pyfits.info">
<tt class="descclassname">pNbody.pyfits.</tt><tt class="descname">info</tt><big>(</big><em>filename</em>, <em>classExtensions={}</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.info" title="Permalink to this definition"></a></dt>
<dd><p>Print the summary information on a FITS file.</p>
<p>This includes the name, type, length of header, data shape and type
for each extension.</p>
<p>&#64;type filename: string
&#64;param filename: input FITS file name
&#64;type classExtensions: dictionary
&#64;param classExtensions: A dictionary that maps pyfits classes to</p>
<blockquote>
<div>extensions of those classes. When present in
the dictionary, the extension class will be
constructed in place of the pyfits class.</div></blockquote>
</dd></dl>
<dl class="function">
<dt id="pNbody.pyfits.new_table">
<tt class="descclassname">pNbody.pyfits.</tt><tt class="descname">new_table</tt><big>(</big><em>input</em>, <em>header=None</em>, <em>nrows=0</em>, <em>fill=0</em>, <em>tbtype='BinTableHDU'</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.new_table" title="Permalink to this definition"></a></dt>
<dd><p>Create a new table from the input column definitions.</p>
</dd></dl>
<dl class="function">
<dt id="pNbody.pyfits.open">
<tt class="descclassname">pNbody.pyfits.</tt><tt class="descname">open</tt><big>(</big><em>name</em>, <em>mode='copyonwrite'</em>, <em>memmap=0</em>, <em>classExtensions={}</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.open" title="Permalink to this definition"></a></dt>
<dd><p>Factory function to open a FITS file and return an HDUList object.</p>
<p>name: Name of the FITS file to be opened or already opened file object.
mode: Open mode, &#8216;readonly&#8217; (default), &#8216;update&#8217;, or &#8216;append&#8217;.
memmap: Is memmory mapping to be used? default=0.
classExtensions: A dictionary that maps pyfits classes to extensions of</p>
<blockquote>
<div>those classes. When present in the dictionary, the
extension class will be constructed in place of the
pyfits class.</div></blockquote>
</dd></dl>
<dl class="function">
<dt id="pNbody.pyfits.update">
<tt class="descclassname">pNbody.pyfits.</tt><tt class="descname">update</tt><big>(</big><em>filename</em>, <em>data</em>, <em>*ext</em>, <em>**extkeys</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.update" title="Permalink to this definition"></a></dt>
<dd><p>Update the specified extension with the input data/header.</p>
<p>&#64;type filename: string
&#64;param filename: name of the file to be updated
data: the new data used for updating
&#64;keyword classExtensions: (optional) A dictionary that maps pyfits</p>
<blockquote>
<div>classes to extensions of those classes. When present in the
dictionary, the extension class will be constructed in place
of the pyfits class.</div></blockquote>
<p>The rest of the arguments are flexible:
the 3rd argument can be the header associated with the data.
If the 3rd argument is not a header, it (and other positional
arguments) are assumed to be the extension specification(s).
Header and extension specs can also be keyword arguments.
For example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">update</span><span class="p">(</span><span class="nb">file</span><span class="p">,</span> <span class="n">dat</span><span class="p">,</span> <span class="n">hdr</span><span class="p">,</span> <span class="s">&#39;sci&#39;</span><span class="p">)</span> <span class="c"># update the &#39;sci&#39; extension</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">update</span><span class="p">(</span><span class="nb">file</span><span class="p">,</span> <span class="n">dat</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span> <span class="c"># update the 3rd extension</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">update</span><span class="p">(</span><span class="nb">file</span><span class="p">,</span> <span class="n">dat</span><span class="p">,</span> <span class="n">hdr</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span> <span class="c"># update the 3rd extension</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">update</span><span class="p">(</span><span class="nb">file</span><span class="p">,</span> <span class="n">dat</span><span class="p">,</span> <span class="s">&#39;sci&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span> <span class="c"># update the 2nd SCI extension</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">update</span><span class="p">(</span><span class="nb">file</span><span class="p">,</span> <span class="n">dat</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="n">header</span><span class="o">=</span><span class="n">hdr</span><span class="p">)</span> <span class="c"># update the 3rd extension</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">update</span><span class="p">(</span><span class="nb">file</span><span class="p">,</span> <span class="n">dat</span><span class="p">,</span> <span class="n">header</span><span class="o">=</span><span class="n">hdr</span><span class="p">,</span> <span class="n">ext</span><span class="o">=</span><span class="mi">5</span><span class="p">)</span> <span class="c"># update the 5th extension</span>
</pre></div>
</div>
</dd></dl>
<dl class="function">
<dt id="pNbody.pyfits.writeto">
<tt class="descclassname">pNbody.pyfits.</tt><tt class="descname">writeto</tt><big>(</big><em>filename</em>, <em>data</em>, <em>header=None</em>, <em>**keys</em><big>)</big><a class="headerlink" href="#pNbody.pyfits.writeto" title="Permalink to this definition"></a></dt>
<dd><p>Create a new FITS file using the supplied data/header.</p>
<p>&#64;type filename: string
&#64;param filename: name of the new FITS file to write to
&#64;type data: array, record array, or groups data object
&#64;param data: data to write to the new file
&#64;type header: L{Header} object or None
&#64;param header: the header associated with &#8216;data&#8217;, if None, a</p>
<blockquote>
<div>header of the appropriate type is created for the supplied
data. This argument is optional.</div></blockquote>
<dl class="docutils">
<dt>&#64;keyword classExtensions: (optional) A dictionary that maps pyfits </dt>
<dd>classes to extensions of those classes. When present in the
dictionary, the extension class will be constructed in place
of the pyfits class.</dd>
<dt>&#64;keyword clobber: (optional) if True and if filename already exists, it</dt>
<dd>will overwrite the file. Default is False.</dd>
</dl>
</dd></dl>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="../index.html">
<img class="logo" src="../_static/icon-small.jpg" alt="Logo"/>
</a></p>
<h4>Previous topic</h4>
<p class="topless"><a href="TalkgdispModule.html"
title="previous chapter">the talkgdisp module</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="RecModule.html"
title="next chapter">the rec module</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/rst/PyfitsModule.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" size="18" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="../py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="../np-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="RecModule.html" title="the rec module"
>next</a> |</li>
<li class="right" >
<a href="TalkgdispModule.html" title="the talkgdisp module"
>previous</a> |</li>
<li><a href="../index.html">pNbody v4 documentation</a> &raquo;</li>
<li><a href="Reference.html" >Reference</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2011, Yves Revaz.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
</div>
</body>
</html>

Event Timeline