Ignore:
Timestamp:
04/05/12 17:32:54 (13 years ago)
Author:
lusterma
Message:
updated
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fact/tools/pyscripts/doc/_build/html/getting_started.html

    r13316 r13324  
    9292<li>pyscript/tools</li>
    9393<li>pyscripts/ecamples</li>
    94 <li>py</li>
    9594</ul>
    9695</dd>
     
    104103<p>svn co <a class="reference external" href="https://fact.isdc.unige.ch/svn/fact/tools/pyscripts/">https://fact.isdc.unige.ch/svn/fact/tools/pyscripts/</a></p>
    105104</div>
    106 <div class="section" id="create-pyfits-library">
    107 <h2>4. Create pyfits library<a class="headerlink" href="#create-pyfits-library" title="Permalink to this headline">¶</a></h2>
    108 <p>FACT data are stored in (gzipped) fits files, but the data files are too large to be read by the default tool:</p>
    109 <p><cite>pyfits &lt;http://www.stsci.edu/institute/software_hardware/pyfits&gt;</cite>.</p>
    110 <p>To mitigate this problem a C++ class defined in <cite>fits.h</cite> is used. A simple possibility to create an interface of this C++ class and python is to use the</p>
    111 <p><cite>pyroot http://root.cern.ch/drupal/category/package-context/pyroot&gt;</cite> module.</p>
     105<div class="section" id="create-pyfits-h-so-library">
     106<h2>4. Create pyfits_h.so library<a class="headerlink" href="#create-pyfits-h-so-library" title="Permalink to this headline">¶</a></h2>
     107<p>FACT data are stored in (gzipped) fits files, but the data files are too large to be read by the existing tools:</p>
     108<p><cite>pyfits &lt;http://www.stsci.edu/institute/software_hardware/pyfits&gt;</cite> which uses <a class="reference external" href="http://heasarc.gsfc.nasa.gov/fitsio/">cfitsio</a>.</p>
     109<p>To mitigate this problem a C++ class defined in fits.h <a class="footnote-reference" href="#f1" id="id1">[1]</a> is used. A simple possibility to create an interface of this C++ class is to use ROOT and later to import it using the
     110<a class="reference external" href="http://root.cern.ch/drupal/category/package-context/pyroot">pyroot</a> module.</p>
     111<p>got to the directory: pyscripts/pyfact</p>
    112112<p>simple:</p>
    113 <div class="highlight-python"><pre>[pceth118] /home/luster/py &gt; root
    114 ROOT 5.28/00h (branches/v5-28-00-patches@42209, Feb 13 2012, 23:52:00 on linux)
     113<div class="highlight-python"><pre>[lusterma@isdc-cn02 pyfact]$ root
     114ROOT 5.28/00 (trunk@37585, Dec 14 2010, 15:20:27 on linuxx8664gcc)
    115115CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
    116116Type ? for help. Commands must be C++ statements.
    117117Enclose multiple statements between { }.
     118
    118119root [0] .L fits.h++
    119 Info in &lt;TUnixSystem::ACLiC&gt;: creating shared library /home/luster/py/./fits_h.so
     120Info in &lt;TUnixSystem::ACLiC&gt;: creating shared library /home_nfs/isdc/lusterma/pyscripts/pyfact/./fits_h.so
    120121root [1]</pre>
    121122</div>
     123<p>This might not work for whatenver reason then it should be done like this:</p>
     124<div class="highlight-python"><pre>$rootcint -f my_dict.C -c fits.h izstream.h
     125$g++ -fPIC -c -I$ROOTSYS/include my_dict.C -o my_dict.o
     126$g++ -o fits_h.so -shared my_dict.o</pre>
     127</div>
     128<p>Now you can check if the reading rawdata is working:</p>
     129<p>$ pyfact.py</p>
     130<p>this should print some data from a few events</p>
    122131</div>
    123132<div class="section" id="run-examples">
     
    133142<dl class="class">
    134143<dt id="pyfact.RawData">
    135 <em class="property">class </em><tt class="descclassname">pyfact.</tt><tt class="descname">RawData</tt><big>(</big><em>data_file_name</em>, <em>calib_file_name</em>, <em>user_action_calib=&lt;function &lt;lambda&gt; at 0xa818844&gt;</em>, <em>baseline_file_name=''</em>, <em>return_dict=None</em><big>)</big><a class="headerlink" href="#pyfact.RawData" title="Permalink to this definition">¶</a></dt>
     144<em class="property">class </em><tt class="descclassname">pyfact.</tt><tt class="descname">RawData</tt><big>(</big><em>data_file_name</em>, <em>calib_file_name</em>, <em>user_action_calib=&lt;function &lt;lambda&gt; at 0xab028b4&gt;</em>, <em>baseline_file_name=''</em>, <em>return_dict=None</em><big>)</big><a class="headerlink" href="#pyfact.RawData" title="Permalink to this definition">¶</a></dt>
    136145<dd><p>raw data access and calibration</p>
    137146<ul class="simple">
     
    269278</dd></dl>
    270279
     280<p class="rubric">Footnotes</p>
     281<table class="docutils footnote" frame="void" id="f1" rules="none">
     282<colgroup><col class="label" /><col /></colgroup>
     283<tbody valign="top">
     284<tr><td class="label"><a class="fn-backref" href="#id1">[1]</a></td><td>fits.h (here named pyfits.h) is part of MARS and was written by T.Bretz, it was added to this repository for convienience</td></tr>
     285</tbody>
     286</table>
    271287</div>
    272288</div>
     
    285301<li><a class="reference internal" href="#environment-variables">2. Environment variables</a></li>
    286302<li><a class="reference internal" href="#check-out-the-repository">3. Check out the repository</a></li>
    287 <li><a class="reference internal" href="#create-pyfits-library">4. Create pyfits library</a></li>
     303<li><a class="reference internal" href="#create-pyfits-h-so-library">4. Create pyfits_h.so library</a></li>
    288304<li><a class="reference internal" href="#run-examples">5. Run examples</a></li>
    289305</ul>
Note: See TracChangeset for help on using the changeset viewer.