Re: About seasonal averaging

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Sun, 12 Oct 2008 14:34:37 -0600

Hello,

[1]
You say the dimensions are (lat, lon, time).
Is that how NCL is 'seeing' the array?

Do a "ncdump -h" or, equivalently "ncl_filedump"
on the file. What order do you see?

You could also do

     f = addfile(....)
     sst = f->SST
     printVarSummary(sst) ; What order do you see?

[2]
The climo_6 example you refer, the data is ordered (time,lat,lon)

The clmMonTLL function created the named dimension "month".
http://www.ncl.ucar.edu/Document/Functions/Contributed/clmMonTLL.shtml
sstClm = clmMonTLL( sst) ; (month,lat,lon)

The subsequent 6-month seasonal average used the "month"
dimension name.

[3]
In your case, I would suggest "month-to-season"

http://www.ncl.ucar.edu/Document/Functions/Contributed/month_to_season.shtml

Note ... this requires full years of data .... (1948-2007) in
your case.

xDJF = month_to_season (sst(0:N-1),:,:), "DJF")
xJJA = month_to_season (sst(0:N-1),:,:), "JJA")

where N is the number of months 60*12

Michel dos Santos Mesquita wrote:
> Hello,
>
> I am using some SST data to produce seasonal plots (SKT from NCEP/NCAR
> Reanalysis from 1948-2008). I would like to use the function
> 'dim_avg_Wrap' for that. I am producing plots for the seasons DJF, MAM,
> JJA and SON.
>
> There is an example from the NCL website that I am using for my plot:
> http://www.ncl.ucar.edu/Applications/Scripts/climo_6.ncl
>
> But I have a question there related to the following lines:
> *****
> season = (/ (/ 5, 6, 7, 8, 9,10/) \ ; May-Oct [summer]
> (/ 1, 2, 3, 4,11,12/) /) ; Nov-Apr [winter]
> i_season = season - 1 ; NCL indices
> etc...
> do ns=0,1 ; 2 seasons seasonal climatology
> sstSeaClm = dim_avg_Wrap( sstClm(lat|:,lon|:,month|i_season(ns,:)) )
> etc...
> *****
> The fact that the dimension 'month' was used in the line corresponding to
> 'sstSeaClm' assumes that the dataset has a month dimension. The data set I
> am working with has a dimensions of (lat, lon, time). The time dimentions
> I am splitting into year, month, day, etc... using the ut_calendar
> function. Do I need to assign 'month' as a dimension to my dataset to be
> able to do seasonal averages using dim_avg_Wrap?
>
> In my script, I have something like this:
> ***
> etc...
> season = (/1,2,12/) ; DJF
> i_season = season-1
> djf_clim = dim_avg_Wrap(sst(lat|:,lon|:,time|i_season(:)))
> etc...
> ***
>
> Since 'month' is not a dimension in my dataset, I used the variable
> 'time'. How does 'dim_avg_Wrap' average my dataset in this case? Does it
> use the indices 1, 2 and 12 from the time variable? Or does it try to look
> for the values of 1,2 and 12? Or is it necessary to add the month
> dimension to the dataset so that the numbers 1,2 and 12 can be averaged
> correctly? If dim_avg_Wrap uses the numbers in the variable 'season' as
> indices, and if it averages over those indices for each year, then the
> calculation I am doing is correct, since I have monthly data.
>
> I thank you in advance!
>
> Regards,
>
> Michel
>
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sun Oct 12 2008 - 14:34:37 MDT

This archive was generated by hypermail 2.2.0 : Mon Oct 13 2008 - 08:05:48 MDT