Re: want to do montly average only the noon time value in each grid

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Mon Jun 11 2012 - 13:24:01 MDT

If you read the documentation for dim_avg,

   http://www.ncl.ucar.edu/Document/Functions/Built-in/dim_avg.shtml

you will see that it performs the average of the *rightmost* dimension.

   (Time, south_north, west_east) ; rightmost is 'west_east'

It is suggested that you read and use

    http://www.ncl.ucar.edu/Document/Functions/Built-in/dim_avg_n.shtml

    qavg = dim_avg_n(q, 0)
    printVarSummary(qavg)

or with meta data

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

    qavg = dim_avg_n_Wrap(q, 0)
    printVarSummary(qavg)

--
Also, this does not look correct
        f = addfiles(filesn, "r") ; change to filesn1 if 2006 )
        x       = f[:]->HFX(:,:,:)                              ; (Time, 
south_north, west_east)
        x1      = x(5:10:19,:,:)
The 5:10:19 makes no sense. It 'say' to use index values 5 thru 10 in 
strides of 19.
Please read about subscripting at:
 
http://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclVariables.shtml#Subscripts
On 6/11/12 1:02 PM, mark vogel wrote:
> Hi all
> I used dim avg to do the average for the afternoon time for each lat lon.
> But I am not sure dim-avg is average for each grid.
> It look like it averaged from west to east domain.
> What should I used to average the time in each grid point?
> Anyone answer me please
> Mark
> ---------- Forwarded message ----------
> From: *mark vogel* <mdvogelii@gmail.com <mailto:mdvogelii@gmail.com>>
> Date: Mon, Jun 11, 2012 at 1:43 PM
> Subject: plot dim_avg
> To: NCL USERS <ncl-talk@ucar.edu <mailto:ncl-talk@ucar.edu>>
>
>
> Dear all
> I try to average data only for daytime and plot it out.
> After I used dim_avg, then dimesion changed from 3 to 2 dimension and
> when I used
> gsm_contour_map to plot it out.
>
> Please help
> Mark
>
>
>
>      filesn1 = systemfunc("ls " + dirs + "2006*LDASOUT*.nc")
>         f = addfiles(filesn, "r") ; change to filesn1 if 2006 )
>         x       = f[:]->HFX(:,:,:)                              ; (Time,
> south_north, west_east)
>         x1      = x(5:10:19,:,:)
>      x1@units = "   (a) (Default)"
> ; print(x)
>          dirk   =
> "/usr/rmt_share/tgdata/hrldas/workspace/jam2/india_gemout/"
>          filesk = systemfunc("ls " + dirk + "200511*LDASOUT*.nc")
>          filesk1 = systemfunc("ls " + dirs + "2006*LDASOUT*.nc")
>
>         g = addfiles(filesk, "r")
>         y = g[:]->HFX(:,:,:)
>         y1 = y(5:10:19,:,:)
>
>   y1@units = "  (b) (GEM)"
>          xavg = dim_avg_Wrap(x1)
>          yavg = dim_avg_Wrap(y1)
> ; print(x1)
> print(yavg)
>        x@lat2d = lat2d
>        x@lon2d = lon2d
>        y@lat2d = lat2d
>        y@lon2d = lon2d
>
>
>    res@mpFillOn              = False            ; turn off map fill
>    res@mpOutlineDrawOrder    = "PostDraw"       ; draw continental
> outline last
>    res@mpOutlineBoundarySets = "National" ; state boundaries
>
>    res@tfDoNDCOverlay        = False             ; True for 'native' grid
>    res@gsnAddCyclic          = False            ; data are not cyclic
> ;  res@lbOrientation         = "vertical"
>
> ;************************************************
> ; allocate array for 3 plots
> ;************************************************
>    plts                      = new (2,"graphic")
>
> ;************************************************
> ; Tell NCL not to draw or advance frame for individual plots
> ;************************************************
>    res@gsnDraw               = False            ; (a) do not draw
>    res@gsnFrame              = False            ; (b) do not advance 'frame'
>
>    plts(0)                   = gsn_csm_contour_map(wks,xavg(:,:),res)
>    plts(1)                   = gsn_csm_contour_map(wks,yavg(:,:),res)
> ;************************************************
>
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jun 11 13:24:10 2012

This archive was generated by hypermail 2.1.8 : Tue Jun 12 2012 - 13:58:38 MDT