[gradsusr] time series of averaged daily values
Charles Seman - NOAA Federal
charles.seman at noaa.gov
Mon Jul 29 12:05:28 EDT 2013
One thing to keep in mind if the daily averages are field data (for
example, a 2D lon/lat field)... If you intend to do averages of the
daily averages, and if there are any missing data points in the daily
time series, then doing further averages of the daily averaged data must
be done with care: the GrADS arithmetic average and the ave() function
have different conventions for treating missing data. Please read Eric
Altshuler's email reply to my post to the old listserv from April 13,
2007 regarding this issue:
---------------------------------------------------------------------
When you use the 'ave' function in grads, undefined values are excluded
from the averaging calculation. In other words, if you have 10 values
but one of them is undefined, the ave function calculates the average of
the 9 remaining 'legitimate' values. The result from ave function will
only be undefined if ALL of the values involved in the average are
undefined.
On the other hand, if you explicitly refer to an undefined value in an
arithmetic calculation, the result of that calculation is also
undefined. For example, if you calculate the average of 10 values by
adding them up and dividing by 10, the result will be undefined if ANY
of the 10 values are undefined. That is why the white areas are bigger
in the figure you made by calculating the average with a 'while' loop.
Unless you have a compelling reason to calculate an average by
explicitly summing up the values, it's probably best to use the ave
function.
Sincerely,
Eric L. Altshuler
Assistant Research Scientist
Center for Ocean-Land-Atmosphere Studies
Calverton, MD, USA
ela at cola.iges.org
---------------------------------------------------------------------
The only way I know of to be able to use the ave() function on the
individual daily averages would be to write them out into either netCDF
format (via sdfwrite) or GrADS binary format (via fwrite), and then read
that daily time series data back in as a single daily time average time
series variable for use in the ave() function.
Hope this helps,
Chuck
On 07/25/2013 03:33 PM, Emily Wilson wrote:
> 'define a1=ave(VariableNameInDataSet.1,t=#,t=#)'
> 'define a2=ave(VariableNameInDataSet.1,t=#,t=#)'
> continue this code until you have a31 (for 31 days in December), then 'q
> define' will define your daily averages. The numbers should be
> something like t=1,t=96 then t=97,t=193 and so on. (if
> 24hrs/day=1440min/day then 1440/15min increments=96 increments per day)
> Let me know if you need more help
>
> *Emily P. Wilson, Intern*
> Research and Conservation Department
> Denver Botanic Gardens
> 1007 York St.
> Denver, CO 80206
> 720-865-3593
>
>
> On Thu, Jul 25, 2013 at 1:21 PM, Trisha Michael <tdgabbert at gmail.com
> <mailto:tdgabbert at gmail.com>> wrote:
>
> Hello GrADS Users,
>
> I would like to create a time series for each day in the month of
> December using daily averaged values. The data I have is in 15 min.
> increments for the whole month. I tried changing the increment of
> my .ctl to once daily and creating a time series but I believe that
> is giving me the data for that specific time not a daily average.
> Any help would be much appreciated (I'm fairly new to GrADS).
>
> Thanks,
> Trisha
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org <mailto:gradsusr at gradsusr.org>
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
--
Please note that Charles.Seman at noaa.gov should be considered my NOAA
email address, not cjs at gfdl.noaa.gov.
********************************************************************
Charles Seman Charles.Seman at noaa.gov
U.S. Department of Commerce / NOAA / OAR
Geophysical Fluid Dynamics Laboratory voice: (609) 452-6547
201 Forrestal Road fax: (609) 987-5063
Princeton, NJ 08540-6649 http://www.gfdl.noaa.gov/~cjs/
********************************************************************
"The contents of this message are mine personally and do not reflect any
official or unofficial position of the United States Federal Government,
the United States Department of Commerce, or NOAA."
More information about the gradsusr
mailing list