# Re: Time averaging

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Mon, 4 Sep 2006 09:52:22 -0600 (MDT)

> I have a netcdf data in which a variable has dimension like this
>
> Number of Dimensions: 4
> Dimensions and sizes: [time | 425] x [levels | 20] x [latitude | 94] x
> [longitude | 37]
> Coordinates:
> time: [ 0..5088]
> levels: [1000.. 100]
> latitude: [-14.87392044067383..33.12910842895508]
> longitude: [-9.870802819728851..9.55839616060257]
>
>
> Time starts from 00z1March2000 to next 424 time steps with an interval of 12
> hrs. Suppose for time averaging from 00Z10jun2000 to 12Z14Jun2000, is there
> any "trick" to use calendar time instead of dimension number for
> averaging.
>
> print(VarName&time) gives 0, 12, 24, 36, .... 5088
>____________________________________________________________

http://www.ncl.ucar.edu/Document/Manuals/

-----

My speculation is that "time" has units of "hours since ..."
[or some variant "days since .."]

If that is the case, here is one possible "trick".

time = f->time
TIME = ut_calendar(time, -3) ; yyyymmddhh

[2] x = f->X
printVarSummary(x) ; original variable

delete(x&time) ; delete original time values associated
; with the named dimension "time"

x&time = TIME ; assigne new coordinate values
printVarSummary(x) ; new variable

[3] xTimeAvg = runave( x(levels|:

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Sep 04 2006 - 09:52:22 MDT

This archive was generated by hypermail 2.2.0 : Tue Sep 05 2006 - 07:54:06 MDT