-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnamedaxis.html
289 lines (268 loc) · 21.6 KB
/
namedaxis.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>NamedAxis object reference — PyGeode 1.4.1-rc2 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="_static/pygtheme.css" />
<link rel="stylesheet" type="text/css" href="_static/plot_directive.css" />
<link rel="stylesheet" type="text/css" href="_static/sg_gallery.css" />
<link rel="stylesheet" type="text/css" href="_static/sg_gallery-binder.css" />
<link rel="stylesheet" type="text/css" href="_static/sg_gallery-dataframe.css" />
<link rel="stylesheet" type="text/css" href="_static/sg_gallery-rendered-html.css" />
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<link rel="shortcut icon" href="_static/pygeode_icon.ico"/>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Horizonal axis objects reference" href="horizontalaxes.html" />
<link rel="prev" title="Axis class reference" href="axis.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="header" role="banner"><img class="logo" src="_static/pygeode_logo.png" width=79px alt="Logo"/>
<h1 class="heading"><a href="index.html">
<span>PyGeode 1.4.1-rc2 documentation</span></a></h1>
<h2 class="heading"><span>NamedAxis object reference</span></h2>
</div>
<div class="topnav" role="navigation" aria-label="top navigation">
<p>
«  <a href="axis.html">Axis class reference</a>
  ::  
<a class="uplink" href="reference.html">Reference</a>
  ::  
<a class="uplink" href="tutorial.html">Tutorial</a>
  ::  
<a class="uplink" href="gallery/index.html">Gallery</a>
  ::  
<a href="horizontalaxes.html">Horizonal axis objects reference</a>  »
</p>
</div>
<div class="content">
<div class="section" id="namedaxis-object-reference">
<h1>NamedAxis object reference<a class="headerlink" href="#namedaxis-object-reference" title="Permalink to this headline">¶</a></h1>
<dl class="py class">
<dt class="sig sig-object py" id="pygeode.NamedAxis">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">pygeode.</span></span><span class="sig-name descname"><span class="pre">NamedAxis</span></span><a class="reference internal" href="_modules/pygeode/axis.html#NamedAxis"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pygeode.NamedAxis" title="Permalink to this definition">¶</a></dt>
<dd><p>Inherits from <a class="reference internal" href="axes.html#pygeode.Axis" title="pygeode.Axis"><code class="xref py py-class docutils literal notranslate"><span class="pre">Axis</span></code></a></p>
<p>Generic axis identified by the instances name. Unlike other axes classes,
NamedAxis objects must have the same name in order for two axes to be mapped
to one another.</p>
<p class="rubric">New or Overridden Methods</p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#pygeode.NamedAxis.__init__" title="pygeode.NamedAxis.__init__"><code class="xref py py-obj docutils literal notranslate"><span class="pre">NamedAxis.__init__</span></code></a>(values, name, **kwargs)</p></td>
<td><p>Create a new Axis object with the given values.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pygeode.NamedAxis.map_to" title="pygeode.NamedAxis.map_to"><code class="xref py py-obj docutils literal notranslate"><span class="pre">NamedAxis.map_to</span></code></a>(other)</p></td>
<td><p>Returns indices of this axis which correspond to the axis <code class="docutils literal notranslate"><span class="pre">other</span></code>.</p></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="pygeode.NamedAxis.__init__">
<span class="sig-prename descclassname"><span class="pre">NamedAxis.</span></span><span class="sig-name descname"><span class="pre">__init__</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">values</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">name</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pygeode/axis.html#NamedAxis.__init__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pygeode.NamedAxis.__init__" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a new Axis object with the given values.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl class="simple">
<dt><strong>values</strong><span class="classifier">numpy.ndarray</span></dt><dd><p>A one-dimensional coordinate defining the axis grid.</p>
</dd>
<dt><strong>name</strong><span class="classifier">string (optional)</span></dt><dd><p>What to call the axis (i.e. for plot titles & when saving to file)</p>
</dd>
<dt><strong>atts</strong><span class="classifier">dict (optional)</span></dt><dd><p>Any additional metadata to associate with the axis. The dictionary
keys should be strings.</p>
</dd>
<dt><strong>plotatts</strong><span class="classifier">dict (optional)</span></dt><dd><p>Parameters that control plotting behaviour; default values are available.
The dictionary keys should be strings.</p>
</dd>
<dt><strong>rtol</strong><span class="classifier">float</span></dt><dd><p>A relative tolerance used for identifying an element of this axis.</p>
</dd>
</dl>
</dd>
</dl>
<p class="rubric">Notes</p>
<p>All subclasses of <a class="reference internal" href="axes.html#pygeode.Axis" title="pygeode.Axis"><code class="xref py py-class docutils literal notranslate"><span class="pre">Axis</span></code></a> need to call this __init__ method within
their own __init__, to properly initialize all attributes.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="pygeode.NamedAxis.map_to">
<span class="sig-prename descclassname"><span class="pre">NamedAxis.</span></span><span class="sig-name descname"><span class="pre">map_to</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">other</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pygeode/axis.html#NamedAxis.map_to"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pygeode.NamedAxis.map_to" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns indices of this axis which correspond to the axis <code class="docutils literal notranslate"><span class="pre">other</span></code>.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl>
<dt><strong>other</strong><span class="classifier"><a class="reference internal" href="axes.html#pygeode.Axis" title="pygeode.Axis"><code class="xref py py-class docutils literal notranslate"><span class="pre">Axis</span></code></a></span></dt><dd><p>Axis to find mapping to</p>
</dd>
</dl>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><dl class="simple">
<dt><strong>mapping</strong><span class="classifier">integer array or None</span></dt><dd></dd>
</dl>
</dd>
</dl>
<p class="rubric">Notes</p>
<p>Returns an ordered indices of the elements of this axis that correspond to those of
the axis <code class="docutils literal notranslate"><span class="pre">other</span></code>, if one exists, otherwise None. This axis must be a
parent class of <code class="docutils literal notranslate"><span class="pre">other</span></code> 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>
<dl class="py class">
<dt class="sig sig-object py" id="pygeode.NonCoordinateAxis">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">pygeode.</span></span><span class="sig-name descname"><span class="pre">NonCoordinateAxis</span></span><a class="reference internal" href="_modules/pygeode/axis.html#NonCoordinateAxis"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pygeode.NonCoordinateAxis" title="Permalink to this definition">¶</a></dt>
<dd><p>Inherits from <a class="reference internal" href="axes.html#pygeode.Axis" title="pygeode.Axis"><code class="xref py py-class docutils literal notranslate"><span class="pre">Axis</span></code></a></p>
<p>An axis for non-coordinate dimensions (e.g. categorical data such as stations, etc.).</p>
<p class="rubric">New or Overridden Methods</p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#pygeode.NonCoordinateAxis.__init__" title="pygeode.NonCoordinateAxis.__init__"><code class="xref py py-obj docutils literal notranslate"><span class="pre">NonCoordinateAxis.__init__</span></code></a>(*args, **kwargs)</p></td>
<td><p>Create a new Axis object with the given values.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pygeode.NonCoordinateAxis.map_to" title="pygeode.NonCoordinateAxis.map_to"><code class="xref py py-obj docutils literal notranslate"><span class="pre">NonCoordinateAxis.map_to</span></code></a>(other)</p></td>
<td><p>Returns indices of this axis which correspond to the axis <code class="docutils literal notranslate"><span class="pre">other</span></code>.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#pygeode.NonCoordinateAxis.str_as_val" title="pygeode.NonCoordinateAxis.str_as_val"><code class="xref py py-obj docutils literal notranslate"><span class="pre">NonCoordinateAxis.str_as_val</span></code></a>(key, s)</p></td>
<td><p>str_as_val(self, key, s) - converts string s to a value corresponding to this axis.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#pygeode.NonCoordinateAxis.formatvalue" title="pygeode.NonCoordinateAxis.formatvalue"><code class="xref py py-obj docutils literal notranslate"><span class="pre">NonCoordinateAxis.formatvalue</span></code></a>(value[, fmt, ...])</p></td>
<td><p>Returns formatted string representation of <code class="docutils literal notranslate"><span class="pre">value</span></code>.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#pygeode.NonCoordinateAxis.__eq__" title="pygeode.NonCoordinateAxis.__eq__"><code class="xref py py-obj docutils literal notranslate"><span class="pre">NonCoordinateAxis.__eq__</span></code></a>(other)</p></td>
<td><p>override Var's ufunc stuff here this is a weak comparison, in that we only require the other axis to be a <em>subclass</em> of this one.</p></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="pygeode.NonCoordinateAxis.__init__">
<span class="sig-prename descclassname"><span class="pre">NonCoordinateAxis.</span></span><span class="sig-name descname"><span class="pre">__init__</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pygeode/axis.html#NonCoordinateAxis.__init__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pygeode.NonCoordinateAxis.__init__" title="Permalink to this definition">¶</a></dt>
<dd><p>Create a new Axis object with the given values.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl class="simple">
<dt><strong>values</strong><span class="classifier">numpy.ndarray</span></dt><dd><p>A one-dimensional coordinate defining the axis grid.</p>
</dd>
<dt><strong>name</strong><span class="classifier">string (optional)</span></dt><dd><p>What to call the axis (i.e. for plot titles & when saving to file)</p>
</dd>
<dt><strong>atts</strong><span class="classifier">dict (optional)</span></dt><dd><p>Any additional metadata to associate with the axis. The dictionary
keys should be strings.</p>
</dd>
<dt><strong>plotatts</strong><span class="classifier">dict (optional)</span></dt><dd><p>Parameters that control plotting behaviour; default values are available.
The dictionary keys should be strings.</p>
</dd>
<dt><strong>rtol</strong><span class="classifier">float</span></dt><dd><p>A relative tolerance used for identifying an element of this axis.</p>
</dd>
</dl>
</dd>
</dl>
<p class="rubric">Notes</p>
<p>All subclasses of <a class="reference internal" href="axes.html#pygeode.Axis" title="pygeode.Axis"><code class="xref py py-class docutils literal notranslate"><span class="pre">Axis</span></code></a> need to call this __init__ method within
their own __init__, to properly initialize all attributes.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="pygeode.NonCoordinateAxis.map_to">
<span class="sig-prename descclassname"><span class="pre">NonCoordinateAxis.</span></span><span class="sig-name descname"><span class="pre">map_to</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">other</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pygeode/axis.html#NonCoordinateAxis.map_to"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pygeode.NonCoordinateAxis.map_to" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns indices of this axis which correspond to the axis <code class="docutils literal notranslate"><span class="pre">other</span></code>.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl>
<dt><strong>other</strong><span class="classifier"><a class="reference internal" href="axes.html#pygeode.Axis" title="pygeode.Axis"><code class="xref py py-class docutils literal notranslate"><span class="pre">Axis</span></code></a></span></dt><dd><p>Axis to find mapping to</p>
</dd>
</dl>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><dl class="simple">
<dt><strong>mapping</strong><span class="classifier">integer array or None</span></dt><dd></dd>
</dl>
</dd>
</dl>
<p class="rubric">Notes</p>
<p>Returns an ordered indices of the elements of this axis that correspond to those of
the axis <code class="docutils literal notranslate"><span class="pre">other</span></code>, if one exists, otherwise None. This axis must be a
parent class of <code class="docutils literal notranslate"><span class="pre">other</span></code> 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>
<dl class="py method">
<dt class="sig sig-object py" id="pygeode.NonCoordinateAxis.str_as_val">
<span class="sig-prename descclassname"><span class="pre">NonCoordinateAxis.</span></span><span class="sig-name descname"><span class="pre">str_as_val</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">key</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">s</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pygeode/axis.html#NonCoordinateAxis.str_as_val"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pygeode.NonCoordinateAxis.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="py method">
<dt class="sig sig-object py" id="pygeode.NonCoordinateAxis.formatvalue">
<span class="sig-prename descclassname"><span class="pre">NonCoordinateAxis.</span></span><span class="sig-name descname"><span class="pre">formatvalue</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">value</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">fmt</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">units</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">unitstr</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pygeode/axis.html#NonCoordinateAxis.formatvalue"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pygeode.NonCoordinateAxis.formatvalue" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns formatted string representation of <code class="docutils literal notranslate"><span class="pre">value</span></code>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl class="simple">
<dt><strong>value</strong><span class="classifier">float or int</span></dt><dd><p>Value to format.</p>
</dd>
<dt><strong>fmt</strong><span class="classifier">string (optional)</span></dt><dd><p>Format specification. If the default <code class="docutils literal notranslate"><span class="pre">None</span></code> is specified,
<code class="docutils literal notranslate"><span class="pre">self.formatstr</span></code> is used.</p>
</dd>
<dt><strong>units</strong><span class="classifier">boolean (optional)</span></dt><dd><p>If <code class="docutils literal notranslate"><span class="pre">True</span></code>, will include the units in the string returned.
Default is <code class="docutils literal notranslate"><span class="pre">True</span></code>.</p>
</dd>
<dt><strong>unitstr</strong><span class="classifier">string (optional)</span></dt><dd><p>String to use for the units; default is <code class="docutils literal notranslate"><span class="pre">self.units</span></code>.</p>
</dd>
</dl>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><dl class="simple">
<dt>If units is True, fmt % value + ‘ ‘ + unitstr. Otherwise fmt % value.</dt><dd></dd>
</dl>
</dd>
</dl>
<p class="rubric">Notes</p>
<p>This is overridden in a number of Axis classes for more sophisticated formatting.</p>
</dd></dl>
<dl class="py method">
<dt class="sig sig-object py" id="pygeode.NonCoordinateAxis.__eq__">
<span class="sig-prename descclassname"><span class="pre">NonCoordinateAxis.</span></span><span class="sig-name descname"><span class="pre">__eq__</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">other</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pygeode/axis.html#NonCoordinateAxis.__eq__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pygeode.NonCoordinateAxis.__eq__" title="Permalink to this definition">¶</a></dt>
<dd><p>override Var’s ufunc stuff here
this is a weak comparison, in that we only require the other
axis to be a <em>subclass</em> of this one.
this allows things like “lat in [time,gausslat,lev]” to evaluate to True
If you want a more strict comparison, then check the classes explicitly yourself.</p>
</dd></dl>
</div>
</div>
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
<p>
«  <a href="axis.html">Axis class reference</a>
  ::  
<a class="uplink" href="reference.html">Reference</a>
  ::  
<a class="uplink" href="tutorial.html">Tutorial</a>
  ::  
<a class="uplink" href="gallery/index.html">Gallery</a>
  ::  
<a href="horizontalaxes.html">Horizonal axis objects reference</a>  »
</p>
</div>
<div class="footer" role="contentinfo">
© Copyright 2020, Mike Neish, Peter Hitchcock.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2.
</div>
</body>
</html>