Re: DJF averaging

From: <Michel.Mesquita_at_nyahnyahspammersnyahnyah>
Date: Thu, 11 Jun 2009 23:08:15 +0200

Hi Adam,

Thank you so much for helping me!
You're right, I meant the function 'month_to_season'. :-)
I was actually slicing the data first and then applying
month_to_season. So, I see that the correct way would be the other way
around!
There's something else I'd like to ask you. You said:
> You can make that more generic instead of coding in the 31:60 if you
> wish, and that would probably be recommended.

I am not sure how to refer to the exact timesteps I want in NCL. So,
what I do is to use 'ut_calendar' to find out the indexes to the
period I want. Is there a more generic way? (for example, in Grads you
can specific the time directly, 'set time 12JAN79' - or something like
that)

Thank you and have a great day!

Kindest regards,

Michel

Quoting Adam Phillips <asphilli_at_ucar.edu>:

> 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 - 15:08:15 MDT

This archive was generated by hypermail 2.2.0 : Mon Jun 15 2009 - 08:53:05 MDT