Re: Looping through dtrend function

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Mon Oct 22 2012 - 23:09:21 MDT

[1] dtrend (dtrend_n) returns anomalies. It removes the mean.

[2] Is 'x' one dimensional
     x(0)=Jan, x(1)=Feb, ... x(11)=Dec, x(12)=Jan_next year , ...

   x_dtrnd = x ; create array including meta data
   do nmo=0,nmos-1
      work = x(nmo::12) ; every 12-th value
      wavg = avg(work) ; average
      work = dtrnd(work, False) ; anomalies
      work = wavg + work ; add average back in
      x_dtrend(nmo::nmos) = work
   end do

On 10/22/12 9:20 PM, Hyacinth Nnamchi wrote:
> Hi;
>
> I am trying to detrend a monthly time series, month by month:
>
> nmos = 12
> ntim = dimsizes(x)
>
> do n = 0,ntim-1,nmos
> x_dtrnd = dtrend(x,False)
> end do
>
> print(x_dtrnd(0:11))
>
> But the result doesn't look correct, looks like deviations from annual
> mean. What could be wrong?
>
> Hyacinth
>
>
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Oct 22 23:09:39 2012

This archive was generated by hypermail 2.1.8 : Tue Oct 23 2012 - 11:10:04 MDT