1 |
|
---|
2 |
|
---|
3 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
---|
4 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
---|
5 |
|
---|
6 | <html xmlns="http://www.w3.org/1999/xhtml">
|
---|
7 | <head>
|
---|
8 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
---|
9 |
|
---|
10 | <title>Getting Started — pyfact v0.1 documentation</title>
|
---|
11 | <link rel="stylesheet" href="_static/default.css" type="text/css" />
|
---|
12 | <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
---|
13 | <script type="text/javascript">
|
---|
14 | var DOCUMENTATION_OPTIONS = {
|
---|
15 | URL_ROOT: '',
|
---|
16 | VERSION: '0.1',
|
---|
17 | COLLAPSE_INDEX: false,
|
---|
18 | FILE_SUFFIX: '.html',
|
---|
19 | HAS_SOURCE: true
|
---|
20 | };
|
---|
21 | </script>
|
---|
22 | <script type="text/javascript" src="_static/jquery.js"></script>
|
---|
23 | <script type="text/javascript" src="_static/underscore.js"></script>
|
---|
24 | <script type="text/javascript" src="_static/doctools.js"></script>
|
---|
25 | <link rel="top" title="pyfact v0.1 documentation" href="index.html" />
|
---|
26 | <link rel="next" title="Classes" href="classes.html" />
|
---|
27 | <link rel="prev" title="Introduction" href="introduction.html" />
|
---|
28 | </head>
|
---|
29 | <body>
|
---|
30 | <div class="related">
|
---|
31 | <h3>Navigation</h3>
|
---|
32 | <ul>
|
---|
33 | <li class="right" style="margin-right: 10px">
|
---|
34 | <a href="genindex.html" title="General Index"
|
---|
35 | accesskey="I">index</a></li>
|
---|
36 | <li class="right" >
|
---|
37 | <a href="classes.html" title="Classes"
|
---|
38 | accesskey="N">next</a> |</li>
|
---|
39 | <li class="right" >
|
---|
40 | <a href="introduction.html" title="Introduction"
|
---|
41 | accesskey="P">previous</a> |</li>
|
---|
42 | <li><a href="index.html">pyfact v0.1 documentation</a> »</li>
|
---|
43 | </ul>
|
---|
44 | </div>
|
---|
45 |
|
---|
46 | <div class="document">
|
---|
47 | <div class="documentwrapper">
|
---|
48 | <div class="bodywrapper">
|
---|
49 | <div class="body">
|
---|
50 |
|
---|
51 | <div class="section" id="getting-started">
|
---|
52 | <h1>Getting Started<a class="headerlink" href="#getting-started" title="Permalink to this headline">¶</a></h1>
|
---|
53 | <ol class="arabic simple">
|
---|
54 | <li>Get an account at the FACT data center at ISDC</li>
|
---|
55 | <li>Setup your environment variables</li>
|
---|
56 | <li>Checkout the pyfact software repository</li>
|
---|
57 | <li>Try a few examples</li>
|
---|
58 | </ol>
|
---|
59 | <div class="section" id="important-links">
|
---|
60 | <h2>1. Important links<a class="headerlink" href="#important-links" title="Permalink to this headline">¶</a></h2>
|
---|
61 | <dl class="docutils">
|
---|
62 | <dt><strong>FACT data center at ISDC</strong> <<a class="reference external" href="http://www.isdc.unige.ch/fact/datacenter">http://www.isdc.unige.ch/fact/datacenter</a>>**</dt>
|
---|
63 | <dd>here you find instructions how to get an account, how to set it up and how to use it</dd>
|
---|
64 | <dt><strong>SVN repository</strong> <<a class="reference external" href="https://fact.isdc.unige.ch/svn/fact/">https://fact.isdc.unige.ch/svn/fact/</a>></dt>
|
---|
65 | <dd>hosts all FACT software (including pyfact)</dd>
|
---|
66 | <dt><strong>FACT run database</strong> <<a class="reference external" href="https://www.fact-project.org/run_db/db/fact_runinfo.php">https://www.fact-project.org/run_db/db/fact_runinfo.php</a>></dt>
|
---|
67 | <dd>here you find information about all available runs</dd>
|
---|
68 | <dt><strong>eLogbook</strong> <<a class="reference external" href="https://www.fact-project.org/logbook/">https://www.fact-project.org/logbook/</a>></dt>
|
---|
69 | <dd>telescope logbook used since Dec. 1, 2012; for logbook information before this date have a look here: <<a class="reference external" href="http://fact.ethz.ch/FACTelog/index.jsp">http://fact.ethz.ch/FACTelog/index.jsp</a>></dd>
|
---|
70 | <dt><strong>FACT La Palma pages</strong> <<a class="reference external" href="https://www.fact-project.org/">https://www.fact-project.org/</a>></dt>
|
---|
71 | <dd>plenty of information concerning the telescope in La Palma</dd>
|
---|
72 | </dl>
|
---|
73 | </div>
|
---|
74 | <div class="section" id="environment-variables">
|
---|
75 | <h2>2. Environment variables<a class="headerlink" href="#environment-variables" title="Permalink to this headline">¶</a></h2>
|
---|
76 | <p>set the following env variables depending on the SHELL you are using, for instance in .bashrc or .tcshrc</p>
|
---|
77 | <ul>
|
---|
78 | <li><p class="first"><strong>ROOTSYS</strong>: /swdev_nfs/root_v5.28.00</p>
|
---|
79 | </li>
|
---|
80 | <li><p class="first"><strong>PATH</strong>: add $ROOTSYS/bin</p>
|
---|
81 | </li>
|
---|
82 | <li><p class="first"><strong>PATH</strong>: add /swdev_nfs/FACT++</p>
|
---|
83 | </li>
|
---|
84 | <li><p class="first"><strong>LD_LIBRARY_PATH</strong>: $ROOTSYS/lib:/swdev_nfs/FACT++/.libs</p>
|
---|
85 | </li>
|
---|
86 | <li><p class="first"><strong>PYTHONPATH</strong>: $ROOTSYS/lib</p>
|
---|
87 | </li>
|
---|
88 | <li><dl class="first docutils">
|
---|
89 | <dt><strong>PYTHONPATH</strong>: add all directories where python should search for modules. At least:</dt>
|
---|
90 | <dd><ul class="first last simple">
|
---|
91 | <li>pyscripts/pyfact</li>
|
---|
92 | <li>pyscript/tools</li>
|
---|
93 | <li>pyscripts/ecamples</li>
|
---|
94 | <li>py</li>
|
---|
95 | </ul>
|
---|
96 | </dd>
|
---|
97 | </dl>
|
---|
98 | </li>
|
---|
99 | </ul>
|
---|
100 | <p>the absolute path depends on where you have checked (or will check) out the pyscripts repository</p>
|
---|
101 | </div>
|
---|
102 | <div class="section" id="check-out-the-repository">
|
---|
103 | <h2>3. Check out the repository<a class="headerlink" href="#check-out-the-repository" title="Permalink to this headline">¶</a></h2>
|
---|
104 | <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 | </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>
|
---|
112 | <p>simple:</p>
|
---|
113 | <div class="highlight-python"><pre>[pceth118] /home/luster/py > root
|
---|
114 | ROOT 5.28/00h (branches/v5-28-00-patches@42209, Feb 13 2012, 23:52:00 on linux)
|
---|
115 | CINT/ROOT C/C++ Interpreter version 5.18.00, July 2, 2010
|
---|
116 | Type ? for help. Commands must be C++ statements.
|
---|
117 | Enclose multiple statements between { }.
|
---|
118 | root [0] .L fits.h++
|
---|
119 | Info in <TUnixSystem::ACLiC>: creating shared library /home/luster/py/./fits_h.so
|
---|
120 | root [1]</pre>
|
---|
121 | </div>
|
---|
122 | </div>
|
---|
123 | <div class="section" id="run-examples">
|
---|
124 | <h2>5. Run examples<a class="headerlink" href="#run-examples" title="Permalink to this headline">¶</a></h2>
|
---|
125 | </div>
|
---|
126 | </div>
|
---|
127 | <div class="section" id="classes">
|
---|
128 | <h1>Classes<a class="headerlink" href="#classes" title="Permalink to this headline">¶</a></h1>
|
---|
129 | <div class="section" id="pyfact-py">
|
---|
130 | <h2>pyfact.py<a class="headerlink" href="#pyfact-py" title="Permalink to this headline">¶</a></h2>
|
---|
131 | <div class="section" id="rawdata-access">
|
---|
132 | <h3>rawdata access<a class="headerlink" href="#rawdata-access" title="Permalink to this headline">¶</a></h3>
|
---|
133 | <dl class="class">
|
---|
134 | <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 0xa818844></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 | <dd><p>raw data access and calibration</p>
|
---|
137 | <ul class="simple">
|
---|
138 | <li>open raw data file and drs calibration file</li>
|
---|
139 | <li>performs amplitude calibration</li>
|
---|
140 | <li>performs baseline substraction if wanted</li>
|
---|
141 | <li>provides all data in an array:
|
---|
142 | row = number of pixel
|
---|
143 | col = length of region of interest</li>
|
---|
144 | </ul>
|
---|
145 | <p>initialize object</p>
|
---|
146 | <p>open data file and calibration data file
|
---|
147 | get basic information about the data in data_file_name
|
---|
148 | allocate buffers for data access</p>
|
---|
149 | <p>data_file_name : fits or fits.gz file of the data including the path
|
---|
150 | calib_file_name : fits or fits.gz file containing DRS calibration data
|
---|
151 | baseline_file_name : npy file containing the baseline values</p>
|
---|
152 | <dl class="method">
|
---|
153 | <dt id="pyfact.RawData.baseline_correct">
|
---|
154 | <tt class="descname">baseline_correct</tt><big>(</big><big>)</big><a class="headerlink" href="#pyfact.RawData.baseline_correct" title="Permalink to this definition">¶</a></dt>
|
---|
155 | <dd><p>subtract baseline from the data</p>
|
---|
156 | </dd></dl>
|
---|
157 |
|
---|
158 | <dl class="method">
|
---|
159 | <dt id="pyfact.RawData.baseline_read_values">
|
---|
160 | <tt class="descname">baseline_read_values</tt><big>(</big><em>file</em>, <em>bsl_hist='bsl_sum/hplt_mean'</em><big>)</big><a class="headerlink" href="#pyfact.RawData.baseline_read_values" title="Permalink to this definition">¶</a></dt>
|
---|
161 | <dd><p>open ROOT file with baseline histogram and read baseline values
|
---|
162 | file name of the root file
|
---|
163 | bsl_hist path to the histogram containing the basline values</p>
|
---|
164 | </dd></dl>
|
---|
165 |
|
---|
166 | <dl class="attribute">
|
---|
167 | <dt id="pyfact.RawData.board_times">
|
---|
168 | <tt class="descname">board_times</tt><a class="headerlink" href="#pyfact.RawData.board_times" title="Permalink to this definition">¶</a></dt>
|
---|
169 | <dd><p>time when the FAD was triggered, in some strange units...</p>
|
---|
170 | </dd></dl>
|
---|
171 |
|
---|
172 | <dl class="attribute">
|
---|
173 | <dt id="pyfact.RawData.calib_file">
|
---|
174 | <tt class="descname">calib_file</tt><a class="headerlink" href="#pyfact.RawData.calib_file" title="Permalink to this definition">¶</a></dt>
|
---|
175 | <dd><p>drs calibration file</p>
|
---|
176 | </dd></dl>
|
---|
177 |
|
---|
178 | <dl class="method">
|
---|
179 | <dt id="pyfact.RawData.calibrate_drs_amplitude">
|
---|
180 | <tt class="descname">calibrate_drs_amplitude</tt><big>(</big><big>)</big><a class="headerlink" href="#pyfact.RawData.calibrate_drs_amplitude" title="Permalink to this definition">¶</a></dt>
|
---|
181 | <dd><p>perform the drs amplitude calibration of the event data</p>
|
---|
182 | </dd></dl>
|
---|
183 |
|
---|
184 | <dl class="attribute">
|
---|
185 | <dt id="pyfact.RawData.data">
|
---|
186 | <tt class="descname">data</tt><a class="headerlink" href="#pyfact.RawData.data" title="Permalink to this definition">¶</a></dt>
|
---|
187 | <dd><p>1D array with raw data</p>
|
---|
188 | </dd></dl>
|
---|
189 |
|
---|
190 | <dl class="attribute">
|
---|
191 | <dt id="pyfact.RawData.data_file">
|
---|
192 | <tt class="descname">data_file</tt><a class="headerlink" href="#pyfact.RawData.data_file" title="Permalink to this definition">¶</a></dt>
|
---|
193 | <dd><p>data file (fits object)</p>
|
---|
194 | </dd></dl>
|
---|
195 |
|
---|
196 | <dl class="method">
|
---|
197 | <dt id="pyfact.RawData.info">
|
---|
198 | <tt class="descname">info</tt><big>(</big><big>)</big><a class="headerlink" href="#pyfact.RawData.info" title="Permalink to this definition">¶</a></dt>
|
---|
199 | <dd><p>print run information</p>
|
---|
200 | </dd></dl>
|
---|
201 |
|
---|
202 | <dl class="attribute">
|
---|
203 | <dt id="pyfact.RawData.nevents">
|
---|
204 | <tt class="descname">nevents</tt><a class="headerlink" href="#pyfact.RawData.nevents" title="Permalink to this definition">¶</a></dt>
|
---|
205 | <dd><p>number of events in the data run</p>
|
---|
206 | </dd></dl>
|
---|
207 |
|
---|
208 | <dl class="method">
|
---|
209 | <dt id="pyfact.RawData.next">
|
---|
210 | <tt class="descname">next</tt><big>(</big><big>)</big><a class="headerlink" href="#pyfact.RawData.next" title="Permalink to this definition">¶</a></dt>
|
---|
211 | <dd><p>used by __iter__</p>
|
---|
212 | </dd></dl>
|
---|
213 |
|
---|
214 | <dl class="method">
|
---|
215 | <dt id="pyfact.RawData.next_event">
|
---|
216 | <tt class="descname">next_event</tt><big>(</big><big>)</big><a class="headerlink" href="#pyfact.RawData.next_event" title="Permalink to this definition">¶</a></dt>
|
---|
217 | <dd><p>load the next event from disk and calibrate it</p>
|
---|
218 | </dd></dl>
|
---|
219 |
|
---|
220 | <dl class="attribute">
|
---|
221 | <dt id="pyfact.RawData.npix">
|
---|
222 | <tt class="descname">npix</tt><a class="headerlink" href="#pyfact.RawData.npix" title="Permalink to this definition">¶</a></dt>
|
---|
223 | <dd><p>number of pixels (should be 1440)</p>
|
---|
224 | </dd></dl>
|
---|
225 |
|
---|
226 | <dl class="attribute">
|
---|
227 | <dt id="pyfact.RawData.nroi">
|
---|
228 | <tt class="descname">nroi</tt><a class="headerlink" href="#pyfact.RawData.nroi" title="Permalink to this definition">¶</a></dt>
|
---|
229 | <dd><p>region of interest (number of DRS slices read)</p>
|
---|
230 | </dd></dl>
|
---|
231 |
|
---|
232 | <dl class="attribute">
|
---|
233 | <dt id="pyfact.RawData.start_cells">
|
---|
234 | <tt class="descname">start_cells</tt><a class="headerlink" href="#pyfact.RawData.start_cells" title="Permalink to this definition">¶</a></dt>
|
---|
235 | <dd><p>slice where drs readout started</p>
|
---|
236 | </dd></dl>
|
---|
237 |
|
---|
238 | </dd></dl>
|
---|
239 |
|
---|
240 | </div>
|
---|
241 | <div class="section" id="fnames-of-a-data-run">
|
---|
242 | <h3>fnames of a data run<a class="headerlink" href="#fnames-of-a-data-run" title="Permalink to this headline">¶</a></h3>
|
---|
243 | <dl class="class">
|
---|
244 | <dt id="pyfact.fnames">
|
---|
245 | <em class="property">class </em><tt class="descclassname">pyfact.</tt><tt class="descname">fnames</tt><big>(</big><em>specifier=['012', '023', '2011', '11', '24'], rpath='/scratch_nfs/res/bsl/', zipped=True</em><big>)</big><a class="headerlink" href="#pyfact.fnames" title="Permalink to this definition">¶</a></dt>
|
---|
246 | <dd><p>organize file names of a FACT data run</p>
|
---|
247 | <dl class="docutils">
|
---|
248 | <dt>specifier <span class="classifier-delimiter">:</span> <span class="classifier">list of strings defined as:</span></dt>
|
---|
249 | <dd>[ ‘DRS calibration file’, ‘Data file’, ‘YYYY’, ‘MM’, ‘DD’]</dd>
|
---|
250 | </dl>
|
---|
251 | <p>rpath : directory path for the results; YYYYMMDD will be appended to rpath
|
---|
252 | zipped : use zipped (True) or unzipped (Data)</p>
|
---|
253 | <dl class="method">
|
---|
254 | <dt id="pyfact.fnames.info">
|
---|
255 | <tt class="descname">info</tt><big>(</big><big>)</big><a class="headerlink" href="#pyfact.fnames.info" title="Permalink to this definition">¶</a></dt>
|
---|
256 | <dd><p>print complete filenames</p>
|
---|
257 | </dd></dl>
|
---|
258 |
|
---|
259 | <dl class="method">
|
---|
260 | <dt id="pyfact.fnames.make">
|
---|
261 | <tt class="descname">make</tt><big>(</big><em>specifier</em>, <em>rpath</em>, <em>zipped</em><big>)</big><a class="headerlink" href="#pyfact.fnames.make" title="Permalink to this definition">¶</a></dt>
|
---|
262 | <dd><p>create (make) the filenames</p>
|
---|
263 | <p>names : dictionary of filenames, tags { ‘data’, ‘drscal’, ‘results’ }
|
---|
264 | data : name of the data file
|
---|
265 | drscal : name of the drs calibration file
|
---|
266 | results : radikal of file name(s) for results (to be completed by suffixes)</p>
|
---|
267 | </dd></dl>
|
---|
268 |
|
---|
269 | </dd></dl>
|
---|
270 |
|
---|
271 | </div>
|
---|
272 | </div>
|
---|
273 | </div>
|
---|
274 |
|
---|
275 |
|
---|
276 | </div>
|
---|
277 | </div>
|
---|
278 | </div>
|
---|
279 | <div class="sphinxsidebar">
|
---|
280 | <div class="sphinxsidebarwrapper">
|
---|
281 | <h3><a href="index.html">Table Of Contents</a></h3>
|
---|
282 | <ul>
|
---|
283 | <li><a class="reference internal" href="#">Getting Started</a><ul>
|
---|
284 | <li><a class="reference internal" href="#important-links">1. Important links</a></li>
|
---|
285 | <li><a class="reference internal" href="#environment-variables">2. Environment variables</a></li>
|
---|
286 | <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>
|
---|
288 | <li><a class="reference internal" href="#run-examples">5. Run examples</a></li>
|
---|
289 | </ul>
|
---|
290 | </li>
|
---|
291 | <li><a class="reference internal" href="#classes">Classes</a><ul>
|
---|
292 | <li><a class="reference internal" href="#pyfact-py">pyfact.py</a><ul>
|
---|
293 | <li><a class="reference internal" href="#rawdata-access">rawdata access</a></li>
|
---|
294 | <li><a class="reference internal" href="#fnames-of-a-data-run">fnames of a data run</a></li>
|
---|
295 | </ul>
|
---|
296 | </li>
|
---|
297 | </ul>
|
---|
298 | </li>
|
---|
299 | </ul>
|
---|
300 |
|
---|
301 | <h4>Previous topic</h4>
|
---|
302 | <p class="topless"><a href="introduction.html"
|
---|
303 | title="previous chapter">Introduction</a></p>
|
---|
304 | <h4>Next topic</h4>
|
---|
305 | <p class="topless"><a href="classes.html"
|
---|
306 | title="next chapter">Classes</a></p>
|
---|
307 | <h3>This Page</h3>
|
---|
308 | <ul class="this-page-menu">
|
---|
309 | <li><a href="_sources/getting_started.txt"
|
---|
310 | rel="nofollow">Show Source</a></li>
|
---|
311 | </ul>
|
---|
312 | <div id="searchbox" style="display: none">
|
---|
313 | <h3>Quick search</h3>
|
---|
314 | <form class="search" action="search.html" method="get">
|
---|
315 | <input type="text" name="q" size="18" />
|
---|
316 | <input type="submit" value="Go" />
|
---|
317 | <input type="hidden" name="check_keywords" value="yes" />
|
---|
318 | <input type="hidden" name="area" value="default" />
|
---|
319 | </form>
|
---|
320 | <p class="searchtip" style="font-size: 90%">
|
---|
321 | Enter search terms or a module, class or function name.
|
---|
322 | </p>
|
---|
323 | </div>
|
---|
324 | <script type="text/javascript">$('#searchbox').show(0);</script>
|
---|
325 | </div>
|
---|
326 | </div>
|
---|
327 | <div class="clearer"></div>
|
---|
328 | </div>
|
---|
329 | <div class="related">
|
---|
330 | <h3>Navigation</h3>
|
---|
331 | <ul>
|
---|
332 | <li class="right" style="margin-right: 10px">
|
---|
333 | <a href="genindex.html" title="General Index"
|
---|
334 | >index</a></li>
|
---|
335 | <li class="right" >
|
---|
336 | <a href="classes.html" title="Classes"
|
---|
337 | >next</a> |</li>
|
---|
338 | <li class="right" >
|
---|
339 | <a href="introduction.html" title="Introduction"
|
---|
340 | >previous</a> |</li>
|
---|
341 | <li><a href="index.html">pyfact v0.1 documentation</a> »</li>
|
---|
342 | </ul>
|
---|
343 | </div>
|
---|
344 | <div class="footer">
|
---|
345 | © Copyright 2012, Werner Lustermann.
|
---|
346 | Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.4.
|
---|
347 | </div>
|
---|
348 | </body>
|
---|
349 | </html> |
---|