oops! I hit the send email inadvertently ..
On Mon, 4 Sep 2006, Dennis Shea wrote:
>> 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
>> ____________________________________________________________
>
Please read about coordinate variables and coordinate subscripting.
http://www.ncl.ucar.edu/Document/Manuals/Getting_Started/basics.shtml
http://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclVariables.shtml
Also, if you have not .... please download the pdf mini-language manual
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".
[1] http://www.ncl.ucar.edu/Document/Functions/Built-in/ut_calendar.shtml
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] http://www.ncl.ucar.edu/Document/Functions/Contributed/dim_avg_Wrap.shtml
tStrt = 2000061000
tLast = 2006061412
xTimeAvg = dim_avg_Wrap( x(levels|:,lat|:,lon|:,{tStrt:tLast}) )
printVarSummary( xTimeAvg )
_________________________________________
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Sep 04 2006 - 10:05:24 MDT
This archive was generated by hypermail 2.2.0 : Tue Sep 05 2006 - 07:54:06 MDT