- Timestamp:
- 04/05/12 17:32:54 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/pyscripts/doc/_build/html/getting_started.html
r13316 r13324 92 92 <li>pyscript/tools</li> 93 93 <li>pyscripts/ecamples</li> 94 <li>py</li>95 94 </ul> 96 95 </dd> … … 104 103 <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> 105 104 </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 <http://www.stsci.edu/institute/software_hardware/pyfits></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></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 <http://www.stsci.edu/institute/software_hardware/pyfits></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> 112 112 <p>simple:</p> 113 <div class="highlight-python"><pre>[ pceth118] /home/luster/py >root114 ROOT 5.28/00 h (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 114 ROOT 5.28/00 (trunk@37585, Dec 14 2010, 15:20:27 on linuxx8664gcc) 115 115 CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010 116 116 Type ? for help. Commands must be C++ statements. 117 117 Enclose multiple statements between { }. 118 118 119 root [0] .L fits.h++ 119 Info in <TUnixSystem::ACLiC>: creating shared library /home /luster/py/./fits_h.so120 Info in <TUnixSystem::ACLiC>: creating shared library /home_nfs/isdc/lusterma/pyscripts/pyfact/./fits_h.so 120 121 root [1]</pre> 121 122 </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> 122 131 </div> 123 132 <div class="section" id="run-examples"> … … 133 142 <dl class="class"> 134 143 <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=<function <lambda> at 0xa 818844></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=<function <lambda> at 0xab028b4></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> 136 145 <dd><p>raw data access and calibration</p> 137 146 <ul class="simple"> … … 269 278 </dd></dl> 270 279 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> 271 287 </div> 272 288 </div> … … 285 301 <li><a class="reference internal" href="#environment-variables">2. Environment variables</a></li> 286 302 <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 pyfitslibrary</a></li>303 <li><a class="reference internal" href="#create-pyfits-h-so-library">4. Create pyfits_h.so library</a></li> 288 304 <li><a class="reference internal" href="#run-examples">5. Run examples</a></li> 289 305 </ul>
Note:
See TracChangeset
for help on using the changeset viewer.