source: trunk/SRC/Documentation/idldoc_assistant_output/Interpolation/spl_keep_mean.html @ 177

Last change on this file since 177 was 177, checked in by smasson, 18 years ago

updates of html files...

File size: 6.2 KB
Line 
1
2
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4  <head>
5    <title>spl_keep_mean.pro (SAXO Documentation Assistant)</title>
6  </head>
7
8  <body text="#000000" bgcolor="#FFFFFF">
9
10   
11<!-- Navbar template takes a structure with the following fields:
12       overview_href :
13       overview_selected :
14       dir_overview_href :
15       dir_overview_selected :
16       categories_href :
17       categories_selected :
18       index_href :
19       index_selected :
20       search_href :
21       search_selected :
22       file_selected :
23       source_href :
24       source_selected :
25       help_href :
26       help_selected :
27       etc_selected :
28
29       prev_file_href :
30       next_file_href :
31
32       view_single_page_href :
33       view_frames_href :
34
35       summary_fields_href :
36       summary_routine_href :
37       details_routine_href :
38
39       title :
40       subtitle :
41       user :
42-->
43
44
45<table border="0" cellpadding="0" cellspacing="0" width="98%" bgcolor="#F0F0FF" valign="bottom">
46  <tr>
47    <td width="10%">
48<a href="spl_incr.html"><img src="./../prev.gif" border="0" alt="Previous"></a></td>
49    <td width="80%" align="center" valign="center">
50<font size=-1><i>SAXO Documentation Assistant</i>: <a href="./../home.html">Overview</a></font></td>
51    <td width="10%" align="right">
52<a href="square2quadrilateral.html"><img src="./../next.gif" border="0" alt="Next"></a></td>
53  </tr>
54</table>
55
56
57    <h1><font size="-2">Interpolation/</font></h1>
58    <h2>spl_keep_mean.pro</h2>
59
60    <dl>
61    </dl>
62
63   
64
65 Given the arrays X and Y, which tabulate a function (with the X[i]
66 AND Y[i] in ascending order), and given an input value X2, the
67 SPL_INCR function returns an interpolated value for the given values
68 of X2. The interpolation method is based on cubic spline, corrected
69 in a way that integral of the interpolated values is the same as the
70 integral of the input values. (-> for exemple to build daily data
71 from monthly mean and keep the monthly mean of the computed daily
72 data equa to the original values)
73
74
75   
76
77     
78      <a name="#_spl_keep_mean"></a>
79
80      <h2>spl_keep_mean  </h2>
81
82      <p><font face="Courier"><i>result = </i>spl_keep_mean(<i><a href="#_spl_keep_mean_keyword_x">x</a>, <a href="#_spl_keep_mean_keyword_yin">yin</a>, <a href="#_spl_keep_mean_keyword_x2">x2</a></i>, <a href="#_spl_keep_mean_keyword_YP0">YP0</a>=<i>YP0</i>, <a href="#_spl_keep_mean_keyword_YPN_1">YPN_1</a>=<i>YPN_1</i>, <a href="#_spl_keep_mean_keyword_GE0">GE0</a>=<i>GE0</i>)</font></p>
83
84   
85
86    <h3>Return value</h3>
87 y2: the mean value between two consecutive values of x2. This
88 array has one element less than y2. y2 has double precision.
89
90
91   
92    <h3>Parameters</h3>
93   
94
95    <a name="#_spl_keep_mean_keyword_x"></a>
96    <h4>x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
97      <font size="-1" color="#006633">in</font>
98     
99     
100      <font size="-1" color="#006633">required</font>
101     
102     
103     
104     
105    </h4>
106
107   
108 An n-element (at least 2) input vector that specifies the tabulate points in
109 a strict ascending order.
110
111   
112
113    <a name="#_spl_keep_mean_keyword_yin"></a>
114    <h4>yin&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
115      <font size="-1" color="#006633">in</font>
116     
117     
118      <font size="-1" color="#006633">required</font>
119     
120      <font size="-1" color="#006633">type:</font> <font size="-1" color="#006633"><i>array</i></font>
121     
122     
123    </h4>
124
125   
126 an array with one element less than x. y[i] represents the
127 mean value between x[i] and x[i+1]. if /GE0 is activated, y must
128 have positive values.
129
130   
131
132    <a name="#_spl_keep_mean_keyword_x2"></a>
133    <h4>x2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
134      <font size="-1" color="#006633">in</font>
135     
136     
137      <font size="-1" color="#006633">required</font>
138     
139     
140     
141     
142    </h4>
143
144   
145 The input values for which the interpolated values are desired.
146 Its values must be strictly monotonically increasing.
147
148   
149   
150
151   
152    <h3>Keywords</h3>
153
154   
155    <a name="#_spl_keep_mean_keyword_YP0"></a>
156    <h4>YP0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
157     
158     
159     
160     
161     
162     
163     
164     
165    </h4>
166
167   
168 The first derivative of the interpolating function at the
169 point X0. If YP0 is omitted, the second derivative at the
170 boundary is set to zero, resulting in a "natural spline."
171
172   
173    <a name="#_spl_keep_mean_keyword_YPN_1"></a>
174    <h4>YPN_1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
175     
176     
177     
178     
179     
180     
181     
182     
183    </h4>
184
185   
186 The first derivative of the interpolating function at the
187 point Xn-1. If YPN_1 is omitted, the second derivative at the
188 boundary is set to zero, resulting in a "natural spline."
189
190   
191    <a name="#_spl_keep_mean_keyword_GE0"></a>
192    <h4>GE0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
193     
194     
195     
196     
197     
198     
199     
200     
201    </h4>
202
203   
204 to force that y2 is always GE than 0. In that case, y must also be GE than 0.
205
206   
207   
208
209    <h3>Examples</h3>
210
211    12 monthly values of precipitations into daily values:
212
213 IDL> yr1 = 1990
214 IDL> yr2 = 1992
215 IDL> nyr = yr2-yr1+1
216 IDL> n1 = 12*nyr+1
217 IDL> x = julday(1+findgen(n1), replicate(1, n1) $
218 IDL>        , replicate(yr1, n1), fltarr(n1))
219 IDL> n2 = 365*nyr + total(leapyr(yr1+indgen(nyr))) + 1
220 IDL> x2 = julday(replicate(1, n2), 1+findgen(n2) $
221 IDL>            , replicate(yr1, n2), fltarr(n2))
222 IDL> y = abs(randomn(0, n1-1))
223 IDL> y2 = spl_keep_mean(x, y, x2, /ge0)
224
225 IDL> print, min(x, max = ma), ma
226 IDL> print, min(x2, max = ma), ma
227 IDL> print, vairdate([min(x, max = ma), ma])
228 IDL> print, total(y*(x[1:n1-1]-x[0:n1-2]))
229 IDL> print, total(y2*(x2[1:n2-1]-x2[0:n2-2]))
230
231    <h3>Version history</h3>
232   
233    <h4>Version</h4> $Id: spl_keep_mean.pro 163 2006-08-29 12:59:46Z navarro $
234
235    <h4>History</h4>
236  Sebastien Masson (smasson@lodyc.jussieu.fr): May 2005
237
238   
239
240    <h3>Known issues</h3>
241   
242   
243   
244    <h4>Restrictions</h4>
245 It might be possible that y2 has very small negative values
246 (amplitude smaller than 1.e-6)...
247
248
249   
250   
251   
252   
253   
254   
255   
256
257    <font size="-3"><p>&nbsp;</p></font>
258    <hr size="1" color="#CCCCCC"/>
259     
260
261   
262
263    <p><font color="gray" size="-3">&nbsp;&nbsp;Produced by IDLdoc 2.0 on Wed Sep 13 16:32:16 2006.</font></p>
264
265  </body>
266</html>
Note: See TracBrowser for help on using the repository browser.