[ncl-talk] Time interpolation problem, annual to monthly
Adam Phillips
asphilli at ucar.edu
Mon Feb 5 15:44:32 MST 2018
Hi Hyacinth,
Are your x&time and y&time arrays in the same range? The following worked
for me:
x = (/1,2,3./)
x!0 = "time"
x&time = (/1980.5,1981.5,1982.5/)
time2 = yyyymm_time(1980,1982,"float")
time3 = yyyymm_to_yyyyfrac(time2,0) ; creating time in units of fraction
to match x&time
xNew = linint1(x&time,x,False,time3,0)
print(xNew)
Variable: xNew
Type: float
Total Size: 144 bytes
36 values
Number of Dimensions: 1
Dimensions and sizes: [36]
Coordinates:
Number Of Attributes: 1
_FillValue : 9.96921e+36
(0) 9.96921e+36
(1) 9.96921e+36
(2) 9.96921e+36
(3) 9.96921e+36
(4) 9.96921e+36
(5) 9.96921e+36
(6) 1
(7) 1.083374
(8) 1.166626
(9) 1.25
(10) 1.333374
(11) 1.416626
(12) 1.5
(13) 1.583374
(14) 1.666626
(15) 1.75
(16) 1.833374
(17) 1.916626
(18) 2
(19) 2.083374
(20) 2.166626
(21) 2.25
(22) 2.333374
(23) 2.416626
(24) 2.5
(25) 2.583374
(26) 2.666626
(27) 2.75
(28) 2.833374
(29) 2.916626
(30) 3
(31) 9.96921e+36
(32) 9.96921e+36
(33) 9.96921e+36
(34) 9.96921e+36
(35) 9.96921e+36
Hope that helps. If not, or if you have further questions please respond to
the ncl-talk email list only.
Adam
On Mon, Feb 5, 2018 at 11:49 AM, Hyacinth Nnamchi <hyacinth.1 at hotmail.com>
wrote:
> Hi NLCers,
>
>
> I have an annual time series I want to re-interpolate to monthly values. I
> do this and get the correct size but everything is missing (and setting the
> @_FillValue and @missingvalue doesn't change result).
>
>
> x is an annual time series, 80 years
>
> y is a monthly time series, 80 years (i.e. 80 x 12 months)
>
>
> xNew = linint1_n(x&time,x,False,y&time,0,0)
>
>
> This new time series (xNew) contains all missing values (monthly, 80
> years). Defining x&time and y&time outside the equation doesn't change the
> result.
>
>
> Does anyone know why I'm having the wrong values?
>
>
> Thanks in advance.
>
>
> Hyacinth
>
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
--
Adam Phillips
Associate Scientist, Climate and Global Dynamics Laboratory, NCAR
www.cgd.ucar.edu/staff/asphilli/ 303-497-1726
<http://www.cgd.ucar.edu/staff/asphilli>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180205/ce82f761/attachment.html>
More information about the ncl-talk
mailing list