<emclass="property">class </em><ttclass="descclassname">pNbody.pyfits.</tt><ttclass="descname">BinTableHDU</tt><big>(</big><em>data=None</em>, <em>header=None</em>, <em>name=None</em><big>)</big><aclass="headerlink"href="#pNbody.pyfits.BinTableHDU"title="Permalink to this definition">¶</a></dt>
<dd><p>Binary table HDU class.</p>
<pclass="rubric">Methods</p>
</dd></dl>
<dlclass="class">
<dtid="pNbody.pyfits.CardList">
<emclass="property">class </em><ttclass="descclassname">pNbody.pyfits.</tt><ttclass="descname">CardList</tt><big>(</big><em>cards=</em><spanclass="optional">[</span><spanclass="optional">]</span>, <em>keylist=None</em><big>)</big><aclass="headerlink"href="#pNbody.pyfits.CardList"title="Permalink to this definition">¶</a></dt>
<dd><p>FITS header card list class.</p>
<pclass="rubric">Methods</p>
<dlclass="method">
<dtid="pNbody.pyfits.CardList.append">
<ttclass="descname">append</tt><big>(</big><em>card</em>, <em>useblanks=1</em>, <em>bottom=0</em><big>)</big><aclass="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>
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.</blockquote>
<dlclass="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>
<dlclass="method">
<dtid="pNbody.pyfits.CardList.copy">
<ttclass="descname">copy</tt><big>(</big><big>)</big><aclass="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>
<dlclass="method">
<dtid="pNbody.pyfits.CardList.count_blanks">
<ttclass="descname">count_blanks</tt><big>(</big><big>)</big><aclass="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>
<dlclass="method">
<dtid="pNbody.pyfits.CardList.index_of">
<ttclass="descname">index_of</tt><big>(</big><em>key</em>, <em>backward=0</em><big>)</big><aclass="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>
If backward = 1, search from the end.</blockquote>
</dd></dl>
<dlclass="method">
<dtid="pNbody.pyfits.CardList.insert">
<ttclass="descname">insert</tt><big>(</big><em>pos</em>, <em>card</em>, <em>useblanks=1</em><big>)</big><aclass="headerlink"href="#pNbody.pyfits.CardList.insert"title="Permalink to this definition">¶</a></dt>
<dd><p>Insert a Card to the CardList.</p>
<dlclass="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>
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.</blockquote>
</dd></dl>
<dlclass="method">
<dtid="pNbody.pyfits.CardList.keys">
<ttclass="descname">keys</tt><big>(</big><big>)</big><aclass="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>
<dlclass="class">
<dtid="pNbody.pyfits.ColDefs">
<emclass="property">class </em><ttclass="descclassname">pNbody.pyfits.</tt><ttclass="descname">ColDefs</tt><big>(</big><em>input</em>, <em>tbtype='BinTableHDU'</em><big>)</big><aclass="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>
<pclass="rubric">Methods</p>
<dlclass="method">
<dtid="pNbody.pyfits.ColDefs.add_col">
<ttclass="descname">add_col</tt><big>(</big><em>column</em><big>)</big><aclass="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>
<dlclass="method">
<dtid="pNbody.pyfits.ColDefs.change_attrib">
<ttclass="descname">change_attrib</tt><big>(</big><em>col_name</em>, <em>attrib</em>, <em>new_value</em><big>)</big><aclass="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>
<dlclass="method">
<dtid="pNbody.pyfits.ColDefs.change_name">
<ttclass="descname">change_name</tt><big>(</big><em>col_name</em>, <em>new_name</em><big>)</big><aclass="headerlink"href="#pNbody.pyfits.ColDefs.change_name"title="Permalink to this definition">¶</a></dt>
<dd><p>Change a Column’s name.</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.pyfits.ColDefs.change_unit">
<ttclass="descname">change_unit</tt><big>(</big><em>col_name</em>, <em>new_unit</em><big>)</big><aclass="headerlink"href="#pNbody.pyfits.ColDefs.change_unit"title="Permalink to this definition">¶</a></dt>
<dd><p>Change a Column’s unit.</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.pyfits.ColDefs.del_col">
<ttclass="descname">del_col</tt><big>(</big><em>col_name</em><big>)</big><aclass="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>
<dlclass="method">
<dtid="pNbody.pyfits.ColDefs.info">
<ttclass="descname">info</tt><big>(</big><em>attrib='all'</em><big>)</big><aclass="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>
<dlclass="class">
<dtid="pNbody.pyfits.Column">
<emclass="property">class </em><ttclass="descclassname">pNbody.pyfits.</tt><ttclass="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><aclass="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>
<pclass="rubric">Methods</p>
</dd></dl>
<dlclass="class">
<dtid="pNbody.pyfits.Delayed">
<emclass="property">class </em><ttclass="descclassname">pNbody.pyfits.</tt><ttclass="descname">Delayed</tt><big>(</big><em>hdu=None</em>, <em>field=None</em><big>)</big><aclass="headerlink"href="#pNbody.pyfits.Delayed"title="Permalink to this definition">¶</a></dt>
<dd><p>Delayed file-reading data.</p>
</dd></dl>
<dlclass="class">
<dtid="pNbody.pyfits.ErrorURLopener">
<emclass="property">class </em><ttclass="descclassname">pNbody.pyfits.</tt><ttclass="descname">ErrorURLopener</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><aclass="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>
<pclass="rubric">Methods</p>
</dd></dl>
<dlclass="class">
<dtid="pNbody.pyfits.FITS_rec">
<emclass="property">class </em><ttclass="descclassname">pNbody.pyfits.</tt><ttclass="descname">FITS_rec</tt><aclass="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’s data part. This is a layer over the recarray, so we
can deal with scaled columns.</p>
<pclass="rubric">Methods</p>
<dlclass="method">
<dtid="pNbody.pyfits.FITS_rec.field">
<ttclass="descname">field</tt><big>(</big><em>key</em><big>)</big><aclass="headerlink"href="#pNbody.pyfits.FITS_rec.field"title="Permalink to this definition">¶</a></dt>
<dd><p>A view of a Column’s data as an array.</p>
</dd></dl>
</dd></dl>
<dlclass="class">
<dtid="pNbody.pyfits.FITS_record">
<emclass="property">class </em><ttclass="descclassname">pNbody.pyfits.</tt><ttclass="descname">FITS_record</tt><big>(</big><em>input</em>, <em>row=0</em><big>)</big><aclass="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>
<pclass="rubric">Methods</p>
<dlclass="method">
<dtid="pNbody.pyfits.FITS_record.field">
<ttclass="descname">field</tt><big>(</big><em>fieldName</em><big>)</big><aclass="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>
<dlclass="method">
<dtid="pNbody.pyfits.FITS_record.setfield">
<ttclass="descname">setfield</tt><big>(</big><em>fieldName</em>, <em>value</em><big>)</big><aclass="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>
<dlclass="class">
<dtid="pNbody.pyfits.GroupData">
<emclass="property">class </em><ttclass="descclassname">pNbody.pyfits.</tt><ttclass="descname">GroupData</tt><aclass="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>
<pclass="rubric">Methods</p>
<dlclass="method">
<dtid="pNbody.pyfits.GroupData.par">
<ttclass="descname">par</tt><big>(</big><em>parName</em><big>)</big><aclass="headerlink"href="#pNbody.pyfits.GroupData.par"title="Permalink to this definition">¶</a></dt>
<dd><p>Get the group parameter values.</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.pyfits.GroupData.setpar">
<ttclass="descname">setpar</tt><big>(</big><em>parName</em>, <em>value</em><big>)</big><aclass="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>
<dlclass="class">
<dtid="pNbody.pyfits.GroupsHDU">
<emclass="property">class </em><ttclass="descclassname">pNbody.pyfits.</tt><ttclass="descname">GroupsHDU</tt><big>(</big><em>data=None</em>, <em>header=None</em>, <em>name=None</em><big>)</big><aclass="headerlink"href="#pNbody.pyfits.GroupsHDU"title="Permalink to this definition">¶</a></dt>
<dd><p>FITS Random Groups HDU class.</p>
<pclass="rubric">Methods</p>
<dlclass="method">
<dtid="pNbody.pyfits.GroupsHDU.size">
<ttclass="descname">size</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.pyfits.GroupsHDU.size"title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the size (in bytes) of the HDU’s data part.</p>
</dd></dl>
</dd></dl>
<dlclass="class">
<dtid="pNbody.pyfits.HDUList">
<emclass="property">class </em><ttclass="descclassname">pNbody.pyfits.</tt><ttclass="descname">HDUList</tt><big>(</big><em>hdus=</em><spanclass="optional">[</span><spanclass="optional">]</span>, <em>file=None</em><big>)</big><aclass="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>
<pclass="rubric">Methods</p>
<dlclass="method">
<dtid="pNbody.pyfits.HDUList.append">
<ttclass="descname">append</tt><big>(</big><em>hdu</em><big>)</big><aclass="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>
<dlclass="method">
<dtid="pNbody.pyfits.HDUList.close">
<ttclass="descname">close</tt><big>(</big><em>output_verify='exception'</em>, <em>verbose=0</em><big>)</big><aclass="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>
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>
<dlclass="method">
<dtid="pNbody.pyfits.HDUList.flush">
<ttclass="descname">flush</tt><big>(</big><em>output_verify='exception'</em>, <em>verbose=0</em>, <em>classExtensions={}</em><big>)</big><aclass="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
classExtensions: A dictionary that maps pyfits classes to extensions</p>
<blockquote>
of those classes. When present in the dictionary,
the extension class will be constructed in place of
the pyfits class.</blockquote>
</dd></dl>
<dlclass="method">
<dtid="pNbody.pyfits.HDUList.index_of">
<ttclass="descname">index_of</tt><big>(</big><em>key</em><big>)</big><aclass="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>
<dlclass="method">
<dtid="pNbody.pyfits.HDUList.info">
<ttclass="descname">info</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.pyfits.HDUList.info"title="Permalink to this definition">¶</a></dt>
<dd><p>Summarize the info of the HDU’s in this HDUList.</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.pyfits.HDUList.readall">
<ttclass="descname">readall</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.pyfits.HDUList.readall"title="Permalink to this definition">¶</a></dt>
<dd><p>Read data of all HDU’s into memory.</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.pyfits.HDUList.update_extend">
<ttclass="descname">update_extend</tt><big>(</big><big>)</big><aclass="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>
<dlclass="method">
<dtid="pNbody.pyfits.HDUList.update_tbhdu">
<ttclass="descname">update_tbhdu</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.pyfits.HDUList.update_tbhdu"title="Permalink to this definition">¶</a></dt>
<dd><p>Update all table HDU’s for scaled fields.</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.pyfits.HDUList.writeto">
<ttclass="descname">writeto</tt><big>(</big><em>name</em>, <em>output_verify='exception'</em>, <em>clobber=False</em>, <em>classExtensions={}</em><big>)</big><aclass="headerlink"href="#pNbody.pyfits.HDUList.writeto"title="Permalink to this definition">¶</a></dt>
clobber: Overwrite the output file if exists, default = False.
classExtensions: A dictionary that maps pyfits classes to extensions</p>
<blockquote>
of those classes. When present in the dictionary,
the extension class will be constructed in place of
the pyfits class.</blockquote>
</dd></dl>
</dd></dl>
<dlclass="class">
<dtid="pNbody.pyfits.Header">
<emclass="property">class </em><ttclass="descclassname">pNbody.pyfits.</tt><ttclass="descname">Header</tt><big>(</big><em>cards=</em><spanclass="optional">[</span><spanclass="optional">]</span><big>)</big><aclass="headerlink"href="#pNbody.pyfits.Header"title="Permalink to this definition">¶</a></dt>
<dd><p>FITS header class.</p>
<pclass="rubric">Methods</p>
<dlclass="method">
<dtid="pNbody.pyfits.Header.add_blank">
<ttclass="descname">add_blank</tt><big>(</big><em>value=''</em>, <em>before=None</em>, <em>after=None</em><big>)</big><aclass="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>
<dlclass="method">
<dtid="pNbody.pyfits.Header.add_comment">
<ttclass="descname">add_comment</tt><big>(</big><em>value</em>, <em>before=None</em>, <em>after=None</em><big>)</big><aclass="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>
<dlclass="method">
<dtid="pNbody.pyfits.Header.add_history">
<ttclass="descname">add_history</tt><big>(</big><em>value</em>, <em>before=None</em>, <em>after=None</em><big>)</big><aclass="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>
<dlclass="method">
<dtid="pNbody.pyfits.Header.ascardlist">
<ttclass="descname">ascardlist</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.pyfits.Header.ascardlist"title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a CardList.</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.pyfits.Header.copy">
<ttclass="descname">copy</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.pyfits.Header.copy"title="Permalink to this definition">¶</a></dt>
<dd><p>Make a copy of the Header.</p>
</dd></dl>
<dlclass="method">
<dtid="pNbody.pyfits.Header.get">
<ttclass="descname">get</tt><big>(</big><em>key</em>, <em>default=None</em><big>)</big><aclass="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>
<dlclass="method">
<dtid="pNbody.pyfits.Header.get_comment">
<ttclass="descname">get_comment</tt><big>(</big><big>)</big><aclass="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>
<dlclass="method">
<dtid="pNbody.pyfits.Header.get_history">
<ttclass="descname">get_history</tt><big>(</big><big>)</big><aclass="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>
<dlclass="method">
<dtid="pNbody.pyfits.Header.has_key">
<ttclass="descname">has_key</tt><big>(</big><em>key</em><big>)</big><aclass="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>
<dlclass="method">
<dtid="pNbody.pyfits.Header.items">
<ttclass="descname">items</tt><big>(</big><big>)</big><aclass="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>
<dlclass="method">
<dtid="pNbody.pyfits.Header.rename_key">
<ttclass="descname">rename_key</tt><big>(</big><em>oldkey</em>, <em>newkey</em>, <em>force=0</em><big>)</big><aclass="headerlink"href="#pNbody.pyfits.Header.rename_key"title="Permalink to this definition">¶</a></dt>
<dd><p>Rename a card’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>
<dlclass="method">
<dtid="pNbody.pyfits.Header.update">
<ttclass="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><aclass="headerlink"href="#pNbody.pyfits.Header.update"title="Permalink to this definition">¶</a></dt>
<dd><p>Update one header card.</p>
</dd></dl>
</dd></dl>
<dlclass="class">
<dtid="pNbody.pyfits.ImageHDU">
<emclass="property">class </em><ttclass="descclassname">pNbody.pyfits.</tt><ttclass="descname">ImageHDU</tt><big>(</big><em>data=None</em>, <em>header=None</em>, <em>name=None</em><big>)</big><aclass="headerlink"href="#pNbody.pyfits.ImageHDU"title="Permalink to this definition">¶</a></dt>
<dd><p>FITS image extension HDU class.</p>
<pclass="rubric">Methods</p>
</dd></dl>
<dlclass="class">
<dtid="pNbody.pyfits.PrimaryHDU">
<emclass="property">class </em><ttclass="descclassname">pNbody.pyfits.</tt><ttclass="descname">PrimaryHDU</tt><big>(</big><em>data=None</em>, <em>header=None</em><big>)</big><aclass="headerlink"href="#pNbody.pyfits.PrimaryHDU"title="Permalink to this definition">¶</a></dt>
<dd><p>FITS primary HDU class.</p>
<pclass="rubric">Methods</p>
</dd></dl>
<dlclass="class">
<dtid="pNbody.pyfits.Section">
<emclass="property">class </em><ttclass="descclassname">pNbody.pyfits.</tt><ttclass="descname">Section</tt><big>(</big><em>hdu</em><big>)</big><aclass="headerlink"href="#pNbody.pyfits.Section"title="Permalink to this definition">¶</a></dt>
<dd><p>Image section.</p>
</dd></dl>
<dlclass="class">
<dtid="pNbody.pyfits.StreamingHDU">
<emclass="property">class </em><ttclass="descclassname">pNbody.pyfits.</tt><ttclass="descname">StreamingHDU</tt><big>(</big><em>name</em>, <em>header</em><big>)</big><aclass="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>
<dlclass="docutils">
<dt>for all the cards you need in the header:</dt>
<ttclass="descname">close</tt><big>(</big><big>)</big><aclass="headerlink"href="#pNbody.pyfits.StreamingHDU.close"title="Permalink to this definition">¶</a></dt>
<dd><p>Close the ‘physical’ FITS file.</p>
<ttclass="descname">size</tt><big>(</big><big>)</big><aclass="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>
<dd><pclass="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>
<dlclass="method">
<dtid="pNbody.pyfits.StreamingHDU.write">
<ttclass="descname">write</tt><big>(</big><em>data</em><big>)</big><aclass="headerlink"href="#pNbody.pyfits.StreamingHDU.write"title="Permalink to this definition">¶</a></dt>
<dd><pclass="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>
<pclass="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>
<dlclass="class">
<dtid="pNbody.pyfits.TableHDU">
<emclass="property">class </em><ttclass="descclassname">pNbody.pyfits.</tt><ttclass="descname">TableHDU</tt><big>(</big><em>data=None</em>, <em>header=None</em>, <em>name=None</em><big>)</big><aclass="headerlink"href="#pNbody.pyfits.TableHDU"title="Permalink to this definition">¶</a></dt>
<dd><p>FITS ASCII table extension HDU class.</p>
<pclass="rubric">Methods</p>
</dd></dl>
<dlclass="class">
<dtid="pNbody.pyfits.Undefined">
<emclass="property">class </em><ttclass="descclassname">pNbody.pyfits.</tt><ttclass="descname">Undefined</tt><aclass="headerlink"href="#pNbody.pyfits.Undefined"title="Permalink to this definition">¶</a></dt>
<dd><p>Undefined value.</p>
</dd></dl>
<dlclass="exception">
<dtid="pNbody.pyfits.VerifyError">
<emclass="property">exception </em><ttclass="descclassname">pNbody.pyfits.</tt><ttclass="descname">VerifyError</tt><aclass="headerlink"href="#pNbody.pyfits.VerifyError"title="Permalink to this definition">¶</a></dt>
<dd><p>Verify exception class.</p>
</dd></dl>
<dlclass="function">
<dtid="pNbody.pyfits.append">
<ttclass="descclassname">pNbody.pyfits.</tt><ttclass="descname">append</tt><big>(</big><em>filename</em>, <em>data</em>, <em>header=None</em>, <em>classExtensions={}</em><big>)</big><aclass="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>
<p>@type filename: string
@param filename: name of the file to append to
@type data: array, table, or group data object
@param data: the new data used for appending
@type header: L{Header} object or None
@param header: the header associated with ‘data’, if None,</p>
<blockquote>
an appropriate header will be created for the data object
supplied.</blockquote>
<p>@type classExtensions: dictionary
@param classExtensions: A dictionary that maps pyfits classes to</p>
<blockquote>
extensions of those classes. When present in
the dictionary, the extension class will be
constructed in place of the pyfits class.</blockquote>
</blockquote>
</dd></dl>
<dlclass="function">
<dtid="pNbody.pyfits.fitsopen">
<ttclass="descclassname">pNbody.pyfits.</tt><ttclass="descname">fitsopen</tt><big>(</big><em>name</em>, <em>mode='copyonwrite'</em>, <em>memmap=0</em>, <em>classExtensions={}</em><big>)</big><aclass="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, ‘readonly’ (default), ‘update’, or ‘append’.
memmap: Is memmory mapping to be used? default=0.
classExtensions: A dictionary that maps pyfits classes to extensions of</p>
<blockquote>
those classes. When present in the dictionary, the
extension class will be constructed in place of the
pyfits class.</blockquote>
</dd></dl>
<dlclass="function">
<dtid="pNbody.pyfits.getdata">
<ttclass="descclassname">pNbody.pyfits.</tt><ttclass="descname">getdata</tt><big>(</big><em>filename</em>, <em>*ext</em>, <em>**extkeys</em><big>)</big><aclass="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>@type filename: string
@param filename: input FITS file name</p>
<dlclass="docutils">
<dt>@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>@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>
<divclass="highlight-python"><divclass="highlight"><pre><spanclass="gp">>>></span><spanclass="n">getdata</span><spanclass="p">(</span><spanclass="s">'in.fits'</span><spanclass="p">,</span><spanclass="mi">0</span><spanclass="p">)</span><spanclass="c"># the primary header </span>
<spanclass="gp">>>></span><spanclass="n">getdata</span><spanclass="p">(</span><spanclass="s">'in.fits'</span><spanclass="p">,</span><spanclass="mi">2</span><spanclass="p">)</span><spanclass="c"># the second extension</span>
<spanclass="gp">>>></span><spanclass="n">getdata</span><spanclass="p">(</span><spanclass="s">'in.fits'</span><spanclass="p">,</span><spanclass="n">ext</span><spanclass="o">=</span><spanclass="mi">2</span><spanclass="p">)</span><spanclass="c"># the second extension</span>
<p>@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 ‘header’ is set to True, this function will
return a (data, header) tuple.</p>
</dd></dl>
<dlclass="function">
<dtid="pNbody.pyfits.getheader">
<ttclass="descclassname">pNbody.pyfits.</tt><ttclass="descname">getheader</tt><big>(</big><em>filename</em>, <em>*ext</em>, <em>**extkeys</em><big>)</big><aclass="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>@param filename: input FITS file name
@type: string
@keyword classExtensions: (optional) A dictionary that maps pyfits</p>
<blockquote>
classes to extensions of those classes. When present in the
dictionary, the extension class will be constructed in place
of the pyfits class.</blockquote>
<dlclass="docutils">
<dt>@param ext: The rest of the arguments are for extension specification.</dt>
<dd>See L{getdata} for explanations/examples.</dd>
</dl>
<p>@rtype: L{Header} object
@return: header</p>
</dd></dl>
<dlclass="function">
<dtid="pNbody.pyfits.getval">
<ttclass="descclassname">pNbody.pyfits.</tt><ttclass="descname">getval</tt><big>(</big><em>filename</em>, <em>key</em>, <em>*ext</em>, <em>**extkeys</em><big>)</big><aclass="headerlink"href="#pNbody.pyfits.getval"title="Permalink to this definition">¶</a></dt>
<dd><p>Get a keyword’s value from a header in a FITS file.</p>
<p>@type filename: string
@param filename: input FITS file name
@type key: string
@param key: keyword name
@keyword classExtensions: (optional) A dictionary that maps pyfits</p>
<blockquote>
classes to extensions of those classes. When present in the
dictionary, the extension class will be constructed in place
of the pyfits class.</blockquote>
<dlclass="docutils">
<dt>@param ext: The rest of the arguments are for extension specification.</dt>
<dd>See L{getdata} for explanations/examples.</dd>
</dl>
<p>@return: keyword value
@rtype: string, integer, or float</p>
</dd></dl>
<dlclass="function">
<dtid="pNbody.pyfits.info">
<ttclass="descclassname">pNbody.pyfits.</tt><ttclass="descname">info</tt><big>(</big><em>filename</em>, <em>classExtensions={}</em><big>)</big><aclass="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>@type filename: string
@param filename: input FITS file name
@type classExtensions: dictionary
@param classExtensions: A dictionary that maps pyfits classes to</p>
<blockquote>
extensions of those classes. When present in
the dictionary, the extension class will be
constructed in place of the pyfits class.</blockquote>
</dd></dl>
<dlclass="function">
<dtid="pNbody.pyfits.new_table">
<ttclass="descclassname">pNbody.pyfits.</tt><ttclass="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><aclass="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>
<dlclass="function">
<dtid="pNbody.pyfits.open">
<ttclass="descclassname">pNbody.pyfits.</tt><ttclass="descname">open</tt><big>(</big><em>name</em>, <em>mode='copyonwrite'</em>, <em>memmap=0</em>, <em>classExtensions={}</em><big>)</big><aclass="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, ‘readonly’ (default), ‘update’, or ‘append’.
memmap: Is memmory mapping to be used? default=0.
classExtensions: A dictionary that maps pyfits classes to extensions of</p>
<blockquote>
those classes. When present in the dictionary, the
extension class will be constructed in place of the
pyfits class.</blockquote>
</dd></dl>
<dlclass="function">
<dtid="pNbody.pyfits.update">
<ttclass="descclassname">pNbody.pyfits.</tt><ttclass="descname">update</tt><big>(</big><em>filename</em>, <em>data</em>, <em>*ext</em>, <em>**extkeys</em><big>)</big><aclass="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>@type filename: string
@param filename: name of the file to be updated
data: the new data used for updating
@keyword classExtensions: (optional) A dictionary that maps pyfits</p>
<blockquote>
classes to extensions of those classes. When present in the
dictionary, the extension class will be constructed in place
of the pyfits class.</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>
<divclass="highlight-python"><divclass="highlight"><pre><spanclass="gp">>>></span><spanclass="n">update</span><spanclass="p">(</span><spanclass="nb">file</span><spanclass="p">,</span><spanclass="n">dat</span><spanclass="p">,</span><spanclass="n">hdr</span><spanclass="p">,</span><spanclass="s">'sci'</span><spanclass="p">)</span><spanclass="c"># update the 'sci' extension</span>
<spanclass="gp">>>></span><spanclass="n">update</span><spanclass="p">(</span><spanclass="nb">file</span><spanclass="p">,</span><spanclass="n">dat</span><spanclass="p">,</span><spanclass="mi">3</span><spanclass="p">)</span><spanclass="c"># update the 3rd extension</span>
<spanclass="gp">>>></span><spanclass="n">update</span><spanclass="p">(</span><spanclass="nb">file</span><spanclass="p">,</span><spanclass="n">dat</span><spanclass="p">,</span><spanclass="n">hdr</span><spanclass="p">,</span><spanclass="mi">3</span><spanclass="p">)</span><spanclass="c"># update the 3rd extension</span>
<spanclass="gp">>>></span><spanclass="n">update</span><spanclass="p">(</span><spanclass="nb">file</span><spanclass="p">,</span><spanclass="n">dat</span><spanclass="p">,</span><spanclass="s">'sci'</span><spanclass="p">,</span><spanclass="mi">2</span><spanclass="p">)</span><spanclass="c"># update the 2nd SCI extension</span>
<spanclass="gp">>>></span><spanclass="n">update</span><spanclass="p">(</span><spanclass="nb">file</span><spanclass="p">,</span><spanclass="n">dat</span><spanclass="p">,</span><spanclass="mi">3</span><spanclass="p">,</span><spanclass="n">header</span><spanclass="o">=</span><spanclass="n">hdr</span><spanclass="p">)</span><spanclass="c"># update the 3rd extension</span>
<spanclass="gp">>>></span><spanclass="n">update</span><spanclass="p">(</span><spanclass="nb">file</span><spanclass="p">,</span><spanclass="n">dat</span><spanclass="p">,</span><spanclass="n">header</span><spanclass="o">=</span><spanclass="n">hdr</span><spanclass="p">,</span><spanclass="n">ext</span><spanclass="o">=</span><spanclass="mi">5</span><spanclass="p">)</span><spanclass="c"># update the 5th extension</span>
</pre></div>
</div>
</dd></dl>
<dlclass="function">
<dtid="pNbody.pyfits.writeto">
<ttclass="descclassname">pNbody.pyfits.</tt><ttclass="descname">writeto</tt><big>(</big><em>filename</em>, <em>data</em>, <em>header=None</em>, <em>**keys</em><big>)</big><aclass="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>@type filename: string
@param filename: name of the new FITS file to write to
@type data: array, record array, or groups data object
@param data: data to write to the new file
@type header: L{Header} object or None
@param header: the header associated with ‘data’, if None, a</p>
<blockquote>
header of the appropriate type is created for the supplied
data. This argument is optional.</blockquote>
<dlclass="docutils">
<dt>@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>@keyword clobber: (optional) if True and if filename already exists, it</dt>
<dd>will overwrite the file. Default is False.</dd>