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

Last change on this file since 234 was 234, checked in by pinsard, 17 years ago

new idldoc html and assistant outputs

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
87    <h3>Return value</h3>
88 y2: the mean value between two consecutive values of x2. This
89 array has one element less than y2. y2 has double precision.
90
91
92   
93    <h3>Parameters</h3>
94   
95
96    <a name="#_spl_keep_mean_keyword_x"></a>
97    <h4>x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
98      <font size="-1" color="#006633">in</font>
99     
100     
101      <font size="-1" color="#006633">required</font>
102     
103     
104     
105     
106    </h4>
107
108   
109 An n-element (at least 2) input vector that specifies the tabulate points in
110 a strict ascending order.
111
112   
113
114    <a name="#_spl_keep_mean_keyword_yin"></a>
115    <h4>yin&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
116      <font size="-1" color="#006633">in</font>
117     
118     
119      <font size="-1" color="#006633">required</font>
120     
121      <font size="-1" color="#006633">type:</font> <font size="-1" color="#006633"><i>array</i></font>
122     
123     
124    </h4>
125
126   
127 an array with one element less than x. y[i] represents the
128 mean value between x[i] and x[i+1]. if /GE0 is activated, y must
129 have positive values.
130
131   
132
133    <a name="#_spl_keep_mean_keyword_x2"></a>
134    <h4>x2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
135      <font size="-1" color="#006633">in</font>
136     
137     
138      <font size="-1" color="#006633">required</font>
139     
140     
141     
142     
143    </h4>
144
145   
146 The input values for which the interpolated values are desired.
147 Its values must be strictly monotonically increasing.
148
149   
150   
151
152   
153    <h3>Keywords</h3>
154
155   
156    <a name="#_spl_keep_mean_keyword_YP0"></a>
157    <h4>YP0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
158     
159     
160     
161     
162     
163     
164     
165     
166    </h4>
167
168   
169 The first derivative of the interpolating function at the
170 point X0. If YP0 is omitted, the second derivative at the
171 boundary is set to zero, resulting in a "natural spline."
172
173   
174    <a name="#_spl_keep_mean_keyword_YPN_1"></a>
175    <h4>YPN_1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
176     
177     
178     
179     
180     
181     
182     
183     
184    </h4>
185
186   
187 The first derivative of the interpolating function at the
188 point Xn-1. If YPN_1 is omitted, the second derivative at the
189 boundary is set to zero, resulting in a "natural spline."
190
191   
192    <a name="#_spl_keep_mean_keyword_GE0"></a>
193    <h4>GE0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
194     
195     
196     
197     
198     
199     
200     
201     
202    </h4>
203
204   
205 to force that y2 is always GE than 0. In that case, y must also be GE than 0.
206
207   
208   
209
210    <h3>Examples</h3><pre>
211
212    12 monthly values of precipitations into daily values:
213
214 IDL> yr1 = 1990
215 IDL> yr2 = 1992
216 IDL> nyr = yr2-yr1+1
217 IDL> n1 = 12*nyr+1
218 IDL> x = julday(1+findgen(n1), replicate(1, n1) $
219 IDL>        , replicate(yr1, n1), fltarr(n1))
220 IDL> n2 = 365*nyr + total(leapyr(yr1+indgen(nyr))) + 1
221 IDL> x2 = julday(replicate(1, n2), 1+findgen(n2) $
222 IDL>            , replicate(yr1, n2), fltarr(n2))
223 IDL> y = abs(randomn(0, n1-1))
224 IDL> y2 = spl_keep_mean(x, y, x2, /ge0)
225
226 IDL> print, min(x, max = ma), ma
227 IDL> print, min(x2, max = ma), ma
228 IDL> print, vairdate([min(x, max = ma), ma])
229 IDL> print, total(y*(x[1:n1-1]-x[0:n1-2]))
230 IDL> print, total(y2*(x2[1:n2-1]-x2[0:n2-2]))
231
232    </pre><h3>Version history</h3>
233   
234    <h4>Version</h4>
235 $Id: spl_keep_mean.pro 232 2007-03-20 16:59:36Z pinsard $
236
237    <h4>History</h4>
238  Sebastien Masson (smasson@lodyc.jussieu.fr): May 2005
239
240   
241
242    <h3>Known issues</h3>
243   
244   
245   
246    <h4>Restrictions</h4>
247 It might be possible that y2 has very small negative values
248 (amplitude smaller than 1.e-6)...
249
250
251   
252   
253   
254   
255   
256   
257   
258
259    <font size="-3"><p>&nbsp;</p></font>
260    <hr size="1" color="#CCCCCC"/>
261     
262
263   
264
265    <p><font color="gray" size="-3">&nbsp;&nbsp;Produced by IDLdoc 2.0.</font></p>
266
267  </body>
268</html>
Note: See TracBrowser for help on using the repository browser.