<!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>Differs — 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="Verification options" href="verification.html" /> <link rel="prev" title="Images" href="images.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="verification.html" title="Verification options"> next » </a> </li> <li class="right"> <a href="images.html" title="Images"> « previous </a> | </li> <li> <a href="../../../index.html">Astropy v0.2.4</a> » </li> <li><a href="../index.html" accesskey="U">FITS File handling (<tt class="docutils literal"><span class="pre">astropy.io.fits</span></tt>)</a> »</li> <li>Differs</li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body"> <div class="section" id="module-astropy.io.fits.diff"> <span id="differs"></span><h1>Differs<a class="headerlink" href="#module-astropy.io.fits.diff" title="Permalink to this headline">¶</a></h1> <p>Facilities for diffing two FITS files. Includes objects for diffing entire FITS files, individual HDUs, FITS headers, or just FITS data.</p> <p>Used to implement the fitsdiff program.</p> <div class="section" id="fitsdiff"> <h2><a class="reference internal" href="#astropy.io.fits.FITSDiff" title="astropy.io.fits.FITSDiff"><tt class="xref py py-class docutils literal"><span class="pre">FITSDiff</span></tt></a><a class="headerlink" href="#fitsdiff" title="Permalink to this headline">¶</a></h2> <dl class="class"> <dt id="astropy.io.fits.FITSDiff"> <em class="property">class </em><tt class="descclassname">astropy.io.fits.</tt><tt class="descname">FITSDiff</tt><big>(</big><em>a</em>, <em>b</em>, <em>ignore_keywords=</em><span class="optional">[</span><span class="optional">]</span>, <em>ignore_comments=</em><span class="optional">[</span><span class="optional">]</span>, <em>ignore_fields=</em><span class="optional">[</span><span class="optional">]</span>, <em>numdiffs=10</em>, <em>tolerance=0.0</em>, <em>ignore_blanks=True</em>, <em>ignore_blank_cards=True</em><big>)</big><a class="reference external" href="http://github.com/astropy/astropy/tree/v0.2.4/astropy/io/fits.py#L175" title="Push the Edit button on the next page"><span class="edit-on-github viewcode-link"> [edit on github]</span></a><a class="headerlink" href="#astropy.io.fits.FITSDiff" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">astropy.io.fits.diff._BaseDiff</span></tt></p> <p>Diff two FITS files by filename, or two <a class="reference internal" href="hdulists.html#astropy.io.fits.HDUList" title="astropy.io.fits.HDUList"><tt class="xref py py-obj docutils literal"><span class="pre">HDUList</span></tt></a> objects.</p> <p><a class="reference internal" href="#astropy.io.fits.FITSDiff" title="astropy.io.fits.FITSDiff"><tt class="xref py py-obj docutils literal"><span class="pre">FITSDiff</span></tt></a> objects have the following diff attributes:</p> <ul class="simple"> <li><tt class="xref py py-obj docutils literal"><span class="pre">diff_hdu_count</span></tt>: If the FITS files being compared have different numbers of HDUs, this contains a 2-tuple of the number of HDUs in each file.</li> <li><tt class="xref py py-obj docutils literal"><span class="pre">diff_hdus</span></tt>: If any HDUs with the same index are different, this contains a list of 2-tuples of the HDU index and the <a class="reference internal" href="#astropy.io.fits.HDUDiff" title="astropy.io.fits.HDUDiff"><tt class="xref py py-obj docutils literal"><span class="pre">HDUDiff</span></tt></a> object representing the differences between the two HDUs.</li> </ul> <dl class="classmethod"> <dt id="astropy.io.fits.FITSDiff.fromdiff"> <em class="property">classmethod </em><tt class="descname">fromdiff</tt><big>(</big><em>other</em>, <em>a</em>, <em>b</em><big>)</big><a class="reference external" href="http://github.com/astropy/astropy/tree/v0.2.4/astropy/io/fits.py#L93" title="Push the Edit button on the next page"><span class="edit-on-github viewcode-link"> [edit on github]</span></a><a class="headerlink" href="#astropy.io.fits.FITSDiff.fromdiff" title="Permalink to this definition">¶</a></dt> <dd><p>Returns a new Diff object of a specfic subclass from an existing diff object, passing on the values for any arguments they share in common (such as ignore_keywords).</p> <p>For example:</p> <div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="n">fd</span> <span class="o">=</span> <span class="n">FITSDiff</span><span class="p">(</span><span class="s">'a.fits'</span><span class="p">,</span> <span class="s">'b.fits'</span><span class="p">,</span> <span class="n">ignore_keywords</span><span class="o">=</span><span class="p">[</span><span class="s">'*'</span><span class="p">])</span> <span class="gp">>>> </span><span class="n">hd</span> <span class="o">=</span> <span class="n">HeaderDiff</span><span class="o">.</span><span class="n">fromdiff</span><span class="p">(</span><span class="n">fd</span><span class="p">,</span> <span class="n">header_a</span><span class="p">,</span> <span class="n">header_b</span><span class="p">)</span> <span class="gp">>>> </span><span class="n">hd</span><span class="o">.</span><span class="n">ignore_keywords</span> <span class="go">['*']</span> </pre></div> </div> </dd></dl> <dl class="attribute"> <dt id="astropy.io.fits.FITSDiff.identical"> <tt class="descname">identical</tt><a class="headerlink" href="#astropy.io.fits.FITSDiff.identical" title="Permalink to this definition">¶</a></dt> <dd><p><tt class="xref py py-obj docutils literal"><span class="pre">True</span></tt> if all the <tt class="xref py py-obj docutils literal"><span class="pre">diff_*</span></tt> attributes on this diff instance are empty, implying that no differences were found.</p> <p>Any subclass of <tt class="xref py py-obj docutils literal"><span class="pre">_BaseDiff</span></tt> must have at least one <tt class="xref py py-obj docutils literal"><span class="pre">diff_*</span></tt> attribute, which contains a non-empty value if and only if some difference was found between the two objects being compared.</p> </dd></dl> <dl class="method"> <dt id="astropy.io.fits.FITSDiff.report"> <tt class="descname">report</tt><big>(</big><em>fileobj=None</em>, <em>indent=0</em><big>)</big><a class="reference external" href="http://github.com/astropy/astropy/tree/v0.2.4/astropy/io/fits.py#L131" title="Push the Edit button on the next page"><span class="edit-on-github viewcode-link"> [edit on github]</span></a><a class="headerlink" href="#astropy.io.fits.FITSDiff.report" title="Permalink to this definition">¶</a></dt> <dd><p>Generates a text report on the differences (if any) between two objects, and either returns it as a string or writes it to a file-like object.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters :</th><td class="field-body"><p class="first"><strong>fileobj</strong> : file-like object or None (optional)</p> <blockquote> <div><p>If <tt class="xref py py-obj docutils literal"><span class="pre">None</span></tt>, this method returns the report as a string. Otherwise it returns <tt class="xref py py-obj docutils literal"><span class="pre">None</span></tt> and writes the report to the given file-like object (which must have a <tt class="docutils literal"><span class="pre">.write()</span></tt> method at a minimum).</p> </div></blockquote> <p><strong>indent</strong> : int</p> <blockquote> <div><p>The number of 4 space tabs to indent the report.</p> </div></blockquote> </td> </tr> <tr class="field-even field"><th class="field-name">Returns :</th><td class="field-body"><p class="first last"><strong>report</strong> : str or None</p> </td> </tr> </tbody> </table> </dd></dl> </dd></dl> </div> <div class="section" id="hdudiff"> <h2><a class="reference internal" href="#astropy.io.fits.HDUDiff" title="astropy.io.fits.HDUDiff"><tt class="xref py py-class docutils literal"><span class="pre">HDUDiff</span></tt></a><a class="headerlink" href="#hdudiff" title="Permalink to this headline">¶</a></h2> <dl class="class"> <dt id="astropy.io.fits.HDUDiff"> <em class="property">class </em><tt class="descclassname">astropy.io.fits.</tt><tt class="descname">HDUDiff</tt><big>(</big><em>a</em>, <em>b</em>, <em>ignore_keywords=</em><span class="optional">[</span><span class="optional">]</span>, <em>ignore_comments=</em><span class="optional">[</span><span class="optional">]</span>, <em>ignore_fields=</em><span class="optional">[</span><span class="optional">]</span>, <em>numdiffs=10</em>, <em>tolerance=0.0</em>, <em>ignore_blanks=True</em>, <em>ignore_blank_cards=True</em><big>)</big><a class="reference external" href="http://github.com/astropy/astropy/tree/v0.2.4/astropy/io/fits.py#L347" title="Push the Edit button on the next page"><span class="edit-on-github viewcode-link"> [edit on github]</span></a><a class="headerlink" href="#astropy.io.fits.HDUDiff" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">astropy.io.fits.diff._BaseDiff</span></tt></p> <p>Diff two HDU objects, including their headers and their data (but only if both HDUs contain the same type of data (image, table, or unknown).</p> <p><a class="reference internal" href="#astropy.io.fits.HDUDiff" title="astropy.io.fits.HDUDiff"><tt class="xref py py-obj docutils literal"><span class="pre">HDUDiff</span></tt></a> objects have the following diff attributes:</p> <ul class="simple"> <li><tt class="xref py py-obj docutils literal"><span class="pre">diff_extnames</span></tt>: If the two HDUs have different EXTNAME values, this contains a 2-tuple of the different extension names.</li> <li><tt class="xref py py-obj docutils literal"><span class="pre">diff_extvers</span></tt>: If the two HDUS have different EXTVER values, this contains a 2-tuple of the different extension versions.</li> <li><tt class="xref py py-obj docutils literal"><span class="pre">diff_extension_types</span></tt>: If the two HDUs have different XTENSION values, this contains a 2-tuple of the different extension types.</li> <li><tt class="xref py py-obj docutils literal"><span class="pre">diff_headers</span></tt>: Contains a <a class="reference internal" href="#astropy.io.fits.HeaderDiff" title="astropy.io.fits.HeaderDiff"><tt class="xref py py-obj docutils literal"><span class="pre">HeaderDiff</span></tt></a> object for the headers of the two HDUs. This will always contain an object–it may be determined whether the headers are different through <tt class="xref py py-obj docutils literal"><span class="pre">diff_headers.identical</span></tt>.</li> <li><tt class="xref py py-obj docutils literal"><span class="pre">diff_data</span></tt>: Contains either a <a class="reference internal" href="#astropy.io.fits.ImageDataDiff" title="astropy.io.fits.ImageDataDiff"><tt class="xref py py-obj docutils literal"><span class="pre">ImageDataDiff</span></tt></a>, <a class="reference internal" href="#astropy.io.fits.TableDataDiff" title="astropy.io.fits.TableDataDiff"><tt class="xref py py-obj docutils literal"><span class="pre">TableDataDiff</span></tt></a>, or <a class="reference internal" href="#astropy.io.fits.RawDataDiff" title="astropy.io.fits.RawDataDiff"><tt class="xref py py-obj docutils literal"><span class="pre">RawDataDiff</span></tt></a> as appropriate for the data in the HDUs, and only if the two HDUs have non-empty data of the same type (<a class="reference internal" href="#astropy.io.fits.RawDataDiff" title="astropy.io.fits.RawDataDiff"><tt class="xref py py-obj docutils literal"><span class="pre">RawDataDiff</span></tt></a> is used for HDUs containing non-empty data of an indeterminate type).</li> </ul> <dl class="classmethod"> <dt id="astropy.io.fits.HDUDiff.fromdiff"> <em class="property">classmethod </em><tt class="descname">fromdiff</tt><big>(</big><em>other</em>, <em>a</em>, <em>b</em><big>)</big><a class="reference external" href="http://github.com/astropy/astropy/tree/v0.2.4/astropy/io/fits.py#L93" title="Push the Edit button on the next page"><span class="edit-on-github viewcode-link"> [edit on github]</span></a><a class="headerlink" href="#astropy.io.fits.HDUDiff.fromdiff" title="Permalink to this definition">¶</a></dt> <dd><p>Returns a new Diff object of a specfic subclass from an existing diff object, passing on the values for any arguments they share in common (such as ignore_keywords).</p> <p>For example:</p> <div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="n">fd</span> <span class="o">=</span> <span class="n">FITSDiff</span><span class="p">(</span><span class="s">'a.fits'</span><span class="p">,</span> <span class="s">'b.fits'</span><span class="p">,</span> <span class="n">ignore_keywords</span><span class="o">=</span><span class="p">[</span><span class="s">'*'</span><span class="p">])</span> <span class="gp">>>> </span><span class="n">hd</span> <span class="o">=</span> <span class="n">HeaderDiff</span><span class="o">.</span><span class="n">fromdiff</span><span class="p">(</span><span class="n">fd</span><span class="p">,</span> <span class="n">header_a</span><span class="p">,</span> <span class="n">header_b</span><span class="p">)</span> <span class="gp">>>> </span><span class="n">hd</span><span class="o">.</span><span class="n">ignore_keywords</span> <span class="go">['*']</span> </pre></div> </div> </dd></dl> <dl class="attribute"> <dt id="astropy.io.fits.HDUDiff.identical"> <tt class="descname">identical</tt><a class="headerlink" href="#astropy.io.fits.HDUDiff.identical" title="Permalink to this definition">¶</a></dt> <dd><p><tt class="xref py py-obj docutils literal"><span class="pre">True</span></tt> if all the <tt class="xref py py-obj docutils literal"><span class="pre">diff_*</span></tt> attributes on this diff instance are empty, implying that no differences were found.</p> <p>Any subclass of <tt class="xref py py-obj docutils literal"><span class="pre">_BaseDiff</span></tt> must have at least one <tt class="xref py py-obj docutils literal"><span class="pre">diff_*</span></tt> attribute, which contains a non-empty value if and only if some difference was found between the two objects being compared.</p> </dd></dl> <dl class="method"> <dt id="astropy.io.fits.HDUDiff.report"> <tt class="descname">report</tt><big>(</big><em>fileobj=None</em>, <em>indent=0</em><big>)</big><a class="reference external" href="http://github.com/astropy/astropy/tree/v0.2.4/astropy/io/fits.py#L131" title="Push the Edit button on the next page"><span class="edit-on-github viewcode-link"> [edit on github]</span></a><a class="headerlink" href="#astropy.io.fits.HDUDiff.report" title="Permalink to this definition">¶</a></dt> <dd><p>Generates a text report on the differences (if any) between two objects, and either returns it as a string or writes it to a file-like object.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters :</th><td class="field-body"><p class="first"><strong>fileobj</strong> : file-like object or None (optional)</p> <blockquote> <div><p>If <tt class="xref py py-obj docutils literal"><span class="pre">None</span></tt>, this method returns the report as a string. Otherwise it returns <tt class="xref py py-obj docutils literal"><span class="pre">None</span></tt> and writes the report to the given file-like object (which must have a <tt class="docutils literal"><span class="pre">.write()</span></tt> method at a minimum).</p> </div></blockquote> <p><strong>indent</strong> : int</p> <blockquote> <div><p>The number of 4 space tabs to indent the report.</p> </div></blockquote> </td> </tr> <tr class="field-even field"><th class="field-name">Returns :</th><td class="field-body"><p class="first last"><strong>report</strong> : str or None</p> </td> </tr> </tbody> </table> </dd></dl> </dd></dl> </div> <div class="section" id="headerdiff"> <h2><a class="reference internal" href="#astropy.io.fits.HeaderDiff" title="astropy.io.fits.HeaderDiff"><tt class="xref py py-class docutils literal"><span class="pre">HeaderDiff</span></tt></a><a class="headerlink" href="#headerdiff" title="Permalink to this headline">¶</a></h2> <dl class="class"> <dt id="astropy.io.fits.HeaderDiff"> <em class="property">class </em><tt class="descclassname">astropy.io.fits.</tt><tt class="descname">HeaderDiff</tt><big>(</big><em>a</em>, <em>b</em>, <em>ignore_keywords=</em><span class="optional">[</span><span class="optional">]</span>, <em>ignore_comments=</em><span class="optional">[</span><span class="optional">]</span>, <em>tolerance=0.0</em>, <em>ignore_blanks=True</em>, <em>ignore_blank_cards=True</em><big>)</big><a class="reference external" href="http://github.com/astropy/astropy/tree/v0.2.4/astropy/io/fits.py#L455" title="Push the Edit button on the next page"><span class="edit-on-github viewcode-link"> [edit on github]</span></a><a class="headerlink" href="#astropy.io.fits.HeaderDiff" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">astropy.io.fits.diff._BaseDiff</span></tt></p> <p>Diff two <a class="reference internal" href="headers.html#astropy.io.fits.Header" title="astropy.io.fits.Header"><tt class="xref py py-obj docutils literal"><span class="pre">Header</span></tt></a> objects.</p> <p><a class="reference internal" href="#astropy.io.fits.HeaderDiff" title="astropy.io.fits.HeaderDiff"><tt class="xref py py-obj docutils literal"><span class="pre">HeaderDiff</span></tt></a> objects have the following diff attributes:</p> <ul> <li><p class="first"><tt class="xref py py-obj docutils literal"><span class="pre">diff_keyword_count</span></tt>: If the two headers contain a different number of keywords, this contains a 2-tuple of the keyword count for each header.</p> </li> <li><p class="first"><tt class="xref py py-obj docutils literal"><span class="pre">diff_keywords</span></tt>: If either header contains one or more keywords that don’t appear at all in the other header, this contains a 2-tuple consisting of a list of the keywords only appearing in header a, and a list of the keywords only appearing in header b.</p> </li> <li><p class="first"><tt class="xref py py-obj docutils literal"><span class="pre">diff_duplicate_keywords</span></tt>: If a keyword appears in both headers at least once, but contains a different number of duplicates (for example, a different number of HISTORY cards in each header), an item is added to this dict with the keyword as the key, and a 2-tuple of the different counts of that keyword as the value. For example:</p> <div class="highlight-python"><div class="highlight"><pre><span class="p">{</span><span class="s">'HISTORY'</span><span class="p">:</span> <span class="p">(</span><span class="mi">20</span><span class="p">,</span> <span class="mi">19</span><span class="p">)}</span> </pre></div> </div> <p>means that header a contains 20 HISTORY cards, while header b contains only 19 HISTORY cards.</p> </li> <li><p class="first"><tt class="xref py py-obj docutils literal"><span class="pre">diff_keyword_values</span></tt>: If any of the common keyword between the two headers have different values, they appear in this dict. It has a structure similar to <tt class="xref py py-obj docutils literal"><span class="pre">diff_duplicate_keywords</span></tt>, with the keyword as the key, and a 2-tuple of the different values as the value. For example:</p> <div class="highlight-python"><div class="highlight"><pre><span class="p">{</span><span class="s">'NAXIS'</span><span class="p">:</span> <span class="p">(</span><span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)}</span> </pre></div> </div> <p>means that the NAXIS keyword has a value of 2 in header a, and a value of 3 in header b. This excludes any keywords matched by the <tt class="xref py py-obj docutils literal"><span class="pre">ignore_keywords</span></tt> list.</p> </li> <li><p class="first"><tt class="xref py py-obj docutils literal"><span class="pre">diff_keyword_comments</span></tt>: Like <tt class="xref py py-obj docutils literal"><span class="pre">diff_keyword_values</span></tt>, but contains differences between keyword comments.</p> </li> </ul> <p><a class="reference internal" href="#astropy.io.fits.HeaderDiff" title="astropy.io.fits.HeaderDiff"><tt class="xref py py-obj docutils literal"><span class="pre">HeaderDiff</span></tt></a> objects also have a <tt class="xref py py-obj docutils literal"><span class="pre">common_keywords</span></tt> attribute that lists all keywords that appear in both headers.</p> <dl class="classmethod"> <dt id="astropy.io.fits.HeaderDiff.fromdiff"> <em class="property">classmethod </em><tt class="descname">fromdiff</tt><big>(</big><em>other</em>, <em>a</em>, <em>b</em><big>)</big><a class="reference external" href="http://github.com/astropy/astropy/tree/v0.2.4/astropy/io/fits.py#L93" title="Push the Edit button on the next page"><span class="edit-on-github viewcode-link"> [edit on github]</span></a><a class="headerlink" href="#astropy.io.fits.HeaderDiff.fromdiff" title="Permalink to this definition">¶</a></dt> <dd><p>Returns a new Diff object of a specfic subclass from an existing diff object, passing on the values for any arguments they share in common (such as ignore_keywords).</p> <p>For example:</p> <div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="n">fd</span> <span class="o">=</span> <span class="n">FITSDiff</span><span class="p">(</span><span class="s">'a.fits'</span><span class="p">,</span> <span class="s">'b.fits'</span><span class="p">,</span> <span class="n">ignore_keywords</span><span class="o">=</span><span class="p">[</span><span class="s">'*'</span><span class="p">])</span> <span class="gp">>>> </span><span class="n">hd</span> <span class="o">=</span> <span class="n">HeaderDiff</span><span class="o">.</span><span class="n">fromdiff</span><span class="p">(</span><span class="n">fd</span><span class="p">,</span> <span class="n">header_a</span><span class="p">,</span> <span class="n">header_b</span><span class="p">)</span> <span class="gp">>>> </span><span class="n">hd</span><span class="o">.</span><span class="n">ignore_keywords</span> <span class="go">['*']</span> </pre></div> </div> </dd></dl> <dl class="attribute"> <dt id="astropy.io.fits.HeaderDiff.identical"> <tt class="descname">identical</tt><a class="headerlink" href="#astropy.io.fits.HeaderDiff.identical" title="Permalink to this definition">¶</a></dt> <dd><p><tt class="xref py py-obj docutils literal"><span class="pre">True</span></tt> if all the <tt class="xref py py-obj docutils literal"><span class="pre">diff_*</span></tt> attributes on this diff instance are empty, implying that no differences were found.</p> <p>Any subclass of <tt class="xref py py-obj docutils literal"><span class="pre">_BaseDiff</span></tt> must have at least one <tt class="xref py py-obj docutils literal"><span class="pre">diff_*</span></tt> attribute, which contains a non-empty value if and only if some difference was found between the two objects being compared.</p> </dd></dl> <dl class="method"> <dt id="astropy.io.fits.HeaderDiff.report"> <tt class="descname">report</tt><big>(</big><em>fileobj=None</em>, <em>indent=0</em><big>)</big><a class="reference external" href="http://github.com/astropy/astropy/tree/v0.2.4/astropy/io/fits.py#L131" title="Push the Edit button on the next page"><span class="edit-on-github viewcode-link"> [edit on github]</span></a><a class="headerlink" href="#astropy.io.fits.HeaderDiff.report" title="Permalink to this definition">¶</a></dt> <dd><p>Generates a text report on the differences (if any) between two objects, and either returns it as a string or writes it to a file-like object.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters :</th><td class="field-body"><p class="first"><strong>fileobj</strong> : file-like object or None (optional)</p> <blockquote> <div><p>If <tt class="xref py py-obj docutils literal"><span class="pre">None</span></tt>, this method returns the report as a string. Otherwise it returns <tt class="xref py py-obj docutils literal"><span class="pre">None</span></tt> and writes the report to the given file-like object (which must have a <tt class="docutils literal"><span class="pre">.write()</span></tt> method at a minimum).</p> </div></blockquote> <p><strong>indent</strong> : int</p> <blockquote> <div><p>The number of 4 space tabs to indent the report.</p> </div></blockquote> </td> </tr> <tr class="field-even field"><th class="field-name">Returns :</th><td class="field-body"><p class="first last"><strong>report</strong> : str or None</p> </td> </tr> </tbody> </table> </dd></dl> </dd></dl> </div> <div class="section" id="imagedatadiff"> <h2><a class="reference internal" href="#astropy.io.fits.ImageDataDiff" title="astropy.io.fits.ImageDataDiff"><tt class="xref py py-class docutils literal"><span class="pre">ImageDataDiff</span></tt></a><a class="headerlink" href="#imagedatadiff" title="Permalink to this headline">¶</a></h2> <dl class="class"> <dt id="astropy.io.fits.ImageDataDiff"> <em class="property">class </em><tt class="descclassname">astropy.io.fits.</tt><tt class="descname">ImageDataDiff</tt><big>(</big><em>a</em>, <em>b</em>, <em>numdiffs=10</em>, <em>tolerance=0.0</em><big>)</big><a class="reference external" href="http://github.com/astropy/astropy/tree/v0.2.4/astropy/io/fits.py#L712" title="Push the Edit button on the next page"><span class="edit-on-github viewcode-link"> [edit on github]</span></a><a class="headerlink" href="#astropy.io.fits.ImageDataDiff" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">astropy.io.fits.diff._BaseDiff</span></tt></p> <p>Diff two image data arrays (really any array from a PRIMARY HDU or an IMAGE extension HDU, though the data unit is assumed to be “pixels”).</p> <p><a class="reference internal" href="#astropy.io.fits.ImageDataDiff" title="astropy.io.fits.ImageDataDiff"><tt class="xref py py-obj docutils literal"><span class="pre">ImageDataDiff</span></tt></a> objects have the following diff attributes:</p> <ul> <li><p class="first"><tt class="xref py py-obj docutils literal"><span class="pre">diff_dimensions</span></tt>: If the two arrays contain either a different number of dimensions or different sizes in any dimension, this contains a 2-tuple of the shapes of each array. Currently no further comparison is performed on images that don’t have the exact same dimensions.</p> </li> <li><p class="first"><tt class="xref py py-obj docutils literal"><span class="pre">diff_pixels</span></tt>: If the two images contain any different pixels, this contains a list of 2-tuples of the array index where the difference was found, and another 2-tuple containing the different values. For example, if the pixel at (0, 0) contains different values this would look like:</p> <div class="highlight-python"><div class="highlight"><pre><span class="p">[(</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</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> </pre></div> </div> <p>where 1.1 and 2.2 are the values of that pixel in each array. This array only contains up to <tt class="xref py py-obj docutils literal"><span class="pre">self.numdiffs</span></tt> differences, for storage efficiency.</p> </li> <li><p class="first"><tt class="xref py py-obj docutils literal"><span class="pre">diff_total</span></tt>: The total number of different pixels found between the arrays. Although <tt class="xref py py-obj docutils literal"><span class="pre">diff_pixels</span></tt> does not necessarily contain all the different pixel values, this can be used to get a count of the total number of differences found.</p> </li> <li><p class="first"><tt class="xref py py-obj docutils literal"><span class="pre">diff_ratio</span></tt>: Contains the ratio of <tt class="xref py py-obj docutils literal"><span class="pre">diff_total</span></tt> to the total number of pixels in the arrays.</p> </li> </ul> <dl class="classmethod"> <dt id="astropy.io.fits.ImageDataDiff.fromdiff"> <em class="property">classmethod </em><tt class="descname">fromdiff</tt><big>(</big><em>other</em>, <em>a</em>, <em>b</em><big>)</big><a class="reference external" href="http://github.com/astropy/astropy/tree/v0.2.4/astropy/io/fits.py#L93" title="Push the Edit button on the next page"><span class="edit-on-github viewcode-link"> [edit on github]</span></a><a class="headerlink" href="#astropy.io.fits.ImageDataDiff.fromdiff" title="Permalink to this definition">¶</a></dt> <dd><p>Returns a new Diff object of a specfic subclass from an existing diff object, passing on the values for any arguments they share in common (such as ignore_keywords).</p> <p>For example:</p> <div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="n">fd</span> <span class="o">=</span> <span class="n">FITSDiff</span><span class="p">(</span><span class="s">'a.fits'</span><span class="p">,</span> <span class="s">'b.fits'</span><span class="p">,</span> <span class="n">ignore_keywords</span><span class="o">=</span><span class="p">[</span><span class="s">'*'</span><span class="p">])</span> <span class="gp">>>> </span><span class="n">hd</span> <span class="o">=</span> <span class="n">HeaderDiff</span><span class="o">.</span><span class="n">fromdiff</span><span class="p">(</span><span class="n">fd</span><span class="p">,</span> <span class="n">header_a</span><span class="p">,</span> <span class="n">header_b</span><span class="p">)</span> <span class="gp">>>> </span><span class="n">hd</span><span class="o">.</span><span class="n">ignore_keywords</span> <span class="go">['*']</span> </pre></div> </div> </dd></dl> <dl class="attribute"> <dt id="astropy.io.fits.ImageDataDiff.identical"> <tt class="descname">identical</tt><a class="headerlink" href="#astropy.io.fits.ImageDataDiff.identical" title="Permalink to this definition">¶</a></dt> <dd><p><tt class="xref py py-obj docutils literal"><span class="pre">True</span></tt> if all the <tt class="xref py py-obj docutils literal"><span class="pre">diff_*</span></tt> attributes on this diff instance are empty, implying that no differences were found.</p> <p>Any subclass of <tt class="xref py py-obj docutils literal"><span class="pre">_BaseDiff</span></tt> must have at least one <tt class="xref py py-obj docutils literal"><span class="pre">diff_*</span></tt> attribute, which contains a non-empty value if and only if some difference was found between the two objects being compared.</p> </dd></dl> <dl class="method"> <dt id="astropy.io.fits.ImageDataDiff.report"> <tt class="descname">report</tt><big>(</big><em>fileobj=None</em>, <em>indent=0</em><big>)</big><a class="reference external" href="http://github.com/astropy/astropy/tree/v0.2.4/astropy/io/fits.py#L131" title="Push the Edit button on the next page"><span class="edit-on-github viewcode-link"> [edit on github]</span></a><a class="headerlink" href="#astropy.io.fits.ImageDataDiff.report" title="Permalink to this definition">¶</a></dt> <dd><p>Generates a text report on the differences (if any) between two objects, and either returns it as a string or writes it to a file-like object.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters :</th><td class="field-body"><p class="first"><strong>fileobj</strong> : file-like object or None (optional)</p> <blockquote> <div><p>If <tt class="xref py py-obj docutils literal"><span class="pre">None</span></tt>, this method returns the report as a string. Otherwise it returns <tt class="xref py py-obj docutils literal"><span class="pre">None</span></tt> and writes the report to the given file-like object (which must have a <tt class="docutils literal"><span class="pre">.write()</span></tt> method at a minimum).</p> </div></blockquote> <p><strong>indent</strong> : int</p> <blockquote> <div><p>The number of 4 space tabs to indent the report.</p> </div></blockquote> </td> </tr> <tr class="field-even field"><th class="field-name">Returns :</th><td class="field-body"><p class="first last"><strong>report</strong> : str or None</p> </td> </tr> </tbody> </table> </dd></dl> </dd></dl> </div> <div class="section" id="rawdatadiff"> <h2><a class="reference internal" href="#astropy.io.fits.RawDataDiff" title="astropy.io.fits.RawDataDiff"><tt class="xref py py-class docutils literal"><span class="pre">RawDataDiff</span></tt></a><a class="headerlink" href="#rawdatadiff" title="Permalink to this headline">¶</a></h2> <dl class="class"> <dt id="astropy.io.fits.RawDataDiff"> <em class="property">class </em><tt class="descclassname">astropy.io.fits.</tt><tt class="descname">RawDataDiff</tt><big>(</big><em>a</em>, <em>b</em>, <em>numdiffs=10</em><big>)</big><a class="reference external" href="http://github.com/astropy/astropy/tree/v0.2.4/astropy/io/fits.py#L828" title="Push the Edit button on the next page"><span class="edit-on-github viewcode-link"> [edit on github]</span></a><a class="headerlink" href="#astropy.io.fits.RawDataDiff" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">astropy.io.fits.diff.ImageDataDiff</span></tt></p> <p><a class="reference internal" href="#astropy.io.fits.RawDataDiff" title="astropy.io.fits.RawDataDiff"><tt class="xref py py-obj docutils literal"><span class="pre">RawDataDiff</span></tt></a> is just a special case of <a class="reference internal" href="#astropy.io.fits.ImageDataDiff" title="astropy.io.fits.ImageDataDiff"><tt class="xref py py-obj docutils literal"><span class="pre">ImageDataDiff</span></tt></a> where the images are one-dimensional, and the data is treated as a 1-dimensional array of bytes instead of pixel values. This is used to compare the data of two non-standard extension HDUs that were not recognized as containing image or table data.</p> <p><a class="reference internal" href="#astropy.io.fits.ImageDataDiff" title="astropy.io.fits.ImageDataDiff"><tt class="xref py py-obj docutils literal"><span class="pre">ImageDataDiff</span></tt></a> objects have the following diff attributes:</p> <ul class="simple"> <li><tt class="xref py py-obj docutils literal"><span class="pre">diff_dimensions</span></tt>: Same as the <tt class="xref py py-obj docutils literal"><span class="pre">diff_dimensions</span></tt> attribute of <a class="reference internal" href="#astropy.io.fits.ImageDataDiff" title="astropy.io.fits.ImageDataDiff"><tt class="xref py py-obj docutils literal"><span class="pre">ImageDataDiff</span></tt></a> objects. Though the “dimension” of each array is just an integer representing the number of bytes in the data.</li> <li><tt class="xref py py-obj docutils literal"><span class="pre">diff_bytes</span></tt>: Like the <tt class="xref py py-obj docutils literal"><span class="pre">diff_pixels</span></tt> attribute of <a class="reference internal" href="#astropy.io.fits.ImageDataDiff" title="astropy.io.fits.ImageDataDiff"><tt class="xref py py-obj docutils literal"><span class="pre">ImageDataDiff</span></tt></a> objects, but renamed to reflect the minor semantic difference that these are raw bytes and not pixel values. Also the indices are integers instead of tuples.</li> <li><tt class="xref py py-obj docutils literal"><span class="pre">diff_total</span></tt> and <tt class="xref py py-obj docutils literal"><span class="pre">diff_ratio</span></tt>: Same as <a class="reference internal" href="#astropy.io.fits.ImageDataDiff" title="astropy.io.fits.ImageDataDiff"><tt class="xref py py-obj docutils literal"><span class="pre">ImageDataDiff</span></tt></a>.</li> </ul> <dl class="classmethod"> <dt id="astropy.io.fits.RawDataDiff.fromdiff"> <em class="property">classmethod </em><tt class="descname">fromdiff</tt><big>(</big><em>other</em>, <em>a</em>, <em>b</em><big>)</big><a class="reference external" href="http://github.com/astropy/astropy/tree/v0.2.4/astropy/io/fits.py#L93" title="Push the Edit button on the next page"><span class="edit-on-github viewcode-link"> [edit on github]</span></a><a class="headerlink" href="#astropy.io.fits.RawDataDiff.fromdiff" title="Permalink to this definition">¶</a></dt> <dd><p>Returns a new Diff object of a specfic subclass from an existing diff object, passing on the values for any arguments they share in common (such as ignore_keywords).</p> <p>For example:</p> <div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="n">fd</span> <span class="o">=</span> <span class="n">FITSDiff</span><span class="p">(</span><span class="s">'a.fits'</span><span class="p">,</span> <span class="s">'b.fits'</span><span class="p">,</span> <span class="n">ignore_keywords</span><span class="o">=</span><span class="p">[</span><span class="s">'*'</span><span class="p">])</span> <span class="gp">>>> </span><span class="n">hd</span> <span class="o">=</span> <span class="n">HeaderDiff</span><span class="o">.</span><span class="n">fromdiff</span><span class="p">(</span><span class="n">fd</span><span class="p">,</span> <span class="n">header_a</span><span class="p">,</span> <span class="n">header_b</span><span class="p">)</span> <span class="gp">>>> </span><span class="n">hd</span><span class="o">.</span><span class="n">ignore_keywords</span> <span class="go">['*']</span> </pre></div> </div> </dd></dl> <dl class="attribute"> <dt id="astropy.io.fits.RawDataDiff.identical"> <tt class="descname">identical</tt><a class="headerlink" href="#astropy.io.fits.RawDataDiff.identical" title="Permalink to this definition">¶</a></dt> <dd><p><tt class="xref py py-obj docutils literal"><span class="pre">True</span></tt> if all the <tt class="xref py py-obj docutils literal"><span class="pre">diff_*</span></tt> attributes on this diff instance are empty, implying that no differences were found.</p> <p>Any subclass of <tt class="xref py py-obj docutils literal"><span class="pre">_BaseDiff</span></tt> must have at least one <tt class="xref py py-obj docutils literal"><span class="pre">diff_*</span></tt> attribute, which contains a non-empty value if and only if some difference was found between the two objects being compared.</p> </dd></dl> <dl class="method"> <dt id="astropy.io.fits.RawDataDiff.report"> <tt class="descname">report</tt><big>(</big><em>fileobj=None</em>, <em>indent=0</em><big>)</big><a class="reference external" href="http://github.com/astropy/astropy/tree/v0.2.4/astropy/io/fits.py#L131" title="Push the Edit button on the next page"><span class="edit-on-github viewcode-link"> [edit on github]</span></a><a class="headerlink" href="#astropy.io.fits.RawDataDiff.report" title="Permalink to this definition">¶</a></dt> <dd><p>Generates a text report on the differences (if any) between two objects, and either returns it as a string or writes it to a file-like object.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters :</th><td class="field-body"><p class="first"><strong>fileobj</strong> : file-like object or None (optional)</p> <blockquote> <div><p>If <tt class="xref py py-obj docutils literal"><span class="pre">None</span></tt>, this method returns the report as a string. Otherwise it returns <tt class="xref py py-obj docutils literal"><span class="pre">None</span></tt> and writes the report to the given file-like object (which must have a <tt class="docutils literal"><span class="pre">.write()</span></tt> method at a minimum).</p> </div></blockquote> <p><strong>indent</strong> : int</p> <blockquote> <div><p>The number of 4 space tabs to indent the report.</p> </div></blockquote> </td> </tr> <tr class="field-even field"><th class="field-name">Returns :</th><td class="field-body"><p class="first last"><strong>report</strong> : str or None</p> </td> </tr> </tbody> </table> </dd></dl> </dd></dl> </div> <div class="section" id="tabledatadiff"> <h2><a class="reference internal" href="#astropy.io.fits.TableDataDiff" title="astropy.io.fits.TableDataDiff"><tt class="xref py py-class docutils literal"><span class="pre">TableDataDiff</span></tt></a><a class="headerlink" href="#tabledatadiff" title="Permalink to this headline">¶</a></h2> <dl class="class"> <dt id="astropy.io.fits.TableDataDiff"> <em class="property">class </em><tt class="descclassname">astropy.io.fits.</tt><tt class="descname">TableDataDiff</tt><big>(</big><em>a</em>, <em>b</em>, <em>ignore_fields=</em><span class="optional">[</span><span class="optional">]</span>, <em>numdiffs=10</em>, <em>tolerance=0.0</em><big>)</big><a class="reference external" href="http://github.com/astropy/astropy/tree/v0.2.4/astropy/io/fits.py#L893" title="Push the Edit button on the next page"><span class="edit-on-github viewcode-link"> [edit on github]</span></a><a class="headerlink" href="#astropy.io.fits.TableDataDiff" title="Permalink to this definition">¶</a></dt> <dd><p>Bases: <tt class="xref py py-class docutils literal"><span class="pre">astropy.io.fits.diff._BaseDiff</span></tt></p> <p>Diff two table data arrays. It doesn’t matter whether the data originally came from a binary or ASCII table–the data should be passed in as a recarray.</p> <p><a class="reference internal" href="#astropy.io.fits.TableDataDiff" title="astropy.io.fits.TableDataDiff"><tt class="xref py py-obj docutils literal"><span class="pre">TableDataDiff</span></tt></a> objects have the following diff attributes:</p> <ul> <li><p class="first"><tt class="xref py py-obj docutils literal"><span class="pre">diff_column_count</span></tt>: If the tables being compared have different numbers of columns, this contains a 2-tuple of the column count in each table. Even if the tables have different column counts, an attempt is still made to compare any columns they have in common.</p> </li> <li><p class="first"><tt class="xref py py-obj docutils literal"><span class="pre">diff_columns</span></tt>: If either table contains columns unique to that table, either in name or format, this contains a 2-tuple of lists. The first element is a list of columns (these are full <a class="reference internal" href="tables.html#astropy.io.fits.Column" title="astropy.io.fits.Column"><tt class="xref py py-obj docutils literal"><span class="pre">Column</span></tt></a> objects) that appear only in table a. The second element is a list of tables that appear only in table b. This only lists columns with different column definitions, and has nothing to do with the data in those columns.</p> </li> <li><p class="first"><tt class="xref py py-obj docutils literal"><span class="pre">diff_column_names</span></tt>: This is like <tt class="xref py py-obj docutils literal"><span class="pre">diff_columns</span></tt>, but lists only the names of columns unique to either table, rather than the full <a class="reference internal" href="tables.html#astropy.io.fits.Column" title="astropy.io.fits.Column"><tt class="xref py py-obj docutils literal"><span class="pre">Column</span></tt></a> objects.</p> </li> <li><p class="first"><tt class="xref py py-obj docutils literal"><span class="pre">diff_column_attributes</span></tt>: Lists columns that are in both tables but have different secondard attributes, such as TUNIT or TDISP. The format is a list of 2-tuples: The first a tuple of the column name and the attribute, the second a tuple of the different values.</p> </li> <li><p class="first"><tt class="xref py py-obj docutils literal"><span class="pre">diff_values</span></tt>: <a class="reference internal" href="#astropy.io.fits.TableDataDiff" title="astropy.io.fits.TableDataDiff"><tt class="xref py py-obj docutils literal"><span class="pre">TableDataDiff</span></tt></a> compares the data in each table on a column-by-column basis. If any different data is found, it is added to this list. The format of this list is similar to the <tt class="xref py py-obj docutils literal"><span class="pre">diff_pixels</span></tt> attribute on <a class="reference internal" href="#astropy.io.fits.ImageDataDiff" title="astropy.io.fits.ImageDataDiff"><tt class="xref py py-obj docutils literal"><span class="pre">ImageDataDiff</span></tt></a> objects, though the “index” consists of a (column_name, row) tuple. For example:</p> <div class="highlight-python"><div class="highlight"><pre><span class="p">[(</span><span class="s">'TARGET'</span><span class="p">,</span> <span class="mi">0</span><span class="p">),</span> <span class="p">(</span><span class="s">'NGC1001'</span><span class="p">,</span> <span class="s">'NGC1002'</span><span class="p">)]</span> </pre></div> </div> <p>shows that the tables contain different values in the 0-th row of the ‘TARGET’ column.</p> </li> <li><p class="first"><tt class="xref py py-obj docutils literal"><span class="pre">diff_total</span></tt> and <tt class="xref py py-obj docutils literal"><span class="pre">diff_ratio</span></tt>: Same as <a class="reference internal" href="#astropy.io.fits.ImageDataDiff" title="astropy.io.fits.ImageDataDiff"><tt class="xref py py-obj docutils literal"><span class="pre">ImageDataDiff</span></tt></a>.</p> </li> </ul> <p><a class="reference internal" href="#astropy.io.fits.TableDataDiff" title="astropy.io.fits.TableDataDiff"><tt class="xref py py-obj docutils literal"><span class="pre">TableDataDiff</span></tt></a> objects also have a <tt class="xref py py-obj docutils literal"><span class="pre">common_columns</span></tt> attribute that lists the <a class="reference internal" href="tables.html#astropy.io.fits.Column" title="astropy.io.fits.Column"><tt class="xref py py-obj docutils literal"><span class="pre">Column</span></tt></a> objects for columns that are identical in both tables, and a <tt class="xref py py-obj docutils literal"><span class="pre">common_column_names</span></tt> attribute which contains a set of the names of those columns.</p> <dl class="classmethod"> <dt id="astropy.io.fits.TableDataDiff.fromdiff"> <em class="property">classmethod </em><tt class="descname">fromdiff</tt><big>(</big><em>other</em>, <em>a</em>, <em>b</em><big>)</big><a class="reference external" href="http://github.com/astropy/astropy/tree/v0.2.4/astropy/io/fits.py#L93" title="Push the Edit button on the next page"><span class="edit-on-github viewcode-link"> [edit on github]</span></a><a class="headerlink" href="#astropy.io.fits.TableDataDiff.fromdiff" title="Permalink to this definition">¶</a></dt> <dd><p>Returns a new Diff object of a specfic subclass from an existing diff object, passing on the values for any arguments they share in common (such as ignore_keywords).</p> <p>For example:</p> <div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="n">fd</span> <span class="o">=</span> <span class="n">FITSDiff</span><span class="p">(</span><span class="s">'a.fits'</span><span class="p">,</span> <span class="s">'b.fits'</span><span class="p">,</span> <span class="n">ignore_keywords</span><span class="o">=</span><span class="p">[</span><span class="s">'*'</span><span class="p">])</span> <span class="gp">>>> </span><span class="n">hd</span> <span class="o">=</span> <span class="n">HeaderDiff</span><span class="o">.</span><span class="n">fromdiff</span><span class="p">(</span><span class="n">fd</span><span class="p">,</span> <span class="n">header_a</span><span class="p">,</span> <span class="n">header_b</span><span class="p">)</span> <span class="gp">>>> </span><span class="n">hd</span><span class="o">.</span><span class="n">ignore_keywords</span> <span class="go">['*']</span> </pre></div> </div> </dd></dl> <dl class="attribute"> <dt id="astropy.io.fits.TableDataDiff.identical"> <tt class="descname">identical</tt><a class="headerlink" href="#astropy.io.fits.TableDataDiff.identical" title="Permalink to this definition">¶</a></dt> <dd><p><tt class="xref py py-obj docutils literal"><span class="pre">True</span></tt> if all the <tt class="xref py py-obj docutils literal"><span class="pre">diff_*</span></tt> attributes on this diff instance are empty, implying that no differences were found.</p> <p>Any subclass of <tt class="xref py py-obj docutils literal"><span class="pre">_BaseDiff</span></tt> must have at least one <tt class="xref py py-obj docutils literal"><span class="pre">diff_*</span></tt> attribute, which contains a non-empty value if and only if some difference was found between the two objects being compared.</p> </dd></dl> <dl class="method"> <dt id="astropy.io.fits.TableDataDiff.report"> <tt class="descname">report</tt><big>(</big><em>fileobj=None</em>, <em>indent=0</em><big>)</big><a class="reference external" href="http://github.com/astropy/astropy/tree/v0.2.4/astropy/io/fits.py#L131" title="Push the Edit button on the next page"><span class="edit-on-github viewcode-link"> [edit on github]</span></a><a class="headerlink" href="#astropy.io.fits.TableDataDiff.report" title="Permalink to this definition">¶</a></dt> <dd><p>Generates a text report on the differences (if any) between two objects, and either returns it as a string or writes it to a file-like object.</p> <table class="docutils field-list" frame="void" rules="none"> <col class="field-name" /> <col class="field-body" /> <tbody valign="top"> <tr class="field-odd field"><th class="field-name">Parameters :</th><td class="field-body"><p class="first"><strong>fileobj</strong> : file-like object or None (optional)</p> <blockquote> <div><p>If <tt class="xref py py-obj docutils literal"><span class="pre">None</span></tt>, this method returns the report as a string. Otherwise it returns <tt class="xref py py-obj docutils literal"><span class="pre">None</span></tt> and writes the report to the given file-like object (which must have a <tt class="docutils literal"><span class="pre">.write()</span></tt> method at a minimum).</p> </div></blockquote> <p><strong>indent</strong> : int</p> <blockquote> <div><p>The number of 4 space tabs to indent the report.</p> </div></blockquote> </td> </tr> <tr class="field-even field"><th class="field-name">Returns :</th><td class="field-body"><p class="first last"><strong>report</strong> : str or None</p> </td> </tr> </tbody> </table> </dd></dl> </dd></dl> </div> </div> </div> </div> </div> <div class="sphinxsidebar"> <div class="sphinxsidebarwrapper"><h3>Page Contents</h3> <ul> <li><a class="reference internal" href="#">Differs</a><ul> <li><a class="reference internal" href="#fitsdiff"><tt class="docutils literal"><span class="pre">FITSDiff</span></tt></a></li> <li><a class="reference internal" href="#hdudiff"><tt class="docutils literal"><span class="pre">HDUDiff</span></tt></a></li> <li><a class="reference internal" href="#headerdiff"><tt class="docutils literal"><span class="pre">HeaderDiff</span></tt></a></li> <li><a class="reference internal" href="#imagedatadiff"><tt class="docutils literal"><span class="pre">ImageDataDiff</span></tt></a></li> <li><a class="reference internal" href="#rawdatadiff"><tt class="docutils literal"><span class="pre">RawDataDiff</span></tt></a></li> <li><a class="reference internal" href="#tabledatadiff"><tt class="docutils literal"><span class="pre">TableDataDiff</span></tt></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/api/diff.rst">Edit This Page on Github</a> <a href="../../../_sources/io/fits/api/diff.txt" rel="nofollow">Page Source</a> <a href="#">Back to Top</a></p> <p> © Copyright 2011-2013, The Astropy Developers.<br/> Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3. Last built 22 Oct 2013. <br/> </p> </footer> </body> </html>