forked from pygeode/pygeode.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfileio.html
457 lines (442 loc) · 25.9 KB
/
fileio.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
<!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>File Input and Output — PyGeode 1.0 alpha documentation</title>
<link rel="stylesheet" href="_static/pygtheme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.0 alpha',
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="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="top" title="PyGeode 1.0 alpha documentation" href="index.html" />
<link rel="up" title="Reference" href="reference.html" />
<link rel="next" title="Timeutils module" href="timeutils.html" />
<link rel="prev" title="Plot module" href="plot.html" />
<link href="http://fonts.googleapis.com/css?family=Ubuntu:300,300italic,regular,italic,500,500italic,bold,bolditalic" rel="stylesheet" type="text/css">
<link href='http://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700' rel='stylesheet' type='text/css'>
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="timeutils.html" title="Timeutils module"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="plot.html" title="Plot module"
accesskey="P">previous</a> |</li>
<li><a href="index.html">PyGeode 1.0 alpha documentation</a> »</li>
<li><a href="reference.html" accesskey="U">Reference</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="file-input-and-output">
<h1>File Input and Output<a class="headerlink" href="#file-input-and-output" title="Permalink to this headline">¶</a></h1>
<p>Serialized data stored in files on disk (or over the network) can be imported
into PyGeode with the routines <a class="reference internal" href="#pygeode.open" title="pygeode.open"><tt class="xref py py-func docutils literal"><span class="pre">open()</span></tt></a> (for single files), <a class="reference internal" href="#pygeode.openall" title="pygeode.openall"><tt class="xref py py-func docutils literal"><span class="pre">openall()</span></tt></a>
(for small numbers of files), and <a class="reference internal" href="#pygeode.open_multi" title="pygeode.open_multi"><tt class="xref py py-func docutils literal"><span class="pre">open_multi()</span></tt></a> (for large numbers of
files). Variables and datasets can be saved to disk with <a class="reference internal" href="#pygeode.save" title="pygeode.save"><tt class="xref py py-func docutils literal"><span class="pre">save()</span></tt></a>.</p>
<p id="formats">Several formats are supported natively by pygeode, including NetCDF (versions 3
and 4), HDF (versions 4 and 5) and grib files, though support for NetCDF and
HDF is the most complete. By default the format is detected through the file extension;
however, many of the methods below accept an optional <tt class="docutils literal"><span class="pre">format</span></tt> argument which can be used to
specify the format explicitly.</p>
<table border="1" class="docutils">
<colgroup>
<col width="13%" />
<col width="17%" />
<col width="25%" />
<col width="45%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Format</th>
<th class="head">Extension</th>
<th class="head">String Identifier</th>
<th class="head">Notes</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>NetCDF</td>
<td>.nc</td>
<td>netcdf</td>
<td> </td>
</tr>
<tr class="row-odd"><td>HDF5</td>
<td> </td>
<td>netcdf</td>
<td>Uses the same library as NetCDF</td>
</tr>
<tr class="row-even"><td>HDF4</td>
<td>.hdf</td>
<td>hdf4</td>
<td> </td>
</tr>
<tr class="row-odd"><td>GRIB</td>
<td>.grib</td>
<td>grib</td>
<td> </td>
</tr>
</tbody>
</table>
<p>Code also exists to read the native binary format used by the Canadian Centre
for Climate Modeling and Analysis, but this is not distributed with PyGeode by
default.</p>
<dl class="function">
<dt id="pygeode.open">
<tt class="descclassname">pygeode.</tt><tt class="descname">open</tt><big>(</big><em>filename</em>, <em>format=None</em>, <em>value_override={}</em>, <em>dimtypes={}</em>, <em>namemap={}</em>, <em>varlist=</em>, <span class="optional">[</span><span class="optional">]</span><em>cfmeta=True</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#pygeode.open" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a <a class="reference internal" href="dataset.html#pygeode.Dataset" title="pygeode.Dataset"><tt class="xref py py-class docutils literal"><span class="pre">Dataset</span></tt></a> containing variables defined in a single file.</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>filename</strong> : string</p>
<blockquote>
<div><p>Path of file to open</p>
</div></blockquote>
<p><strong>format</strong> : string, optional</p>
<blockquote>
<div><p>String specifying format of file to open. If none is given the format will be automatically
detected from the file (see <tt class="xref py py-func docutils literal"><span class="pre">autodetectformat()</span></tt>)</p>
</div></blockquote>
<p><strong>value_override</strong> : dict, optional</p>
<blockquote>
<div><p>A dictionary containing arrays with which to override values for one or more variables (specified
by the keys). This can be used for instance to avoid loading the values of an axis whose values
are severely scattered across a large file.</p>
</div></blockquote>
<p><strong>dimtypes</strong> : dict, optional</p>
<blockquote>
<div><p>A dictionary mapping dimension names to axis classes. The keys should be
axis names as defined in the file; values should be one of:</p>
<ol class="arabic simple">
<li>an axis instance, which will be used directly</li>
<li>an axis class, which will be used to create a new instance with the values given by the file</li>
<li>a tuple of an axis class and a dictionary with keyword arguments to pass to that axis’ constructor</li>
</ol>
<p>If dimtypes is not specified, an attempt is made to automatically identify the axis types (see optional
<cite>cfmeta</cite> argument below)</p>
</div></blockquote>
<p><strong>namemap</strong> : dict, optional</p>
<blockquote>
<div><p>A dictionary to map variable names as specified in the file (keys) to PyGeode variable names
(values); also works for axes/dimensions</p>
</div></blockquote>
<p><strong>varlist</strong> : list, optional</p>
<blockquote>
<div><p>A list (of strings) specifying the variables that should be loaded into the
data set (if the list is empty, all NetCDF variables will be loaded)</p>
</div></blockquote>
<p><strong>cfmeta</strong> : boolean</p>
<blockquote>
<div><p>If true, an attempt to identify the type of each dimension is made
following the CF metadata conventions.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>dataset</strong> :</p>
<blockquote class="last">
<div><p>A dataset containing the variables contained in the file. The variable data itself is not loaded
into memory.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="#pygeode.openall" title="pygeode.openall"><tt class="xref py py-obj docutils literal"><span class="pre">openall</span></tt></a>, <a class="reference internal" href="#pygeode.open_multi" title="pygeode.open_multi"><tt class="xref py py-obj docutils literal"><span class="pre">open_multi</span></tt></a></p>
</div>
<p class="rubric">Notes</p>
<p>The format of the file is automatically detected from the filename (if
possible); otherwise it must be specified by the <tt class="docutils literal"><span class="pre">format</span></tt> argument.
The identifiers used in <tt class="docutils literal"><span class="pre">varlist</span></tt> and <tt class="docutils literal"><span class="pre">dimtypes</span></tt> are the original names used in
the NetCDF file, not the names given in <tt class="docutils literal"><span class="pre">namemap</span></tt>.</p>
</dd></dl>
<dl class="function">
<dt id="pygeode.openall">
<tt class="descclassname">pygeode.</tt><tt class="descname">openall</tt><big>(</big><em>files</em>, <em>format=None</em>, <em>opener=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#pygeode.openall" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a <a class="reference internal" href="dataset.html#pygeode.Dataset" title="pygeode.Dataset"><tt class="xref py py-class docutils literal"><span class="pre">Dataset</span></tt></a> containing variables merged across multiple files.</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>files</strong> : string, list, or tuple</p>
<blockquote>
<div><p>Either a single filename or a list of filenames. Wildcards are supported, <a class="reference external" href="http://docs.python.org/library/glob.html#glob.iglob" title="(in Python v2.7)"><tt class="xref py py-func docutils literal"><span class="pre">glob.iglob()</span></tt></a> is
used to expand these into an explicit list of files.</p>
</div></blockquote>
<p><strong>format</strong> : string, optional</p>
<blockquote>
<div><p>String specifying format of file to open. If none is given the format will be automatically
detected from the first filename (see <tt class="xref py py-func docutils literal"><span class="pre">autodetectformat()</span></tt>)</p>
</div></blockquote>
<p><strong>opener</strong> : function, optional</p>
<blockquote>
<div><p>Function to open individual files. If none is provided, uses the
format-specific version of <a class="reference internal" href="#pygeode.open" title="pygeode.open"><tt class="xref py py-func docutils literal"><span class="pre">open()</span></tt></a>. The datasets returned by this
function are then concatenated and returned. See Notes.</p>
</div></blockquote>
<p><strong>sorted</strong> : boolean, optional</p>
<blockquote>
<div><p>If True, the filenames are sorted (by alpha) prior to opening each file, and
the axes on the returned dataset are sorted by calling <tt class="xref py py-meth docutils literal"><span class="pre">Dataset.sorted()</span></tt>.</p>
</div></blockquote>
<p><strong>**kwargs</strong> : keyword arguments</p>
<blockquote>
<div><p>These are passed on to the function <tt class="docutils literal"><span class="pre">opener</span></tt>;</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>dataset</strong> :</p>
<blockquote class="last">
<div><p>A dataset containing the variables concatenated across all specified files.
The variable data itself is not loaded into memory.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="#pygeode.open" title="pygeode.open"><tt class="xref py py-obj docutils literal"><span class="pre">open</span></tt></a>, <a class="reference internal" href="#pygeode.open_multi" title="pygeode.open_multi"><tt class="xref py py-obj docutils literal"><span class="pre">open_multi</span></tt></a></p>
</div>
<p class="rubric">Notes</p>
<p>The function <tt class="docutils literal"><span class="pre">opener</span></tt> must take a single positional argument - the filename of the file
to open - and keyword arguments that are passed through from this function. It must return
a <a class="reference internal" href="dataset.html#pygeode.Dataset" title="pygeode.Dataset"><tt class="xref py py-class docutils literal"><span class="pre">Dataset</span></tt></a> object with the loaded variables. By default the standard
<a class="reference internal" href="#pygeode.open" title="pygeode.open"><tt class="xref py py-func docutils literal"><span class="pre">open()</span></tt></a> is used, but providing a custom opener can be useful for any reshaping of the
variables that must be done prior to concatenating the whole dataset.</p>
<p>Once every file has been opened, the resulting datasets are concatenated
using <a class="reference internal" href="dataset.html#pygeode.dataset.concat" title="pygeode.dataset.concat"><tt class="xref py py-func docutils literal"><span class="pre">dataset.concat()</span></tt></a>.</p>
<p>This function is best suited for a moderate number of files. Because each
file must be explicitly opened to read the metadata, even this can take a
significant amount of time if a large number of files are being opened. For
these cases using <a class="reference internal" href="#pygeode.open_multi" title="pygeode.open_multi"><tt class="xref py py-func docutils literal"><span class="pre">open_multi()</span></tt></a> can be much more efficient, though it
requires more coding effort initially. The underlying concatenation is also
more efficient when the data is actually accessed.</p>
</dd></dl>
<dl class="function">
<dt id="pygeode.open_multi">
<tt class="descclassname">pygeode.</tt><tt class="descname">open_multi</tt><big>(</big><em>files</em>, <em>format=None</em>, <em>opener=None</em>, <em>pattern=None</em>, <em>file2date=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#pygeode.open_multi" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a <a class="reference internal" href="dataset.html#pygeode.Dataset" title="pygeode.Dataset"><tt class="xref py py-class docutils literal"><span class="pre">Dataset</span></tt></a> containing variables merged across many files.</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>files</strong> : string, list, or tuple</p>
<blockquote>
<div><p>Either a single filename or a list of filenames. Wildcards are supported, <a class="reference external" href="http://docs.python.org/library/glob.html#glob.iglob" title="(in Python v2.7)"><tt class="xref py py-func docutils literal"><span class="pre">glob.iglob()</span></tt></a> is
used to expand these into an explicit list of files.</p>
</div></blockquote>
<p><strong>format</strong> : string, optional</p>
<blockquote>
<div><p>String specifying format of file to open. If none is given the format will be automatically
detected from the first filename (see <tt class="xref py py-func docutils literal"><span class="pre">autodetectformat()</span></tt>)</p>
</div></blockquote>
<p><strong>opener</strong> : function, optional</p>
<blockquote>
<div><p>Function to open individual files. If none is provided, uses the
format-specific version of <a class="reference internal" href="#pygeode.open" title="pygeode.open"><tt class="xref py py-func docutils literal"><span class="pre">open()</span></tt></a>. The datasets returned by this
function are then concatenated and returned. See Notes.</p>
</div></blockquote>
<p><strong>pattern</strong> : string, optional</p>
<blockquote>
<div><p>A regex pattern to extract date stamps from the filename; used by default file2date.
Matching patterns must be named <year>, <month>, <day>, <hour> or <minute>.
Abbreviations are available for the above; $Y matches a four digit year, $m, $d, $H,
and $M match a two-digit month, day, hour and minute, respectively.</p>
</div></blockquote>
<p><strong>file2date</strong> : function, optional</p>
<blockquote>
<div><p>Function which returns a date dictionary given a filename. By default this is produced
by applying the regex pattern <tt class="docutils literal"><span class="pre">pattern</span></tt> to the filename.</p>
</div></blockquote>
<p><strong>sorted</strong> : boolean, optional</p>
<blockquote>
<div><p>If True, the filenames are sorted (by alpha) prior to opening each file, and
the axes on the returned dataset are sorted by calling <tt class="xref py py-meth docutils literal"><span class="pre">Dataset.sorted()</span></tt>.</p>
</div></blockquote>
<p><strong>**kwargs</strong> : keyword arguments</p>
<blockquote>
<div><p>These are passed on to the function <tt class="docutils literal"><span class="pre">opener</span></tt>;</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>dataset</strong> :</p>
<blockquote class="last">
<div><p>A dataset containing the variables concatenated across all specified files.
The variable data itself is not loaded into memory.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="#pygeode.open" title="pygeode.open"><tt class="xref py py-obj docutils literal"><span class="pre">open</span></tt></a>, <a class="reference internal" href="#pygeode.openall" title="pygeode.openall"><tt class="xref py py-obj docutils literal"><span class="pre">openall</span></tt></a></p>
</div>
<p class="rubric">Notes</p>
<p>This is intended to provide access to large datasets whose files are
separated by timestep. To avoid opening every file individually, the time
axis is constructed by opening the first and the last file in the list of
files provided. This is done to provide a template of what variables and what
times are stored in each file - it is assumed that the number of timesteps
(and their offsets) is the same accross the whole dataset. The time axis is
then constructed from the filenames themselves, using the function
<tt class="docutils literal"><span class="pre">file2date</span></tt> to generate a date from each filename. As a result only two files
need to be opened, which makes this a very efficient way to work with very large
datasets.</p>
<p>However, no explicit check is made of the integrity of the files - if there
are corrupt or missing data within individual files, this will not become
clear until that data is actually accessed. This can be done explicitly with
<tt class="xref py py-func docutils literal"><span class="pre">check_dataset()</span></tt>, which explicitly attempts to access all the data and
returns a list of any problems encountered; this can take a long time, but is
a useful check (and is more likely to provide helpful error messages).</p>
<p>The function <tt class="docutils literal"><span class="pre">opener</span></tt> must take a single positional argument - the filename
of the file to open - and keyword arguments that are passed through from this
function. It must return a <a class="reference internal" href="dataset.html#pygeode.Dataset" title="pygeode.Dataset"><tt class="xref py py-class docutils literal"><span class="pre">Dataset</span></tt></a> object with the loaded variables.
By default the standard <a class="reference internal" href="#pygeode.open" title="pygeode.open"><tt class="xref py py-func docutils literal"><span class="pre">open()</span></tt></a> is used, but providing a custom opener
can be useful for any reshaping of the variables that must be done prior to
concatenating the whole dataset.</p>
</dd></dl>
<dl class="function">
<dt id="pygeode.save">
<tt class="descclassname">pygeode.</tt><tt class="descname">save</tt><big>(</big><em>filename</em>, <em>dataset</em>, <em>format=None</em>, <em>cfmeta=True</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#pygeode.save" title="Permalink to this definition">¶</a></dt>
<dd><p>Saves a <a class="reference internal" href="var.html#pygeode.Var" title="pygeode.Var"><tt class="xref py py-class docutils literal"><span class="pre">Var</span></tt></a> or <a class="reference internal" href="dataset.html#pygeode.Dataset" title="pygeode.Dataset"><tt class="xref py py-class docutils literal"><span class="pre">Dataset</span></tt></a> to file.</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>filename</strong> : string</p>
<blockquote>
<div><p>Path of file to save to.</p>
</div></blockquote>
<p><strong>dataset</strong> : <a class="reference internal" href="var.html#pygeode.Var" title="pygeode.Var"><tt class="xref py py-class docutils literal"><span class="pre">Var</span></tt></a>, <a class="reference internal" href="dataset.html#pygeode.Dataset" title="pygeode.Dataset"><tt class="xref py py-class docutils literal"><span class="pre">Dataset</span></tt></a>, or collection of <a class="reference internal" href="var.html#pygeode.Var" title="pygeode.Var"><tt class="xref py py-class docutils literal"><span class="pre">Var</span></tt></a> objects</p>
<blockquote>
<div><p>Variables to write to disk. The dataset is consolidated using <a class="reference internal" href="dataset.html#pygeode.dataset.asdataset" title="pygeode.dataset.asdataset"><tt class="xref py py-func docutils literal"><span class="pre">dataset.asdataset()</span></tt></a>.</p>
</div></blockquote>
<p><strong>format</strong> : string, optional</p>
<blockquote>
<div><p>String specifying format of file to open. If none is given the format will be automatically
detected from the file (see <tt class="xref py py-func docutils literal"><span class="pre">autodetectformat()</span></tt>)</p>
</div></blockquote>
<p><strong>cfmeta</strong> : boolean</p>
<blockquote class="last">
<div><p>If true, metadata is automatically written specifying the axis dimensions following CF
metadata conventions.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>The format of the file is automatically detected from the filename (if
possible). The NetCDF format is at present the best supported.</p>
</dd></dl>
<dl class="function">
<dt id="pygeode.formats.autodetectformat">
<tt class="descclassname">pygeode.formats.</tt><tt class="descname">autodetectformat</tt><big>(</big><em>filename</em><big>)</big><a class="headerlink" href="#pygeode.formats.autodetectformat" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns best guess at file format based on file name.</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>filename</strong> : string</p>
<blockquote>
<div><p>Filename to identify</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>string</strong> :</p>
<blockquote>
<div><p>String specifying identified file format.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Raises:</th><td class="field-body"><p class="first"><strong>ValueError</strong> :</p>
<blockquote class="last">
<div><p>If the format cannot be determined from the extension.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><tt class="xref py py-obj docutils literal"><span class="pre">extdict</span></tt></p>
</div>
</dd></dl>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="plot.html"
title="previous chapter">Plot module</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="timeutils.html"
title="next chapter">Timeutils module</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/fileio.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="timeutils.html" title="Timeutils module"
>next</a> |</li>
<li class="right" >
<a href="plot.html" title="Plot module"
>previous</a> |</li>
<li><a href="index.html">PyGeode 1.0 alpha documentation</a> »</li>
<li><a href="reference.html" >Reference</a> »</li>
</ul>
</div>
<div class="footer">
© Copyright 2013, Mike Neish, Peter Hitchcock.
Last updated on Sep 13, 2015.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.2.
</div>
</body>
</html>