source: flex_extract.git/for_developers/SphinxDoc/_build/html/code.html @ 25b14be

ctbtodev
Last change on this file since 25b14be was 25b14be, checked in by Anne Philipp <anne.philipp@…>, 6 years ago

changed whole tree structure of flex_extract to have better overview

  • Property mode set to 100644
File size: 18.9 KB
Line 
1
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
5<html xmlns="http://www.w3.org/1999/xhtml">
6  <head>
7    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8    <title>Auto Generated Documentation &#8212; flex_extract_test 7.1 documentation</title>
9    <link rel="stylesheet" href="_static/classic.css" type="text/css" />
10    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
11    <script type="text/javascript">
12      var DOCUMENTATION_OPTIONS = {
13        URL_ROOT:    './',
14        VERSION:     '7.1',
15        COLLAPSE_INDEX: false,
16        FILE_SUFFIX: '.html',
17        HAS_SOURCE:  true,
18        SOURCELINK_SUFFIX: '.txt'
19      };
20    </script>
21    <script type="text/javascript" src="_static/jquery.js"></script>
22    <script type="text/javascript" src="_static/underscore.js"></script>
23    <script type="text/javascript" src="_static/doctools.js"></script>
24    <link rel="index" title="Index" href="genindex.html" />
25    <link rel="search" title="Search" href="search.html" />
26    <link rel="prev" title="Welcome to flex_extract_test’s documentation!" href="index.html" /> 
27  </head>
28  <body>
29    <div class="related" role="navigation" aria-label="related navigation">
30      <h3>Navigation</h3>
31      <ul>
32        <li class="right" style="margin-right: 10px">
33          <a href="genindex.html" title="General Index"
34             accesskey="I">index</a></li>
35        <li class="right" >
36          <a href="py-modindex.html" title="Python Module Index"
37             >modules</a> |</li>
38        <li class="right" >
39          <a href="index.html" title="Welcome to flex_extract_test’s documentation!"
40             accesskey="P">previous</a> |</li>
41        <li class="nav-item nav-item-0"><a href="index.html">flex_extract_test 7.1 documentation</a> &#187;</li> 
42      </ul>
43    </div> 
44
45    <div class="document">
46      <div class="documentwrapper">
47        <div class="bodywrapper">
48          <div class="body" role="main">
49           
50  <div class="section" id="module-Tools">
51<span id="auto-generated-documentation"></span><h1>Auto Generated Documentation<a class="headerlink" href="#module-Tools" title="Permalink to this headline"></a></h1>
52<dl class="function">
53<dt id="Tools.cleanup">
54<code class="descclassname">Tools.</code><code class="descname">cleanup</code><span class="sig-paren">(</span><em>c</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Tools.html#cleanup"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Tools.cleanup" title="Permalink to this definition"></a></dt>
55<dd><dl class="docutils">
56<dt>&#64;Description:</dt>
57<dd>Remove all files from intermediate directory
58(inputdir from control file).</dd>
59<dt>&#64;Input:</dt>
60<dd><dl class="first last docutils">
61<dt>c: instance of class Control</dt>
62<dd><p class="first">Contains all the parameters of control files, which are e.g.:
63DAY1(start_date), DAY2(end_date), DTIME, MAXSTEP, TYPE, TIME,
64STEP, CLASS(marsclass), STREAM, NUMBER, EXPVER, GRID, LEFT,
65LOWER, UPPER, RIGHT, LEVEL, LEVELIST, RESOL, GAUSS, ACCURACY,
66OMEGA, OMEGADIFF, ETA, ETADIFF, DPDETA, SMOOTH, FORMAT,
67ADDPAR, WRF, CWC, PREFIX, ECSTORAGE, ECTRANS, ECFSDIR,
68MAILOPS, MAILFAIL, GRIB2FLEXPART, FLEXPARTDIR, BASETIME
69DATE_CHUNK, DEBUG, INPUTDIR, OUTPUTDIR, FLEXPART_ROOT_SCRIPTS</p>
70<p class="last">For more information about format and content of the parameter
71see documentation.</p>
72</dd>
73</dl>
74</dd>
75<dt>&#64;Return:</dt>
76<dd>&lt;nothing&gt;</dd>
77</dl>
78</dd></dl>
79
80<dl class="function">
81<dt id="Tools.getListAsString">
82<code class="descclassname">Tools.</code><code class="descname">getListAsString</code><span class="sig-paren">(</span><em>listobj</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Tools.html#getListAsString"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Tools.getListAsString" title="Permalink to this definition"></a></dt>
83<dd><p>&#64;Description:</p>
84</dd></dl>
85
86<dl class="function">
87<dt id="Tools.init128">
88<code class="descclassname">Tools.</code><code class="descname">init128</code><span class="sig-paren">(</span><em>fn</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Tools.html#init128"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Tools.init128" title="Permalink to this definition"></a></dt>
89<dd><dl class="docutils">
90<dt>&#64;Description:</dt>
91<dd>Opens and reads the grib file with table 128 information.</dd>
92<dt>&#64;Input:</dt>
93<dd><dl class="first last docutils">
94<dt>fn: string</dt>
95<dd>Path to file of ECMWF grib table number 128.</dd>
96</dl>
97</dd>
98<dt>&#64;Return:</dt>
99<dd><dl class="first last docutils">
100<dt>table128: dictionary</dt>
101<dd>Contains the ECMWF grib table 128 information.
102The key is the parameter number and the value is the
103short name of the parameter.</dd>
104</dl>
105</dd>
106</dl>
107</dd></dl>
108
109<dl class="function">
110<dt id="Tools.interpret_args_and_control">
111<code class="descclassname">Tools.</code><code class="descname">interpret_args_and_control</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="reference internal" href="_modules/Tools.html#interpret_args_and_control"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Tools.interpret_args_and_control" title="Permalink to this definition"></a></dt>
112<dd><dl class="docutils">
113<dt>&#64;Description:</dt>
114<dd>Assigns the command line arguments and reads control file
115content. Apply default values for non mentioned arguments.</dd>
116<dt>&#64;Input:</dt>
117<dd>&lt;nothing&gt;</dd>
118<dt>&#64;Return:</dt>
119<dd><dl class="first last docutils">
120<dt>args: instance of ArgumentParser</dt>
121<dd>Contains the commandline arguments from script/program call.</dd>
122<dt>c: instance of class Control</dt>
123<dd>Contains all necessary information of a control file. The parameters
124are: DAY1, DAY2, DTIME, MAXSTEP, TYPE, TIME, STEP, CLASS, STREAM,
125NUMBER, EXPVER, GRID, LEFT, LOWER, UPPER, RIGHT, LEVEL, LEVELIST,
126RESOL, GAUSS, ACCURACY, OMEGA, OMEGADIFF, ETA, ETADIFF, DPDETA,
127SMOOTH, FORMAT, ADDPAR, WRF, CWC, PREFIX, ECSTORAGE, ECTRANS,
128ECFSDIR, MAILOPS, MAILFAIL, GRIB2FLEXPART, DEBUG, INPUTDIR,
129OUTPUTDIR, FLEXPART_ROOT_SCRIPTS
130For more information about format and content of the parameter see
131documentation.</dd>
132</dl>
133</dd>
134</dl>
135</dd></dl>
136
137<dl class="function">
138<dt id="Tools.myerror">
139<code class="descclassname">Tools.</code><code class="descname">myerror</code><span class="sig-paren">(</span><em>c</em>, <em>message='ERROR'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Tools.html#myerror"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Tools.myerror" title="Permalink to this definition"></a></dt>
140<dd><dl class="docutils">
141<dt>&#64;Description:</dt>
142<dd>Prints a specified error message which can be passed to the function
143before exiting the program.</dd>
144<dt>&#64;Input:</dt>
145<dd><dl class="first last docutils">
146<dt>c: instance of class Control</dt>
147<dd><p class="first">Contains all the parameters of control files, which are e.g.:
148DAY1(start_date), DAY2(end_date), DTIME, MAXSTEP, TYPE, TIME,
149STEP, CLASS(marsclass), STREAM, NUMBER, EXPVER, GRID, LEFT,
150LOWER, UPPER, RIGHT, LEVEL, LEVELIST, RESOL, GAUSS, ACCURACY,
151OMEGA, OMEGADIFF, ETA, ETADIFF, DPDETA, SMOOTH, FORMAT,
152ADDPAR, WRF, CWC, PREFIX, ECSTORAGE, ECTRANS, ECFSDIR,
153MAILOPS, MAILFAIL, GRIB2FLEXPART, FLEXPARTDIR, BASETIME
154DATE_CHUNK, DEBUG, INPUTDIR, OUTPUTDIR, FLEXPART_ROOT_SCRIPTS</p>
155<p class="last">For more information about format and content of the parameter
156see documentation.</p>
157</dd>
158<dt>message: string, optional</dt>
159<dd>Error message. Default value is “ERROR”.</dd>
160</dl>
161</dd>
162<dt>&#64;Return:</dt>
163<dd>&lt;nothing&gt;</dd>
164</dl>
165</dd></dl>
166
167<dl class="function">
168<dt id="Tools.normalexit">
169<code class="descclassname">Tools.</code><code class="descname">normalexit</code><span class="sig-paren">(</span><em>c</em>, <em>message='Done!'</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Tools.html#normalexit"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Tools.normalexit" title="Permalink to this definition"></a></dt>
170<dd><dl class="docutils">
171<dt>&#64;Description:</dt>
172<dd>Prints a specific exit message which can be passed to the function.</dd>
173<dt>&#64;Input:</dt>
174<dd><dl class="first last docutils">
175<dt>c: instance of class Control</dt>
176<dd><p class="first">Contains all the parameters of control files, which are e.g.:
177DAY1(start_date), DAY2(end_date), DTIME, MAXSTEP, TYPE, TIME,
178STEP, CLASS(marsclass), STREAM, NUMBER, EXPVER, GRID, LEFT,
179LOWER, UPPER, RIGHT, LEVEL, LEVELIST, RESOL, GAUSS, ACCURACY,
180OMEGA, OMEGADIFF, ETA, ETADIFF, DPDETA, SMOOTH, FORMAT,
181ADDPAR, WRF, CWC, PREFIX, ECSTORAGE, ECTRANS, ECFSDIR,
182MAILOPS, MAILFAIL, GRIB2FLEXPART, FLEXPARTDIR, BASETIME
183DATE_CHUNK, DEBUG, INPUTDIR, OUTPUTDIR, FLEXPART_ROOT_SCRIPTS</p>
184<p class="last">For more information about format and content of the parameter
185see documentation.</p>
186</dd>
187<dt>message: string, optional</dt>
188<dd>Message for exiting program. Default value is “Done!”.</dd>
189</dl>
190</dd>
191<dt>&#64;Return:</dt>
192<dd>&lt;nothing&gt;</dd>
193</dl>
194</dd></dl>
195
196<dl class="function">
197<dt id="Tools.product">
198<code class="descclassname">Tools.</code><code class="descname">product</code><span class="sig-paren">(</span><em>*args</em>, <em>**kwds</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Tools.html#product"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Tools.product" title="Permalink to this definition"></a></dt>
199<dd><dl class="docutils">
200<dt>&#64;Description:</dt>
201<dd><p class="first">This method is taken from an example at the ECMWF wiki website.
202<a class="reference external" href="https://software.ecmwf.int/wiki/display/GRIB/index.py">https://software.ecmwf.int/wiki/display/GRIB/index.py</a>; 2018-03-16</p>
203<p>This method combines the single characters of the passed arguments
204with each other. So that each character of each argument value
205will be combined with each character of the other arguments as a tuple.</p>
206<p class="last">Example:
207product(‘ABCD’, ‘xy’) –&gt; Ax Ay Bx By Cx Cy Dx Dy
208product(range(2), repeat = 3) –&gt; 000 001 010 011 100 101 110 111</p>
209</dd>
210<dt>&#64;Input:</dt>
211<dd><dl class="first last docutils">
212<dt><a href="#id1"><span class="problematic" id="id2">*</span></a>args: tuple</dt>
213<dd>Positional arguments (arbitrary number).</dd>
214<dt><a href="#id3"><span class="problematic" id="id4">**</span></a>kwds: dictionary</dt>
215<dd>Contains all the keyword arguments from <a href="#id5"><span class="problematic" id="id6">*</span></a>args.</dd>
216</dl>
217</dd>
218<dt>&#64;Return:</dt>
219<dd><dl class="first last docutils">
220<dt>prod: tuple</dt>
221<dd>Return will be done with “yield”. A tuple of combined arguments.
222See example in description above.</dd>
223</dl>
224</dd>
225</dl>
226</dd></dl>
227
228<dl class="function">
229<dt id="Tools.silentremove">
230<code class="descclassname">Tools.</code><code class="descname">silentremove</code><span class="sig-paren">(</span><em>filename</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Tools.html#silentremove"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Tools.silentremove" title="Permalink to this definition"></a></dt>
231<dd><dl class="docutils">
232<dt>&#64;Description:</dt>
233<dd>Removes the file which name is passed to the function if
234it exists. The function does not fail if the file does not
235exist.</dd>
236<dt>&#64;Input:</dt>
237<dd><dl class="first last docutils">
238<dt>filename: string</dt>
239<dd>The name of the file to be removed without notification.</dd>
240</dl>
241</dd>
242<dt>&#64;Return:</dt>
243<dd>&lt;nothing&gt;</dd>
244</dl>
245</dd></dl>
246
247<dl class="function">
248<dt id="Tools.toparamId">
249<code class="descclassname">Tools.</code><code class="descname">toparamId</code><span class="sig-paren">(</span><em>pars</em>, <em>table</em><span class="sig-paren">)</span><a class="reference internal" href="_modules/Tools.html#toparamId"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#Tools.toparamId" title="Permalink to this definition"></a></dt>
250<dd><dl class="docutils">
251<dt>&#64;Description:</dt>
252<dd>Transform parameter names to parameter ids
253with ECMWF grib table 128.</dd>
254<dt>&#64;Input:</dt>
255<dd><dl class="first last docutils">
256<dt>pars: string</dt>
257<dd>Addpar argument from control file in the format of
258parameter names instead of ids. The parameter short
259names are sepearted with “/” and they are passed as
260one single string.</dd>
261<dt>table: dictionary</dt>
262<dd>Contains the ECMWF grib table 128 information.
263The key is the parameter number and the value is the
264short name of the parameter.</dd>
265</dl>
266</dd>
267<dt>&#64;Return:</dt>
268<dd><dl class="first last docutils">
269<dt>ipar: list of integer</dt>
270<dd>List of addpar parameters from control file transformed to
271parameter ids in the format of integer.</dd>
272</dl>
273</dd>
274</dl>
275</dd></dl>
276
277<dl class="class">
278<dt id="Tools.Control">
279<em class="property">class </em><code class="descclassname">Tools.</code><code class="descname">Control</code><a class="headerlink" href="#Tools.Control" title="Permalink to this definition"></a></dt>
280<dd><p>&#64;Author: Leopold Haimberger (University of Vienna)</p>
281<p>&#64;Date: November 2015</p>
282<dl class="docutils">
283<dt>&#64;ChangeHistory:</dt>
284<dd><dl class="first last docutils">
285<dt>February 2018 - Anne Philipp (University of Vienna):</dt>
286<dd><ul class="first last simple">
287<li>applied PEP8 style guide</li>
288<li>added documentation</li>
289<li>applied some minor modifications in programming style/structure</li>
290<li>moved Control class in a file for its own</li>
291</ul>
292</dd>
293</dl>
294</dd>
295<dt>&#64;License:</dt>
296<dd><ol class="first upperalpha simple" start="3">
297<li>Copyright 2015-2018.</li>
298</ol>
299<p class="last">This software is licensed under the terms of the Apache Licence Version 2.0
300which can be obtained at <a class="reference external" href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>.</p>
301</dd>
302<dt>&#64;Requirements:</dt>
303<dd>A standard python 2.6 or 2.7 installation</dd>
304<dt>&#64;Description:</dt>
305<dd>The Control files are the steering part of the FLEXPART extraction
306software. All necessary parameters needed to retrieve the data fields
307from the MARS archive for driving FLEXPART are set in a Control file.
308Some specific parameters like the start and end dates can be overwritten
309by the command line parameters, but in generel all parameters needed
310for a complete set of fields for FLEXPART can be set in the Control files.</dd>
311</dl>
312<dl class="class">
313<dt id="Tools.Control.Control">
314<em class="property">class </em><code class="descname">Control</code><span class="sig-paren">(</span><em>filename</em><span class="sig-paren">)</span><a class="headerlink" href="#Tools.Control.Control" title="Permalink to this definition"></a></dt>
315<dd><p>Class containing the information of the ECMWFDATA control file.</p>
316<p>Contains all the parameters of control files, which are e.g.:
317DAY1(start_date), DAY2(end_date), DTIME, MAXSTEP, TYPE, TIME,
318STEP, CLASS(marsclass), STREAM, NUMBER, EXPVER, GRID, LEFT,
319LOWER, UPPER, RIGHT, LEVEL, LEVELIST, RESOL, GAUSS, ACCURACY,
320OMEGA, OMEGADIFF, ETA, ETADIFF, DPDETA, SMOOTH, FORMAT,
321ADDPAR, WRF, CWC, PREFIX, ECSTORAGE, ECTRANS, ECFSDIR,
322MAILOPS, MAILFAIL, GRIB2FLEXPART, FLEXPARTDIR,
323BASETIME, DATE_CHUNK, DEBUG, INPUTDIR, OUTPUTDIR, FLEXPART_ROOT_SCRIPTS</p>
324<p>For more information about format and content of the parameter
325see documentation.</p>
326<dl class="method">
327<dt id="Tools.Control.Control.tolist">
328<code class="descname">tolist</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#Tools.Control.Control.tolist" title="Permalink to this definition"></a></dt>
329<dd><dl class="docutils">
330<dt>&#64;Description:</dt>
331<dd>Just generates a list of strings containing the attributes and
332assigned values except the attributes “_expanded”, “exedir”,
333“ecmwfdatadir” and “flexpart_root_scripts”.</dd>
334<dt>&#64;Input:</dt>
335<dd><dl class="first last docutils">
336<dt>self: instance of Control class</dt>
337<dd>Description see class documentation.</dd>
338</dl>
339</dd>
340<dt>&#64;Return:</dt>
341<dd><dl class="first last docutils">
342<dt>l: list</dt>
343<dd>A sorted list of the all Control class attributes with
344their values except the attributes “_expanded”, “exedir”,
345“ecmwfdatadir” and “flexpart_root_scripts”.</dd>
346</dl>
347</dd>
348</dl>
349</dd></dl>
350
351</dd></dl>
352
353<dl class="attribute">
354<dt id="Tools.Control.Tools">
355<code class="descname">Tools</code><em class="property"> = &lt;module 'Tools' from '/nas16/tmc/Anne/Interpolation/flexextract/flexextract/python/Tools.pyc'&gt;</em><a class="headerlink" href="#Tools.Control.Tools" title="Permalink to this definition"></a></dt>
356<dd></dd></dl>
357
358<dl class="attribute">
359<dt id="Tools.Control.inspect">
360<code class="descname">inspect</code><em class="property"> = &lt;module 'inspect' from '/opt/anaconda/lib/python2.7/inspect.pyc'&gt;</em><a class="headerlink" href="#Tools.Control.inspect" title="Permalink to this definition"></a></dt>
361<dd></dd></dl>
362
363<dl class="attribute">
364<dt id="Tools.Control.os">
365<code class="descname">os</code><em class="property"> = &lt;module 'os' from '/opt/anaconda/lib/python2.7/os.pyc'&gt;</em><a class="headerlink" href="#Tools.Control.os" title="Permalink to this definition"></a></dt>
366<dd></dd></dl>
367
368</dd></dl>
369
370</div>
371
372
373          </div>
374        </div>
375      </div>
376      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
377        <div class="sphinxsidebarwrapper">
378  <h4>Previous topic</h4>
379  <p class="topless"><a href="index.html"
380                        title="previous chapter">Welcome to flex_extract_test’s documentation!</a></p>
381<div id="searchbox" style="display: none" role="search">
382  <h3>Quick search</h3>
383    <form class="search" action="search.html" method="get">
384      <div><input type="text" name="q" /></div>
385      <div><input type="submit" value="Go" /></div>
386      <input type="hidden" name="check_keywords" value="yes" />
387      <input type="hidden" name="area" value="default" />
388    </form>
389</div>
390<script type="text/javascript">$('#searchbox').show(0);</script>
391        </div>
392      </div>
393      <div class="clearer"></div>
394    </div>
395    <div class="related" role="navigation" aria-label="related navigation">
396      <h3>Navigation</h3>
397      <ul>
398        <li class="right" style="margin-right: 10px">
399          <a href="genindex.html" title="General Index"
400             >index</a></li>
401        <li class="right" >
402          <a href="py-modindex.html" title="Python Module Index"
403             >modules</a> |</li>
404        <li class="right" >
405          <a href="index.html" title="Welcome to flex_extract_test’s documentation!"
406             >previous</a> |</li>
407        <li class="nav-item nav-item-0"><a href="index.html">flex_extract_test 7.1 documentation</a> &#187;</li> 
408      </ul>
409    </div>
410    <div class="footer" role="contentinfo">
411        &#169; Copyright 2018, AP.
412      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.6.6.
413    </div>
414  </body>
415</html>
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG