source: trunk/SRC/Documentation/idldoc_html_output/Interpolation/spl_keep_mean.html

Last change on this file was 402, checked in by smasson, 15 years ago

update documentation

File size: 7.5 KB
Line 
1
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
5<!-- Generated by IDLdoc 2.0 -->
6
7<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
8  <head>
9    <title>spl_keep_mean.pro (SAXO Documentation)</title>
10
11   
12    <link rel="stylesheet" type="text/css" media="all" href="./../main_files.css" />
13    <link rel="stylesheet" type="text/css" media="print" href="./../main_files_print.css" />
14   
15
16    <script type="text/javascript">
17      function setTitle() {
18        parent.document.title="spl_keep_mean.pro (SAXO Documentation)";
19      }
20    </script>
21  </head>
22
23  <body onload="setTitle();">
24
25    <div id="navbar_title">
26  <h1>SAXO Documentation</h1>
27</div>
28
29
30<div id="main_navbar">
31
32  <table cellspacing="0">
33    <tr>
34     
35      <td><a href="./../overview.html" title="Overview of library">Overview</a></td>
36     
37
38     
39      <td >Directory</td>
40     
41
42     
43      <td><a href="./../idldoc-categories.html" title="Browse library by category">Categories</a></td>
44     
45
46     
47      <td><a href="./../idldoc-index.html" title="Index of files, routines, and parameters">Index</a></td>
48     
49
50     
51      <td><a href="./../search-page.html" title="Search library">Search</a></td>
52     
53
54      <td id="selected">File</td>
55
56     
57      <td><a href="../../../Interpolation//spl_keep_mean.pro" title="Source code of a file">Source</a></td>
58     
59
60     
61      <td><a href="./../idldoc-help.html" title="Help on IDLdoc">Help</a></td>
62     
63
64      <td >Etc</td>
65
66      <td id="flexible">Developer&nbsp;documentation</td>
67    </tr>
68  </table>
69
70</div>
71
72<div id="secondary_navbar">
73
74<a href="spl_incr.html">&lt;&lt;prev file</a> | <a href="square2quadrilateral.html">next file &gt;&gt;</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="spl_keep_mean.html" target="_TOP">view single page</a> | <a href="./../index.html" target="_TOP">view frames</a>&nbsp;&nbsp;&nbsp;&nbsp;summary: fields | routine&nbsp;&nbsp;&nbsp;&nbsp;details: <a href="#routine_details">routine</a>
75
76</div>
77
78
79    <div id="container">
80
81      <h1 class="directory"><a href="directory-overview.html">Interpolation/</a></h1>
82      <h2 class="pro_file">spl_keep_mean.pro</h2>
83
84      <div id="file_attr">
85        <dl>
86        </dl>
87      </div>
88
89      <div id="file_comments">
90 Given the arrays X and Y, which tabulate a function (with the X[i]
91 AND Y[i] in ascending order), and given an input value X2, the
92 <a href="..//Interpolation/spl_incr.html">spl_incr</a> function returns an interpolated value for the given values
93 of X2. The interpolation method is based on cubic spline, corrected
94 in a way that integral of the interpolated values is the same as the
95 integral of the input values. (-> for example to build daily data
96 from monthly mean and keep the monthly mean of the computed daily
97 data equal to the original values)
98</div>
99
100     
101
102     
103
104     
105
106     
107
108      <div id="routine_details">
109       
110
111        <div class="routine_details" id="_spl_keep_mean">
112
113          <h2><a class="top" href="#container">top</a>spl_keep_mean </h2>
114       
115          <p class="header">
116            <span class="result">result = </span>spl_keep_mean(<span class="result"><a href="#_spl_keep_mean_param_x">x</a>, <a href="#_spl_keep_mean_param_yin">yin</a>, <a href="#_spl_keep_mean_param_x2">x2</a></span>, <a href="#_spl_keep_mean_keyword_YP0">YP0</a>=<span class="result">YP0</span>, <a href="#_spl_keep_mean_keyword_YPN_1">YPN_1</a>=<span class="result">YPN_1</span>, <a href="#_spl_keep_mean_keyword_GE0">GE0</a>=<span class="result">GE0</span>)</p>
117       
118          <div class="comments">
119</div>
120
121          <h3>Return value</h3><div class="preformat">
122 y2: the mean value between two consecutive values of x2. This
123 array has one element less than y2. y2 has double precision.
124</div>
125
126         
127            <h3>Parameters</h3>
128       
129           
130            <h4 id="_spl_keep_mean_param_x">x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
131              <span class="attr">in</span>
132             
133             
134              <span class="attr">required</span>
135             
136             
137             
138             
139            </h4>
140       
141          <div class="comments">
142 An n-elements (at least 2) input vector that specifies the tabulate points in
143 a strict ascending order.
144</div>
145           
146            <h4 id="_spl_keep_mean_param_yin">yin&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
147              <span class="attr">in</span>
148             
149             
150              <span class="attr">required</span>
151             
152              <span class="attr">type:</span> <span class="value">array</span>
153             
154             
155            </h4>
156       
157          <div class="comments">
158 an array with one element less than x. y[i] represents the
159 mean value between x[i] and x[i+1]. if /GE0 is activated, y must
160 have positive values.
161</div>
162           
163            <h4 id="_spl_keep_mean_param_x2">x2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
164              <span class="attr">in</span>
165             
166             
167              <span class="attr">required</span>
168             
169             
170             
171             
172            </h4>
173       
174          <div class="comments">
175 The input values for which the interpolated values are desired.
176 Its values must be strictly monotonically increasing.
177</div>
178           
179
180         
181
182         
183
184            <h3>Keywords</h3>
185           
186            <h4 id="_spl_keep_mean_keyword_YP0">YP0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
187             
188             
189             
190             
191             
192             
193             
194             
195            </h4>
196       
197            <div class="comments">
198 The first derivative of the interpolating function at the
199 point X0. If YP0 is omitted, the second derivative at the
200 boundary is set to zero, resulting in a "natural spline."
201</div>
202           
203            <h4 id="_spl_keep_mean_keyword_YPN_1">YPN_1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
204             
205             
206             
207             
208             
209             
210             
211             
212            </h4>
213       
214            <div class="comments">
215 The first derivative of the interpolating function at the
216 point Xn-1. If YPN_1 is omitted, the second derivative at the
217 boundary is set to zero, resulting in a "natural spline."
218</div>
219           
220            <h4 id="_spl_keep_mean_keyword_GE0">GE0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
221             
222             
223             
224             
225             
226             
227             
228             
229            </h4>
230       
231            <div class="comments">
232 to force that y2 is always GE than 0. In that case, y must also be GE than 0.
233</div>
234           
235         
236
237          <h3>Examples</h3><div class="preformat">
238
239 12 monthly values of precipitations into daily values:
240
241   IDL> yr1 = 1990
242   IDL> yr2 = 1992
243   IDL> nyr = yr2-yr1+1
244   IDL> n1 = 12*nyr+1
245   IDL> x = julday(1+findgen(n1), replicate(1, n1) $
246   IDL>        , replicate(yr1, n1), fltarr(n1))
247   IDL> n2 = 365*nyr + total(leapyr(yr1+indgen(nyr))) + 1
248   IDL> x2 = julday(replicate(1, n2), 1+findgen(n2) $
249   IDL>            , replicate(yr1, n2), fltarr(n2))
250   IDL> y = abs(randomn(0, n1-1))
251   IDL> y2 = spl_keep_mean(x, y, x2, /ge0)
252
253   IDL> print, min(x, max = ma), ma
254   IDL> print, min(x2, max = ma), ma
255   IDL> print, vairdate([min(x, max = ma), ma])
256   IDL> print, total(y*(x[1:n1-1]-x[0:n1-2]))
257   IDL> print, total(y2*(x2[1:n2-1]-x2[0:n2-2]))
258</div>
259          <h3>Version history</h3>
260         
261          <h4>Version</h4><div class="preformat">
262 $Id: spl_keep_mean.pro 372 2008-08-08 12:31:53Z pinsard $
263</div>
264          <h4>History</h4><div class="preformat">
265 Sebastien Masson (smasson@lodyc.jussieu.fr): May 2005
266</div>
267         
268         
269          <h3>Known issues</h3>
270         
271         
272         
273          <h4>Restrictions</h4><div class="preformat">
274 It might be possible that y2 has very small negative values
275 (amplitude smaller than 1.e-6)...
276</div>
277       
278         
279         
280         
281         
282         
283         
284         
285       
286          <h3>Statistics</h3>
287          <table class="statistics">
288            <tr><td>McCabe cyclic</td><td>           8</td></tr>
289            <tr><td>McCabe essential</td><td>           1</td></tr>
290            <tr><td>McCabe modular design</td><td>           1</td></tr>
291          </table>
292         
293       
294        </div>
295       
296      </div>
297
298     
299
300      <div id="tagline">Produced by IDLdoc 2.0.</div>
301
302    </div>
303
304  </body>
305</html>
Note: See TracBrowser for help on using the repository browser.