[ncl-talk] How to pick only the lowest level in dim_ave_nwrap

Dennis Shea shea at ucar.edu
Thu Sep 8 06:45:29 MDT 2016


; t2a(time,e_we, s_sn, bot_top)

   pm25_avg = dim_avg_n_Wrap(t2a, 0)
   printVarSummary(pm25_avg)               ; pm25_avg(e_we, s_sn, bot_top)

    kl = 0                                                     ; index of
lowest level

    pm25_kl = pm25_avg(:,:,kl)                  ; for clarity, explicitly
extract the lowest level
    printVarSummary(pm25_kl)                  ; pm25_kl(e_we, s_sn)

; I am not sure why you are using the gsn_csm_contour_map function.
; You are not used it correctly. You must set more resources.
; plot    = gsn_csm_contour_map(wks,pm25_kl,res)

    contour_ave = wrf_contour(j,wks,pm25_kl,res)
    plot = wrf_map_overlays(j,wks,(/contour_ave/),pltres,mpres)

---
Of course, you could just use the subscripted variable directly.

    ;plot    = gsn_csm_contour_map(wks,pm25_avg(:,:,kl),res)
     contour_ave = wrf_contour(j,wks,pm25_avg(:,:,kl),res)

--



On Thu, Sep 8, 2016 at 3:59 AM, Jacob Alberto Garcia <
jacob_garcia at dlsu.edu.ph> wrote:

> Hello I'm having trouble doing a timeaverage of pm2.5 since it has 4
> dimensions (time,e_we, s_sn, bot_top)
>
> this is my code:
> ------------------------------------------------------------
> --------------------------------
>
>
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
> ;load "./WRFUserARW.ncl"
>
>
>   diri = "./"
>   jake = (/ "d03_JUN_P_11_YSU.nc", "d03_JUL_P_15_YSU.nc",
> "d03_AUG_P_15_YSU.nc", "d03_AUG_P_16_YSU.nc"/)
>   pthi = diri+jake
>    j = addfile("d03_DEC_MYJ_F.nc", "r")
> fa  = addfiles(pthi, "r")
> pm25 = fa[:]->PM2_5_DRY
> pm25_avg = dim_avg_n_Wrap(t2a, 0)
> printVarSummary(pm25_avg)   ; south_north | ??] x [west_east | ??]
>
>
>
>
> ; We generate plots, but what kind do we prefer?
>   type = "pdf"
> ; type = "pdf"
> ; type = "ps"
> ; type = "ncgm"
>
> wks = gsn_open_wks(type,"avepm_d03")
>
>
>
>   gsn_define_colormap(wks, "BlWhRe")
>
>
>
>
>   pltres = True
>   mpres = True
>   res = True
>   mpres at mpDataBaseVersion = "HighRes"
>   res at MainTitle                   = "2 meter temperature Difference"
>   mpres at mpGridAndLimbOn = False
>   res at gsnMaximize = True
>   res at cnFillOn = True
>   res at gsnSpreadColors = True
>   res at cnLevelSelectionMode = "ManualLevels"
>   res at cnMinLevelValF  = -1.8            ; set the minimum contour level
>   res at cnMaxLevelValF  = 2.            ; set the maximum contour level
>   res at cnLevelSpacingF = 0.1
>   res at cnLinesOn = False
>   res at cnLineLabelsOn = False
>   mpres at mpGeophysicalLineColor = "Black"
>
>
>
>
> plot    = gsn_csm_contour_map(wks,pm25_avg,res)
>
>      contour_ave = wrf_contour(j,wks,pm25_avg,res)
>
>      plot = wrf_map_overlays(j,wks,(/contour_ave/),pltres,mpres)
>
>
>
>
>
>
> ------------------------------------------------------------
> --------------------------------------------
>
> pm25 = fa[:]->PM2_5_DRY
> pm25_avg = dim_avg_n_Wrap(t2a, 0)
>
> maybe in these two lines i need to change something to just let it get
> thhe lowest level? I cannot find out how. Hoping for any help at all.
>
> Cheers,
> Jacob
>
> <http://www.dlsu.edu.ph> <https://www.facebook.com/DLSU.Manila.100>
> <http://instagram.com/dlsu> <https://twitter.com/dlsumanila>
> <http://dlsumanila.tumblr.com/> <http://iblog.lasalle.ph/>
>
> DISCLAIMER AND CONFIDENTIALITY NOTICE
> The information contained in this e-mail, including those in its
> attachments, is confidential and intended only for the person(s) or
> entity(ies) to which it is addressed. If you are not an intended recipient,
> you must not read, copy, store, disclose, distribute this message, or act
> in reliance upon the information contained in it. If you received this
> e-mail in error, please contact the sender and delete the material from any
> computer or system. Any views expressed in this message are those of the
> individual sender and may not necessarily reflect the views of De La Salle
> University.
>
> _______________________________________________
> 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/20160908/940f3a04/attachment.html 


More information about the ncl-talk mailing list