forked from pygeode/pygeode.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaxis.html
440 lines (410 loc) · 27 KB
/
axis.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
<!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>Axis class reference — 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="Axis class overview" href="axes.html" />
<link rel="next" title="NamedAxis object reference" href="namedaxis.html" />
<link rel="prev" title="Axis class overview" href="axes.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="namedaxis.html" title="NamedAxis object reference"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="axes.html" title="Axis 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="axes.html" accesskey="U">Axis class overview</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="axis-class-reference">
<h1>Axis class reference<a class="headerlink" href="#axis-class-reference" title="Permalink to this headline">¶</a></h1>
<dl class="attribute">
<dt id="pygeode.Axis.rtol">
<tt class="descclassname">Axis.</tt><tt class="descname">rtol</tt><a class="headerlink" href="#pygeode.Axis.rtol" title="Permalink to this definition">¶</a></dt>
<dd><p>Relative tolerance for identifying two values for this axis as the same point. Set automatically
in Axis::__init__ but if this is too large for a given application this can be the source
of unexpected errors. Setting this parameter to a new value on the Axis objects in question may
resolve these issues.</p>
</dd></dl>
<dl class="attribute">
<dt id="pygeode.Axis.formatstr">
<tt class="descclassname">Axis.</tt><tt class="descname">formatstr</tt><a class="headerlink" href="#pygeode.Axis.formatstr" title="Permalink to this definition">¶</a></dt>
<dd><p>The format to apply to the axis values when displaying on the screen. See the Python documentation on <a class="reference external" href="http://docs.python.org/library/stdtypes.html#string-formatting">String Formatting</a> for the options available.</p>
<p>If the axis needs a more complicated format (that changes depending on the value), it may also define a <tt class="xref py py-meth docutils literal"><span class="pre">formatvalue()</span></tt> method to explicitly convert each value to a string. For example, the <tt class="docutils literal"><span class="pre">Lat</span></tt> axis uses a <em>formatvalue</em> method to append an ‘N’ or ‘S’ to the latitudes, depending on the sign of the value.</p>
</dd></dl>
<dl class="attribute">
<dt id="pygeode.Axis.auxatts">
<tt class="descclassname">Axis.</tt><tt class="descname">auxatts</tt><a class="headerlink" href="#pygeode.Axis.auxatts" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="attribute">
<dt id="pygeode.Axis.auxarrays">
<tt class="descclassname">Axis.</tt><tt class="descname">auxarrays</tt><a class="headerlink" href="#pygeode.Axis.auxarrays" title="Permalink to this definition">¶</a></dt>
<dd><p>A dictionary of 1D numpy arrays with the same length as the axis that carry auxiliary
data associated with each element of the axis. These data need not be unique; for instance,
the values of time axes (e.g. <a class="reference internal" href="timeaxes.html#pygeode.StandardTime" title="pygeode.StandardTime"><tt class="xref py py-class docutils literal"><span class="pre">StandardTime</span></tt></a>) are given as offsets from a reference
date, while they have auxarrays for the year, month, day, etc. Many elements of the time axis
might have same value in the corresponding <cite>month</cite> auxiliary array. These can be used
to select by keyword.</p>
<div class="admonition seealso">
<p class="first admonition-title">See also</p>
<p class="last"><a class="reference internal" href="#pygeode.Axis.auxasvar" title="pygeode.Axis.auxasvar"><tt class="xref py py-obj docutils literal"><span class="pre">auxasvar</span></tt></a>, <a class="reference internal" href="varops.html#pygeode.Var.__call__" title="pygeode.Var.__call__"><tt class="xref py py-obj docutils literal"><span class="pre">Var.__call__</span></tt></a></p>
</div>
</dd></dl>
<dl class="attribute">
<dt id="pygeode.Axis.plottitle">
<tt class="descclassname">Axis.</tt><tt class="descname">plottitle</tt><a class="headerlink" href="#pygeode.Axis.plottitle" title="Permalink to this definition">¶</a></dt>
<dd><p>A string to display on plot axes. Usually more verbose than the axis’s <a class="reference internal" href="var.html#pygeode.Var.name" title="pygeode.Var.name"><tt class="xref py py-attr docutils literal"><span class="pre">name</span></tt></a> attribute.</p>
</dd></dl>
<dl class="attribute">
<dt id="pygeode.Axis.plotscale">
<tt class="descclassname">Axis.</tt><tt class="descname">plotscale</tt><a class="headerlink" href="#pygeode.Axis.plotscale" title="Permalink to this definition">¶</a></dt>
<dd><p><tt class="docutils literal"><span class="pre">'linear'</span></tt> for a linear plot scale, <tt class="docutils literal"><span class="pre">'log'</span></tt> for a logarithmic plot scale.</p>
</dd></dl>
<dl class="attribute">
<dt id="pygeode.Axis.plotorder">
<tt class="descclassname">Axis.</tt><tt class="descname">plotorder</tt><a class="headerlink" href="#pygeode.Axis.plotorder" title="Permalink to this definition">¶</a></dt>
<dd><p>The order of the values when plotting. <tt class="docutils literal"><span class="pre">1</span></tt> = increasing from left to right, <tt class="docutils literal"><span class="pre">-1</span></tt> = decreasing.</p>
</dd></dl>
<p><strong>Note:</strong> Due to current limitations in PyGeode, modifications to these attributes may be lost if you do further work on the axis (e.g. slicing, concatenation, etc.). It will revert back to the default class values. For example:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">pygeode</span> <span class="kn">import</span> <span class="n">Lat</span>
<span class="gp">>>> </span><span class="n">x</span> <span class="o">=</span> <span class="n">Lat</span><span class="p">([</span><span class="mi">10</span><span class="p">,</span><span class="mi">20</span><span class="p">,</span><span class="mi">30</span><span class="p">])</span>
<span class="gp">>>> </span><span class="k">print</span> <span class="n">x</span>
<span class="go">lat <Lat> : 10 N to 30 N (3 values)</span>
<span class="gp">>>> </span><span class="n">x</span><span class="o">.</span><span class="n">formatstr</span> <span class="o">=</span> <span class="s">'</span><span class="si">%d</span><span class="s"> deg'</span>
<span class="gp">>>> </span><span class="k">print</span> <span class="n">x</span>
<span class="go">lat <Lat> : 10 deg N to 30 deg N (3 values)</span>
<span class="gp">>>> </span><span class="c"># ^^^ yay!</span>
<span class="gp">>>> </span><span class="k">print</span> <span class="n">x</span><span class="p">(</span><span class="n">lat</span><span class="o">=</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span><span class="mi">20</span><span class="p">))</span>
<span class="go">lat <Lat> : 10 N to 20 N (2 values)</span>
<span class="gp">>>> </span><span class="c"># ^^^ wtf?!</span>
</pre></div>
</div>
<p>To get around this, make your changes to the class itself. As an added benefit, <em>all</em> axes of this class will have your changes applied consistently:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">pygeode</span> <span class="kn">import</span> <span class="n">Lat</span>
<span class="gp">>>> </span><span class="n">x</span> <span class="o">=</span> <span class="n">Lat</span><span class="p">([</span><span class="mi">10</span><span class="p">,</span><span class="mi">20</span><span class="p">,</span><span class="mi">30</span><span class="p">])</span>
<span class="gp">>>> </span><span class="k">print</span> <span class="n">x</span>
<span class="go">lat <Lat> : 10 N to 30 N (3 values)</span>
<span class="gp">>>> </span><span class="c"># change this ^^^ on all latitude axes:</span>
<span class="gp">>>> </span><span class="n">Lat</span><span class="o">.</span><span class="n">formatstr</span> <span class="o">=</span> <span class="s">'</span><span class="si">%d</span><span class="s"> deg'</span>
<span class="gp">>>> </span><span class="k">print</span> <span class="n">x</span>
<span class="go">lat <Lat> : 10 deg N to 30 deg N (3 values)</span>
<span class="gp">>>> </span><span class="k">print</span> <span class="n">x</span><span class="p">(</span><span class="n">lat</span><span class="o">=</span><span class="p">(</span><span class="mi">10</span><span class="p">,</span><span class="mi">20</span><span class="p">))</span> <span class="c"># check if the changes 'stick'</span>
<span class="go">lat <Lat> : 10 deg N to 20 deg N (2 values)</span>
<span class="gp">>>> </span><span class="n">y</span> <span class="o">=</span> <span class="n">Lat</span><span class="p">([</span><span class="mi">40</span><span class="p">,</span><span class="mi">50</span><span class="p">,</span><span class="mi">60</span><span class="p">])</span> <span class="c"># will work on all Lat axes now.</span>
<span class="gp">>>> </span><span class="k">print</span> <span class="n">y</span>
<span class="go">lat <Lat> : 40 deg N to 60 deg N (3 values)</span>
</pre></div>
</div>
<dl class="method">
<dt id="pygeode.Axis.__init__">
<tt class="descclassname">Axis.</tt><tt class="descname">__init__</tt><big>(</big><em>values</em>, <em>name=None</em>, <em>atts=None</em>, <em>plotatts=None</em>, <em>rtol=None</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#pygeode.Axis.__init__" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a new Axis object with the given values.</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>values</strong> : numpy.ndarray</p>
<blockquote>
<div><p>A one-dimensional coordinate defining the axis grid.</p>
</div></blockquote>
<p><strong>name</strong> : string (optional)</p>
<blockquote>
<div><p>What to call the axis (i.e. for plot titles & when saving to file)</p>
</div></blockquote>
<p><strong>atts</strong> : dict (optional)</p>
<blockquote>
<div><p>Any additional metadata to associate with the axis. The dictionary
keys should be strings.</p>
</div></blockquote>
<p><strong>plotatts</strong> : dict (optional)</p>
<blockquote>
<div><p>Parameters that control plotting behaviour; default values are available.
The dictionary keys should be strings.</p>
</div></blockquote>
<p><strong>rtol</strong> : float</p>
<blockquote class="last">
<div><p>A relative tolerance used for identifying an element of this axis.</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>All subclasses of <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> need to call this __init__ method within
their own __init__, to properly initialize all attributes.</p>
</dd></dl>
<dl class="method">
<dt id="pygeode.Axis.argsort">
<tt class="descclassname">Axis.</tt><tt class="descname">argsort</tt><big>(</big><em>reverse=None</em><big>)</big><a class="headerlink" href="#pygeode.Axis.argsort" title="Permalink to this definition">¶</a></dt>
<dd><p>Generates a list of indices that would sort the Axis.</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>reverse</strong> : boolean (optional)</p>
<blockquote>
<div><p>If <tt class="docutils literal"><span class="pre">False</span></tt>, indices are in ascending order. If <tt class="docutils literal"><span class="pre">True</span></tt>, will produce
indices for a <em>reverse</em> sort instead. By default, sign of self.plotorder is used.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>indices</strong> : list</p>
<blockquote class="last">
<div><p>The indices which will produces a sorted version of the Axis.</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.Axis.sorted" title="pygeode.Axis.sorted"><tt class="xref py py-obj docutils literal"><span class="pre">sorted</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</span> <span class="kn">import</span> <span class="n">Lat</span>
<span class="gp">>>> </span><span class="n">x</span> <span class="o">=</span> <span class="n">Lat</span><span class="p">([</span><span class="mi">20</span><span class="p">,</span><span class="mi">30</span><span class="p">,</span><span class="mi">10</span><span class="p">])</span>
<span class="gp">>>> </span><span class="k">print</span> <span class="n">x</span>
<span class="go">lat <Lat> : 20 N to 10 N (3 values)</span>
<span class="gp">>>> </span><span class="n">indices</span> <span class="o">=</span> <span class="n">x</span><span class="o">.</span><span class="n">argsort</span><span class="p">()</span>
<span class="gp">>>> </span><span class="k">print</span> <span class="n">indices</span>
<span class="go">[2 0 1]</span>
<span class="gp">>>> </span><span class="k">print</span> <span class="n">x</span><span class="o">.</span><span class="n">slice</span><span class="p">[</span><span class="n">indices</span><span class="p">]</span>
<span class="go">lat <Lat> : 10 N to 30 N (3 values)</span>
</pre></div>
</div>
</dd></dl>
<dl class="method">
<dt id="pygeode.Axis.auxasvar">
<tt class="descclassname">Axis.</tt><tt class="descname">auxasvar</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#pygeode.Axis.auxasvar" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns auxiliary array as a new <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> object.</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>name</strong> : string</p>
<blockquote>
<div><p>Name of auxiliary array to return</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>var</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>Variable with values of requested auxilliary array</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.Axis.auxarrays" title="pygeode.Axis.auxarrays"><tt class="xref py py-obj docutils literal"><span class="pre">auxarrays</span></tt></a></p>
</div>
</dd></dl>
<dl class="method">
<dt id="pygeode.Axis.formatter">
<tt class="descclassname">Axis.</tt><tt class="descname">formatter</tt><big>(</big><big>)</big><a class="headerlink" href="#pygeode.Axis.formatter" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a matplotlib formatter (pygeode.AxisFormatter) for use in plotting.</p>
</dd></dl>
<dl class="method">
<dt id="pygeode.Axis.locator">
<tt class="descclassname">Axis.</tt><tt class="descname">locator</tt><big>(</big><big>)</big><a class="headerlink" href="#pygeode.Axis.locator" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a matplotlib locator object for use in plotting.</p>
</dd></dl>
<dl class="method">
<dt id="pygeode.Axis.rename">
<tt class="descclassname">Axis.</tt><tt class="descname">rename</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#pygeode.Axis.rename" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pygeode.Axis.sorted">
<tt class="descclassname">Axis.</tt><tt class="descname">sorted</tt><big>(</big><em>reverse=None</em><big>)</big><a class="headerlink" href="#pygeode.Axis.sorted" title="Permalink to this definition">¶</a></dt>
<dd><p>Sorts the points of the Axis.</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>reverse</strong> : boolean (optional)</p>
<blockquote>
<div><p>If <tt class="docutils literal"><span class="pre">True</span></tt>, sorts in descending order. If <tt class="docutils literal"><span class="pre">False</span></tt>, sorts in ascending order.
By default the sign of self.plotorder is used.</p>
</div></blockquote>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>sorted_axis</strong> : Axis</p>
<blockquote class="last">
<div><p>A sorted version of the input axis.</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.Axis.argsort" title="pygeode.Axis.argsort"><tt class="xref py py-obj docutils literal"><span class="pre">argsort</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</span> <span class="kn">import</span> <span class="n">Lat</span>
<span class="gp">>>> </span><span class="n">x</span> <span class="o">=</span> <span class="n">Lat</span><span class="p">([</span><span class="mi">30</span><span class="p">,</span><span class="mi">20</span><span class="p">,</span><span class="mi">10</span><span class="p">])</span>
<span class="gp">>>> </span><span class="k">print</span> <span class="n">x</span>
<span class="gp">>>> </span><span class="n">y</span> <span class="o">=</span> <span class="n">x</span><span class="o">.</span><span class="n">sorted</span><span class="p">()</span>
<span class="gp">>>> </span><span class="k">print</span> <span class="n">y</span>
</pre></div>
</div>
</dd></dl>
<dl class="method">
<dt id="pygeode.Axis.str_as_val">
<tt class="descclassname">Axis.</tt><tt class="descname">str_as_val</tt><big>(</big><em>key</em>, <em>s</em><big>)</big><a class="headerlink" href="#pygeode.Axis.str_as_val" title="Permalink to this definition">¶</a></dt>
<dd><p>str_as_val(self, key, s) - converts string s to a value corresponding to this axis. Default
implementation returns float(s); derived classes can return different conversions depending
on whether key corresponds to the axis itself or an auxiliary array.</p>
</dd></dl>
<dl class="method">
<dt id="pygeode.Axis.__call__">
<tt class="descclassname">Axis.</tt><tt class="descname">__call__</tt><big>(</big><em>**kwargs</em><big>)</big><a class="headerlink" href="#pygeode.Axis.__call__" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="method">
<dt id="pygeode.Axis._getitem_asvar">
<tt class="descclassname">Axis.</tt><tt class="descname">_getitem_asvar</tt><big>(</big><em>slices</em><big>)</big><a class="headerlink" href="#pygeode.Axis._getitem_asvar" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="classmethod">
<dt id="pygeode.Axis.class_has_alias">
<em class="property">classmethod </em><tt class="descclassname">Axis.</tt><tt class="descname">class_has_alias</tt><big>(</big><em>name</em><big>)</big><a class="headerlink" href="#pygeode.Axis.class_has_alias" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="classmethod">
<dt id="pygeode.Axis.isparentof">
<em class="property">classmethod </em><tt class="descclassname">Axis.</tt><tt class="descname">isparentof</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#pygeode.Axis.isparentof" title="Permalink to this definition">¶</a></dt>
<dd><p>Determines if an axis object is an instance of a base class (or the same
class) of another axis.</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>other</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 to compare against this one.</p>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first"><strong>bool</strong> : boolean</p>
<blockquote class="last">
<div><p>True if <tt class="docutils literal"><span class="pre">other</span></tt> is an instance of this object’s class</p>
</div></blockquote>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="pygeode.Axis.map_to">
<tt class="descclassname">Axis.</tt><tt class="descname">map_to</tt><big>(</big><em>other</em><big>)</big><a class="headerlink" href="#pygeode.Axis.map_to" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns indices of this axis which correspond to the axis <tt class="docutils literal"><span class="pre">other</span></tt>.</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>other</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></p>
<blockquote>
<div><p>Axis to find mapping to</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>mapping</strong> : integer array or None</p>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Notes</p>
<p>Returns an ordered indices of the elements of this axis that correspond to those of
the axis <tt class="docutils literal"><span class="pre">other</span></tt>, if one exists, otherwise None. This axis must be a
parent class of <tt class="docutils literal"><span class="pre">other</span></tt> or vice versa in order for the mapping to
exist. The mapping may include only a subset of this axis object, but
must be as long as the other axis, if it is not None. The mapping
identifies equivalent elements based on equality up to a tolerance
specified by self.rtol.</p>
</dd></dl>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="axes.html"
title="previous chapter">Axis class overview</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="namedaxis.html"
title="next chapter">NamedAxis object reference</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/axis.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="namedaxis.html" title="NamedAxis object reference"
>next</a> |</li>
<li class="right" >
<a href="axes.html" title="Axis 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="axes.html" >Axis 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>