forked from pygeode/pygeode.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvarquery.html
245 lines (231 loc) · 14.9 KB
/
varquery.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
<!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>Variable Querying Routines — 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="Var class overview" href="var.html" />
<link rel="next" title="Retrieving values from a variable" href="var.get.html" />
<link rel="prev" title="Var class overview" href="var.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="var.get.html" title="Retrieving values from a variable"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="var.html" title="Var class overview"
accesskey="P">previous</a> |</li>
<li><a href="index.html">PyGeode 1.0 alpha documentation</a> »</li>
<li><a href="reference.html" >Reference</a> »</li>
<li><a href="var.html" accesskey="U">Var class overview</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="variable-querying-routines">
<h1>Variable Querying Routines<a class="headerlink" href="#variable-querying-routines" title="Permalink to this headline">¶</a></h1>
<p>Operations that retrieve information about the variable.</p>
<dl class="method">
<dt id="pygeode.Var.whichaxis">
<tt class="descclassname">Var.</tt><tt class="descname">whichaxis</tt><big>(</big><em>iaxis</em><big>)</big><a class="headerlink" href="#pygeode.Var.whichaxis" title="Permalink to this definition">¶</a></dt>
<dd><p>Locates a particular <a class="reference internal" href="axes.html#pygeode.Axis" title="pygeode.Axis"><tt class="xref py py-class docutils literal"><span class="pre">Axis</span></tt></a> associated with this variable.</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>iaxis</strong> : string, <a class="reference internal" href="axes.html#pygeode.Axis" title="pygeode.Axis"><tt class="xref py py-class docutils literal"><span class="pre">Axis</span></tt></a> class, or int</p>
<blockquote>
<div><p>The search criteria for finding the class.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>i</strong> : The index of the matching Axis. Raises <tt class="docutils literal"><span class="pre">KeyError</span></tt> if there is no match.</p>
</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.Var.getaxis" title="pygeode.Var.getaxis"><tt class="xref py py-obj docutils literal"><span class="pre">getaxis</span></tt></a>, <a class="reference internal" href="#pygeode.Var.hasaxis" title="pygeode.Var.hasaxis"><tt class="xref py py-obj docutils literal"><span class="pre">hasaxis</span></tt></a>, <a class="reference internal" href="axes.html#pygeode.Axis" title="pygeode.Axis"><tt class="xref py py-obj docutils literal"><span class="pre">Axis</span></tt></a></p>
</div>
<p class="rubric">Examples</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">pygeode.tutorial</span> <span class="kn">import</span> <span class="n">t1</span>
<span class="gp">>>> </span><span class="n">T</span> <span class="o">=</span> <span class="n">t1</span><span class="o">.</span><span class="n">Temp</span>
<span class="gp">>>> </span><span class="k">print</span> <span class="n">T</span><span class="o">.</span><span class="n">axes</span>
<span class="go">(<Lat>, <Lon>)</span>
<span class="gp">>>> </span><span class="k">print</span> <span class="n">T</span><span class="o">.</span><span class="n">whichaxis</span><span class="p">(</span><span class="s">'lat'</span><span class="p">)</span>
<span class="go">0</span>
<span class="gp">>>> </span><span class="k">print</span> <span class="n">T</span><span class="o">.</span><span class="n">whichaxis</span><span class="p">(</span><span class="s">'lon'</span><span class="p">)</span>
<span class="go">1</span>
<span class="gp">>>> </span><span class="k">print</span> <span class="n">T</span><span class="o">.</span><span class="n">whichaxis</span><span class="p">(</span><span class="s">'time'</span><span class="p">)</span>
<span class="gt">Traceback (most recent call last):</span>
File <span class="nb">"<stdin>"</span>, line <span class="m">1</span>, in <span class="n"><module></span>
File <span class="nb">"/usr/local/lib/python2.6/dist-packages/pygeode/var.py"</span>, line <span class="m">352</span>, in <span class="n">whichaxis</span>
<span class="k">raise</span> <span class="ne">KeyError</span><span class="p">,</span> <span class="s">"axis </span><span class="si">%s</span><span class="s"> not found in </span><span class="si">%s</span><span class="s">"</span><span class="o">%</span><span class="p">(</span><span class="nb">repr</span><span class="p">(</span><span class="n">iaxis</span><span class="p">),</span><span class="bp">self</span><span class="o">.</span><span class="n">axes</span><span class="p">)</span>
<span class="gr">KeyError</span>: <span class="n">"axis 'time' not found in (<Lat>, <Lon>)"</span>
</pre></div>
</div>
</dd></dl>
<dl class="method">
<dt id="pygeode.Var.hasaxis">
<tt class="descclassname">Var.</tt><tt class="descname">hasaxis</tt><big>(</big><em>iaxis</em><big>)</big><a class="headerlink" href="#pygeode.Var.hasaxis" title="Permalink to this definition">¶</a></dt>
<dd><p>Determines if a particular <a class="reference internal" href="axes.html#pygeode.Axis" title="pygeode.Axis"><tt class="xref py py-class docutils literal"><span class="pre">Axis</span></tt></a> is associated with this variable.</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>iaxis</strong> : string, <a class="reference internal" href="axes.html#pygeode.Axis" title="pygeode.Axis"><tt class="xref py py-class docutils literal"><span class="pre">Axis</span></tt></a> class, or int</p>
<blockquote>
<div><p>The search criteria for finding the class.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>found</strong> : boolean. <tt class="docutils literal"><span class="pre">True</span></tt> if found, otherwise <tt class="docutils literal"><span class="pre">False</span></tt></p>
</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.Var.getaxis" title="pygeode.Var.getaxis"><tt class="xref py py-obj docutils literal"><span class="pre">getaxis</span></tt></a>, <a class="reference internal" href="#pygeode.Var.whichaxis" title="pygeode.Var.whichaxis"><tt class="xref py py-obj docutils literal"><span class="pre">whichaxis</span></tt></a>, <a class="reference internal" href="axes.html#pygeode.Axis" title="pygeode.Axis"><tt class="xref py py-obj docutils literal"><span class="pre">Axis</span></tt></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="pygeode.Var.getaxis">
<tt class="descclassname">Var.</tt><tt class="descname">getaxis</tt><big>(</big><em>iaxis</em><big>)</big><a class="headerlink" href="#pygeode.Var.getaxis" title="Permalink to this definition">¶</a></dt>
<dd><p>Grabs a reference to a particular <a class="reference internal" href="axes.html#pygeode.Axis" title="pygeode.Axis"><tt class="xref py py-class docutils literal"><span class="pre">Axis</span></tt></a> associated with this variable.</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>iaxis</strong> : string, <a class="reference internal" href="axes.html#pygeode.Axis" title="pygeode.Axis"><tt class="xref py py-class docutils literal"><span class="pre">Axis</span></tt></a> class, or int</p>
<blockquote>
<div><p>The search criteria for finding the class.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last"><strong>axis</strong> : <a class="reference internal" href="axes.html#pygeode.Axis" title="pygeode.Axis"><tt class="xref py py-class docutils literal"><span class="pre">Axis</span></tt></a> object that matches. Raises <tt class="docutils literal"><span class="pre">KeyError</span></tt> if there is no match.</p>
</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.Var.whichaxis" title="pygeode.Var.whichaxis"><tt class="xref py py-obj docutils literal"><span class="pre">whichaxis</span></tt></a>, <a class="reference internal" href="#pygeode.Var.hasaxis" title="pygeode.Var.hasaxis"><tt class="xref py py-obj docutils literal"><span class="pre">hasaxis</span></tt></a>, <a class="reference internal" href="axes.html#pygeode.Axis" title="pygeode.Axis"><tt class="xref py py-obj docutils literal"><span class="pre">Axis</span></tt></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="pygeode.Var.getweights">
<tt class="descclassname">Var.</tt><tt class="descname">getweights</tt><big>(</big><em>iaxes=None</em><big>)</big><a class="headerlink" href="#pygeode.Var.getweights" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns weights associated with the axes of this variable.</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>iaxes</strong> : list of axis identifiers (string, <a class="reference internal" href="axes.html#pygeode.Axis" title="pygeode.Axis"><tt class="xref py py-class docutils literal"><span class="pre">Axis</span></tt></a>, or int) (optional)</p>
<blockquote>
<div><p>Axes over which to compute the weights</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>weights</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></p>
<blockquote class="last">
<div><p>defined on the subgrid of this variable on which weights are defined.</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="axis.html#pygeode.Axis.__init__" title="pygeode.Axis.__init__"><tt class="xref py py-obj docutils literal"><span class="pre">Axis.__init__</span></tt></a></p>
</div>
</dd></dl>
<dl class="docutils">
<dt><strong>See Also:</strong></dt>
<dd><a class="reference internal" href="var.html"><em>Var class overview</em></a></dd>
</dl>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="var.html"
title="previous chapter">Var class overview</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="var.get.html"
title="next chapter">Retrieving values from a variable</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/varquery.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="var.get.html" title="Retrieving values from a variable"
>next</a> |</li>
<li class="right" >
<a href="var.html" title="Var class overview"
>previous</a> |</li>
<li><a href="index.html">PyGeode 1.0 alpha documentation</a> »</li>
<li><a href="reference.html" >Reference</a> »</li>
<li><a href="var.html" >Var class overview</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>