Re: WRF Cross-section Tick Marks Issue. Please Help.

From: Derek Mallia <tartanrunner25_at_nyahnyahspammersnyahnyah>
Date: Tue Dec 17 2013 - 15:09:02 MST

Hi A.J., You should probably show some patience as I noticed that you sent the SAME EXACT email yesterday (AKA your spamming the NCL-talk list with the same question). The folks that maintain this email list are the same people who work hard to fix bugs and update the NCL code so they don't generally have the time to immediately respond to every question you have (and you've had ALOT over the past few days).  Asking questions are fine (I have my own questions every now and then), but running to NCL-talk every time your code does something unexpected isn't going to make you a better programmer (or a better graduate student for that matter). Try to troubleshoot your problems until the folks at NCL get back to you (which they generally will) and refer to the many examples that NCL has on their webpage. With that said, here is a sample code I wrote 2 years ago that looked at vertical cross sections of WRF data. Vertical velocity is shaded instead of RH, but the code has the same idea where it only wanted to look at some portion of the vertical 0-4km?. Its been awhile since I've looked at this code but perhaps it could help you solve your issue as I got the code to plot the vertical levels that I wanted with the appropriate tick marks).   Hope this helps, Derek On Tuesday, December 17, 2013 1:17 PM, A.J. Eiserloh <arthur.eiserloh_at_gmail.com> wrote: Hi all, I am trying to create appropriate tick marks for my vertical WRF 2-d cross-section. The unit for my y-axis is kilometers. There are 100 points in my vertical dimension in my cross section (dimension 0). When I try to tell NCL to put my tick marks from 0 km to 12 km, it seems like it is placing the tick marks at the dimension locations instead of the actual height data itself. How can I tell NCL to place the tick marks at the actual data instead of the points? I want my y-limit to be 0-12km.   load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"   load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"   load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"   load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRF_contributed.ncl" begin   case ="run3.1"   cmd  ="ls -1 /data2/eiserloh/data/AR/" + case + "/wrfout_d02_2012*" ;frost   files = systemfunc(cmd) + ".nc"   a = addfiles(files,"r")   times  = wrf_user_list_times(a)  ; get times in the files   ntimes = dimsizes(times)   pt_a= wrf_user_ll_to_ij(a[0],-126.0,42.0,True)   print(pt_a)   pt_b= wrf_user_ll_to_ij(a[0],-121.8,35.0,True)   print(pt_b)   plane = new(4,float)   plane=(/ pt_a(0),pt_b(0),pt_a(1),pt_b(1)  /)   type = "ps" FirstTime=True do it=0,1 ;do it=0,ntimes-1   print("Working on time: " + times(it))   if (it.lt.10) then     wks = gsn_open_wks(type,"cxsect_line1"+"_00"+tostring(it))   end if   if ((it.ge.10).and.(it.lt.100)) then     wks = gsn_open_wks(type,"cxsect_line1"+"_0"+tostring(it))   end if   if (it.ge.100) then     wks = gsn_open_wks(type,"cxsect_line1"+"_"+tostring(it))   end if   ; Extract cross section from point A to point B, as defined in "plane"   ; And vertically interpolate to either height or p coordinates   z        = wrf_user_getvar(a[it],"z",0)   z=z/1000.                                              ;convert to km   rh       = wrf_user_getvar(a[it],"rh",0)   u        = wrf_user_getvar(a[it],"ua",0)   v        = wrf_user_getvar(a[it],"va",0)   ws       = ((u^2)+(v^2))^(0.5)   ws_at_description = "windspeed"   ws_at_units = "m/s"   rh_plane = wrf_user_intrp3d(rh,z,"v",plane,0.,True) ;True if cross sect from ptA to ptB   rh_plane = smth9_Wrap(rh_plane,0.5,0.2,True)   printVarSummary(rh_plane)   ws_plane = wrf_user_intrp3d(ws,z,"v",plane,0.,True)  ;windspeed plane   ws_plane = smth9_Wrap(ws_plane,0.5,0.2,True)   ws_plane = smth9_Wrap(ws_plane,0.5,0.2,True)   res = True   res_at_gsnDraw = False   res_at_gsnFrame= False   ; Options for XY Plots         opts_xy                         = res         opts_xy_at_tiYAxisString           = "Height (km)"         opts_xy_at_cnMissingValPerimOn     = True         opts_xy_at_cnMissingValFillColor   = 0         opts_xy_at_cnMissingValFillPattern = 11         opts_xy_at_tmYLMode                = "Explicit"         opts_xy_at_tmYLValues              = fspan(0.0,12.0,13)                    ; Create tick marks         opts_xy_at_tmYLMinorValues         = fspan(0.5,11.5,12)         opts_xy_at_tmYLLabels              = sprintf("%.1f",fspan(0.0,12.0,13))  ; Create labels         opts_xy_at_tiXAxisFontHeightF      = 0.015         opts_xy_at_tiYAxisFontHeightF      = 0.015         opts_xy_at_tmXBMajorOutwardLengthF        = 0.0         opts_xy_at_tmYLMajorLengthF        = 0.012         opts_xy_at_tmYLLabelFontHeightF    = 0.011         opts_xy_at_tmXBLabelFontHeightF    = 0.011         opts_xy_at_PlotOrientation         = ws_plane_at_Orientation         opts_xy_at_Footer                  = False         opts_xy_at_MainTitle               = tostring(case)         opts_xy_at_MainTitlePos            = "Center"         opts_xy_at_InitTime                = False         opts_xy_at_ValidTime               = True         opts_xy_at_TimeLabel               = times(it)       ; Plotting options for RH         opts_rh = opts_xy         opts_rh_at_ContourParameters       = (/ 10., 90., 10. /)         opts_rh_at_pmLabelBarOrthogonalPosF = -0.185         opts_rh_at_lbLabelOffsetF            = 0.02 ;determines amount of space between actual label and labelbar         opts_rh_at_lbBoxMinorExtentF         = 0.12 ; perpendicular width of labelbar         opts_rh_at_lbLabelFontHeightF        = 0.01         opts_rh_at_lbTitleFontHeightF        = 0.01         opts_rh_at_cnFillOn                = True         opts_rh_at_cnFillColors            = (/"White","White","White", \                                             "White","Chartreuse","Green", \                                             "Green3","Green4", \                                             "ForestGreen","PaleGreen4"/)       ; Plotting options for windspeed        opts_ws = opts_xy        opts_ws_at_ContourParameters =(/5.0,100.0,5.0/)        opts_ws_at_cnFillOn = False        opts_ws_at_cnLineLabelBackgroundColor = -1        opts_ws_at_cnInfoLabelOn = False        opts_ws_at_cnLineLabelPerimOn   = False        opts_ws_at_cnLineLabelDensityF   = -3.0        opts_ws_at_cnLineLabelFontHeightF = 0.009      ;  opts_ws_at_cnSmoothingOn = True      ;  opts_ws_at_cnSmoothingTensionF = 0.02        ;Get the contour info for the rh and temp         contour_ws = wrf_contour(a[it],wks,ws_plane,opts_ws)         contour_rh = wrf_contour(a[it],wks,rh_plane,opts_rh)       ; MAKE PLOTS         pltres = True         pltres_at_Footer = False         plot = wrf_overlays(a[it],wks,(/contour_rh,contour_ws/),pltres)         delete(wks) end do end -- Arthur J. Eiserloh, Jr. San Jose State University  Graduate Student Dept. of Meteorology and Climate Science _______________________________________________ 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 Tue Dec 17 15:09:17 2013

This archive was generated by hypermail 2.1.8 : Wed Dec 18 2013 - 14:29:51 MST