-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtimeutils.html
186 lines (165 loc) · 16 KB
/
timeutils.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Timeutils module — 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="Climat module" href="climat.html" />
<link rel="prev" title="File Input and Output" href="fileio.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>Timeutils module</span></h2>
</div>
<div class="topnav" role="navigation" aria-label="top navigation">
<p>
«  <a href="fileio.html">File Input and Output</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="climat.html">Climat module</a>  »
</p>
</div>
<div class="content">
<div class="section" id="timeutils-module">
<h1>Timeutils module<a class="headerlink" href="#timeutils-module" title="Permalink to this headline">¶</a></h1>
<dl class="py function">
<dt class="sig sig-object py" id="pygeode.timeutils.conform_values">
<span class="sig-prename descclassname"><span class="pre">pygeode.timeutils.</span></span><span class="sig-name descname"><span class="pre">conform_values</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">taxis1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">taxis2</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pygeode/timeutils.html#conform_values"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pygeode.timeutils.conform_values" title="Permalink to this definition">¶</a></dt>
<dd><p>Given two time axes, return new axes such that their values are comparable.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="pygeode.timeutils.date_diff">
<span class="sig-prename descclassname"><span class="pre">pygeode.timeutils.</span></span><span class="sig-name descname"><span class="pre">date_diff</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">taxis</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dt1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dt2</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">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pygeode/timeutils.html#date_diff"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pygeode.timeutils.date_diff" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns time interval between two dates. A time axis must be given
to specify the calendar. If no units are specified the units of the given
time axis are used.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="pygeode.timeutils.delta">
<span class="sig-prename descclassname"><span class="pre">pygeode.timeutils.</span></span><span class="sig-name descname"><span class="pre">delta</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">taxis</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">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">allow_multiple</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pygeode/timeutils.html#delta"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pygeode.timeutils.delta" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the interval between values of a given time axis. If
non-unique intervals are found an exception is raised. The units
can be specified; if none are given the units of the given time axis
are used.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="pygeode.timeutils.jointimeaxes">
<span class="sig-prename descclassname"><span class="pre">pygeode.timeutils.</span></span><span class="sig-name descname"><span class="pre">jointimeaxes</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">var</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">yaxis</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'year'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">daxis</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'day'</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pygeode/timeutils.html#jointimeaxes"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pygeode.timeutils.jointimeaxes" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a variable with a 2D time axis into one with a 1D time axis.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="pygeode.timeutils.modify">
<span class="sig-prename descclassname"><span class="pre">pygeode.timeutils.</span></span><span class="sig-name descname"><span class="pre">modify</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">taxis</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">resolution</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">exclude</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">[]</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">include</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">[]</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">uniquify</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pygeode/timeutils.html#modify"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pygeode.timeutils.modify" title="Permalink to this definition">¶</a></dt>
<dd><p>Modifies the auxiliary arrays associated with a time axis.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl class="simple">
<dt><strong>taxis</strong><span class="classifier">time axis instance</span></dt><dd><p>Time axis to modify</p>
</dd>
<dt><strong>resolution</strong><span class="classifier">{None, ‘year’, ‘month’, ‘day’, ‘hour’, ‘minute’, ‘second’}, optional</span></dt><dd><p>Finest division to retain.</p>
</dd>
<dt><strong>exclude</strong><span class="classifier">list of strings, optional</span></dt><dd><p>List of arrays to remove</p>
</dd>
<dt><strong>include</strong><span class="classifier">list of strings, optional</span></dt><dd><p>Explicit list of arrays to include</p>
</dd>
</dl>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><dl class="simple">
<dt><strong>taxis</strong><span class="classifier">time axis instance</span></dt><dd><p>Modified time axis</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="pygeode.timeutils.reltime">
<span class="sig-prename descclassname"><span class="pre">pygeode.timeutils.</span></span><span class="sig-name descname"><span class="pre">reltime</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">taxis</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">startdate</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">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pygeode/timeutils.html#reltime"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pygeode.timeutils.reltime" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns time axis values relative to a given reference date. The units can be
be specified, if none are given the units of the given time axis are used.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="pygeode.timeutils.removeleapyears">
<span class="sig-prename descclassname"><span class="pre">pygeode.timeutils.</span></span><span class="sig-name descname"><span class="pre">removeleapyears</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="pre">data,</span> <span class="pre">omitdoy_leap=[60],</span> <span class="pre">omitdoy_noleap=[],</span> <span class="pre">new_axis_type=<class</span> <span class="pre">'pygeode.timeaxis.ModelTime365'></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pygeode/timeutils.html#removeleapyears"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pygeode.timeutils.removeleapyears" title="Permalink to this definition">¶</a></dt>
<dd><p>Removes leap day(s) from data on a standard calendar. Casts variable with
a <code class="xref py py-class docutils literal notranslate"><span class="pre">StandardTime</span></code> time axis onto a time axis with a uniform year length
by removing days from leap years.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl>
<dt><strong>data</strong><span class="classifier"><code class="xref py py-class docutils literal notranslate"><span class="pre">Var</span></code></span></dt><dd><p>The variable to modify. Should have a <code class="xref py py-class docutils literal notranslate"><span class="pre">Time</span></code> axis.</p>
</dd>
<dt><strong>omitdoy_leap</strong><span class="classifier">list, optional [ [60] ]</span></dt><dd><p>A list of days of the year (e.g. 1 is 1 January, 60 is 29 February) to remove
from leap years.</p>
</dd>
<dt><strong>omitdoy_noleap</strong><span class="classifier">list, optional [ [] ]</span></dt><dd><p>A list of days of the year (e.g. 1 is 1 January, 60 is 1 March) to remove
from non-leap years. Can be empty.</p>
</dd>
<dt><strong>new_axis_type</strong><span class="classifier"><code class="xref py py-class docutils literal notranslate"><span class="pre">CalendarTime</span></code>, optional</span></dt><dd><p>Time axis class to use instead. Default is <code class="xref py py-class docutils literal notranslate"><span class="pre">ModelTime365</span></code>. Should
expect a year length consistent with the lists passed to omitdoy_leap and
omitdoy_noleap</p>
</dd>
</dl>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><dl class="simple">
<dt>New <code class="xref py py-class docutils literal notranslate"><span class="pre">Var</span></code> object with modified time axis and specified days removed</dt><dd></dd>
<dt>from leap year.</dt><dd></dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="pygeode.timeutils.splittimeaxis">
<span class="sig-prename descclassname"><span class="pre">pygeode.timeutils.</span></span><span class="sig-name descname"><span class="pre">splittimeaxis</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">var</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">iaxis</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'time'</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pygeode/timeutils.html#splittimeaxis"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pygeode.timeutils.splittimeaxis" title="Permalink to this definition">¶</a></dt>
<dd><p>Convert a variable with a 1D time axis into one with a 2D time axis.</p>
</dd></dl>
<dl class="py function">
<dt class="sig sig-object py" id="pygeode.timeutils.wrapdate">
<span class="sig-prename descclassname"><span class="pre">pygeode.timeutils.</span></span><span class="sig-name descname"><span class="pre">wrapdate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">taxis</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">dt</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">allfields</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="_modules/pygeode/timeutils.html#wrapdate"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#pygeode.timeutils.wrapdate" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a modified date dictionary such that all fields
lie within standard values.</p>
</dd></dl>
</div>
</div>
<div class="bottomnav" role="navigation" aria-label="bottom navigation">
<p>
«  <a href="fileio.html">File Input and Output</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="climat.html">Climat module</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>