[ncl-talk] Daily Average (MJJASO; 15 years) of subsetted time series

Adam Phillips asphilli at ucar.edu
Fri Feb 17 13:33:27 MST 2017


Hi Lyndon,
This should work:
eof_ts = eofunc_ts_Wrap(mjjaso,eof,False)   * ; [evn | 3] x [time | 2760]*
eof_ts_avg = eof_ts(:,:183)   ; pre-allocate array w/metadata
do gg = 0,183
    eof_ts_avg(:,gg) = (/ dim_avg(eof_ts(:,gg::184)) /)
end do

eof_ts_avg *; [evn | 3] x [time | 184]*

The above coding is untested. Verify that the calculation is doing what you
think it is doing. Hope that helps!
Adam

On Fri, Feb 17, 2017 at 2:32 AM, Lyndon Mark Olaguera <
olagueralyndonmark429 at gmail.com> wrote:

> Dear fellow NCL Users,
>
> I would like to calculate the average time series after calculating the
> EOF's for MJJASO (May to October) from 1979-1993.
>
> Here's the link to the data that I am working with. Also I attached the
> script in this email.
>
> [Link to the daily anomalies] https://drive.googl
> e.com/file/d/0B9faET7Bc2o8eHZKSi1qX3JLeFU/view?usp=sharing
>
>
>
> *QUESTION*
>
> I was able to subset the filtered data using the following:
>
> ;************************************************
> ;Subset MJJASO
> ;**********************************************
> *  yyyymm  = YMD/100*
> *  yyyy    = YMD/10000*
> *  mm      = yyyymm-(yyyy*100)*
>
> *  imd     = ind(mm.ge.5.and.mm.le.10)*
> *  mjjaso  = y(:,:,imd*)
>
>   t       = mjjaso&time
>
>   tsub    = cd_calendar(t,-2)
>
>   eof    = eofunc_Wrap(mjjaso,neof, False)
>   eof_ts = eofunc_ts_Wrap(mjjaso,eof,False)   * ; [evn | 3] x [time |
> 2760]*
>
> [1] After eof_ts, I would like to calculate the "averaged" time series
> from 1979-1993. So the output should be 184 time steps (daily average
> MJJASO). As of now, I am saving the output as an ascii file then sort per
> year before getting the final average.
> *Is there an easy way to implement this in the script?*
>
> I will appreciate any help.
>
> Sincerely,
>
> *Lyndon Mark P. Olaguera*
>
>
> _______________________________________________
> 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/20170217/c1836792/attachment.html 


More information about the ncl-talk mailing list