Re: DJF averaging

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Thu, 11 Jun 2009 14:24:32 -0600

Hi Michel,
When you say you are using the function month_to_month, do you mean you
are using the function month_to_seasonN?
http://www.ncl.ucar.edu/Document/Functions/Contributed/month_to_seasonN.shtml
As the documentation states, the time dimension must be divisible by 12,
and must start in January. Also, the first average (DJF year 0) is
actually the average of January and February year 0.

So, taking all of that into account, you want to compute the DJF average
from 1979-2008, and you want to take into account December 1978...

d = addfile("data.nc","r")
data = d->slp ; data will be dimensioned time x lat x lon

data_temp = month_to_seasonN(data,"DJF")
data_djf = data_temp(0,31:60,:,:) ; 31:60 = 1979-2007

You can make that more generic instead of coding in the 31:60 if you
wish, and that would probably be recommended.

Finally, if you want an overall DJF 1979-2007 mean, use dim_avg_Wrap to
average over the time dimension of data_djf.
http://www.ncl.ucar.edu/Document/Functions/Contributed/dim_avg_Wrap.shtml
Good luck,
Adam

Michel.Mesquita_at_bjerknes.uib.no wrote:
> Hi everyone,
>
> I have a netcdf file with data from 1948 - 2009(march). I want to
> calculate the DJF average from 1978(9) to 2007.
>
> First, I need to slice the data for the period I am working with. But
> where should I start this slice if I use the function month_to_month
> in NCL? I know this function has to start from January.
>
> If I start from January 1978 do these values (January and February
> 1978) enter in the average calculation? And if I end the data in
> December 2008, does that December enter in the calculation? I assume
> they don't.
>
> I really appreciate your help!
>
> Kindest regards,
>
> Michel
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
--------------------------------------------------------------
Adam Phillips			             asphilli_at_ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
ESSL/CGD/CAS                               fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000	  http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Jun 11 2009 - 14:24:32 MDT

This archive was generated by hypermail 2.2.0 : Thu Jun 11 2009 - 14:54:54 MDT