topspl_keep_mean
Return value
y2: the mean value between two consecutive values of x2. This
array has one element less than y2. y2 has double precision.
Parameters
x
in
required
yin
in
required
x2
in
required
Keywords
YP0
YPN_1
GE0
Examples
12 monthly values of precipitations into daily values:
IDL> yr1 = 1990
IDL> yr2 = 1992
IDL> nyr = yr2-yr1+1
IDL> n1 = 12*nyr+1
IDL> x = julday(1+findgen(n1), replicate(1, n1) $
IDL> , replicate(yr1, n1), fltarr(n1))
IDL> n2 = 365*nyr + total(leapyr(yr1+indgen(nyr))) + 1
IDL> x2 = julday(replicate(1, n2), 1+findgen(n2) $
IDL> , replicate(yr1, n2), fltarr(n2))
IDL> y = abs(randomn(0, n1-1))
IDL> y2 = spl_keep_mean(x, y, x2, /ge0)
IDL> print, min(x, max = ma), ma
IDL> print, min(x2, max = ma), ma
IDL> print, vairdate([min(x, max = ma), ma])
IDL> print, total(y*(x[1:n1-1]-x[0:n1-2]))
IDL> print, total(y2*(x2[1:n2-1]-x2[0:n2-2]))
Version history
Version
$Id: spl_keep_mean.pro 136 2006-07-10 15:20:19Z pinsard $
History
Sebastien Masson (smasson@lodyc.jussieu.fr): May 2005
Known issues
Restrictions
It might be possible that y2 has very small negative values
(amplitude smaller than 1.e-6)...