[ncl-talk] Overlay plots

Mary Haley haley at ucar.edu
Fri May 20 15:08:04 MDT 2016


Hi,

I'm sorry for the delayed response.  I didn't have time to look at your
email in detail until just now.

I believe if you use dim_avg_n_Wrap you can get what you need:

Rot_st_avg = dim_avg_n_Wrap_Rot_st,(/0,1/))

You should do a printVarSummary on that to make sure the dimensions are
what you expect.

--Mary



On Wed, May 18, 2016 at 3:32 AM, Amadou Coulibaly <mpapin24 at gmail.com>
wrote:

> Hello NCL users,
>
> I want to have an overlay plot aver time and levels. Let say I have:
> height_levels = ispan(100, 25900, 500) ; height levels to plot - in meter
> nlevels = dimsizes(height_levels)
> times = wrf_user_getvar(a,"times",-1)  ; get all times in the file
> ntimes = dimsizes(times)    ; number of times in the file
>
> I am working 3-hourly data of on one day, which means that ntimes=8.
> I want to plot the contour map of the following parameter:
> Rot_st = new((/ntimes, nlevels, nlat, nlon/), float)
>
> Variable: Rot_st
> Type: float
> Total Size: 20653568 bytes
>             5163392 values
> Number of Dimensions: 4
> Dimensions and sizes:    [8] x [52] x [107] x [116]
> Coordinates:
> Number Of Attributes: 1
>   _FillValue :    9.96921e+36
>
> ​The following command lines plot that parameter at each time for each
> level. But I want to have a plot averaged over times and levels​.
>
>   do it = 0,ntimes-1             ; TIME LOOP
>       print("Working on time: " + times(it) )
>       res at TimeLabel = times(it)   ; Set Valid time to use on plots
>
>       do level = 0, nlevels-1            ; LOOP OVER LEVELS
>            pressure = height_levels(level)
>            ; Add some level info to the plot
>            res at PlotLevelID = pressure + "m"
>
>     ; Plotting options for RH
>         opts = res
>         opts at cnFillOn = True
>         opts at pmLabelBarOrthogonalPosF = -0.1
>         opts at ContourParameters = (/0.6/)
>         opts at cnFillColors = (/"White","White","White", \
>                               "White","Chartreuse","Green",\
>                               "Green3","Green4", \
>                               "ForestGreen","PaleGreen4"/)
>         contour_rot =         wrf_contour(a,wks,Rot_st(it,level,:,:),opts)
>         delete(opts)
>
>     ; MAKE PLOTS
>       plot = wrf_map_overlays(a,wks,(/contour_rot/),pltres,mpres)
>
>     end do      ; END OF LEVEL LOOP
>
>   end do        ; END OF TIME LOOP
>
> ​Is there a way to transform the above command lines in such that to have
> a plot averaged over times and levels?
>
> Best regards​
>
> --
> * COULIBALY   AMADOU   *
> PhD  Student  on  West  African  Climate  System (WACS)
> FUTA - Federal  University  of  Technology of Akure, Nigeria
>
> *Visiting Student - *
> *University of Cologne, Germany**Institute of Geophysics and Meteorology*
> Pohligstr. 3 / Office 3.102
> D-50969 Köln
>
> *Project*: WASCAL (West African Science Service Centre on Climate Change
> and Adapted Land Use)
> Phone:(+234) 812 965 3659 /(+223) 90 08 26 71 /(+226) 64 57 37 27 /+49
> 15218352574
>
> E-mail: mpapin24 at gmail.com / coulibalya68 at yahoo.com
>
> "*The time is always right to do right": Nelson Mandela*
>
> *"Character is like a tree and reputation like a shadow.  The shadow is
> what we think of it; the tree is the real thing" : Abraham Lincoln*
>
> *"Do what you can, with what you have, where you are" Theodore Roosevelt*
>
>
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160520/a964c5a0/attachment.html 


More information about the ncl-talk mailing list