[ncl-talk] Zooming Functions Clarification
Illston, Bradley G.
illston at ou.edu
Wed Apr 13 21:16:28 MDT 2016
NCL Users,
I am one to try and figure my problems on their own, but I am a bit stumped after working on this for a few days. I am trying to zoom my map in to a set of bounding latitudes and longitudes in my domain to no avail. I kept trying various iterations utilizing ZoomIn or mpMinLatF/mpMinLonF/etc. I am not sure when you should use one and when you would use the other. Below is my latest script that works, but not zoomed in. When I run it, I get the following warnings:
warning:mpLimitMode is not a valid resource in /tair_24hr_2011_2008091502_contour at this time
warning:mpMinLonF is not a valid resource in /tair_24hr_2011_2008091502_contour at this time
warning:mpMaxLonF is not a valid resource in /tair_24hr_2011_2008091502_contour at this time
warning:mpMinLatF is not a valid resource in /tair_24hr_2011_2008091502_contour at this time
warning:mpMaxLatF is not a valid resource in /tair_24hr_2011_2008091502_contour at this time
Am I mixing various gsn functions that is causing a confusion? Is there a preferred one for plotting basic WRF output (in NetCDF format) to a PNG file? Any thoughts? Thank you so much.
Cheers,
Brad Illston
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
begin
;---Define colormap. First is background color, second is foreground color
colors = (/(/255, 255, 255/),(/0, 0, 0/),(/255, 255, 255/),(/088, 164, 074/),(/047,124,062/),(/055, 072, 114/),(/095,129,183/),(/094,165,212/),(/116,196,205/),(/135,099,162/),(/128,076,144/)/) / 255.
;---Open WRF output file
a = addfile(wrf_filename,"r")
print(" NetCDF file = "+wrf_filename)
print(" Output image = "+output_png)
;---Read temperature at first time step
tc = wrf_user_getvar(a,"T2",0)
tc at long_name = "2m Air Temperature"
tc at units = "C"
tc=tc-273.15
wks = gsn_open_wks("png",output_png)
gsn_define_colormap(wks,"WhiteBlueGreenYellowRed") ; choose colormap
; gsn_define_colormap(wks,colors)
;---Resources for filled contour plot
res = True
res at cnFillOn = True
res at cnLinesOn = False
res at gsnMaximize = True
res at tiMainString = run_length + " Run (" + year + ") - " + run_date + " " + end_time + " UTC"
res at Footer = False
res at FieldTitle = "2m Air Temperature"
res at lbTitleOn = True
res at lbTitleString = ""
res at NoHeaderFooter = True ; Switch headers and footers off
res at cnLevelSelectionMode = "ExplicitLevels"
res at cnLevels = (/10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25/)
; res at ContourParameters = (/10,25,1/) ; Contour levels
res at mpLimitMode = "LatLon"
res at mpMinLatF = 35
res at mpMinLonF = -98
res at mpMaxLatF = 36
res at mpMaxLonF = -97
contour = wrf_contour(a,wks,tc,res) ; Create contour plot
pltres = True ; Basic overlay plot options
pltres at PanelPlot = True ; Tells wrf_map_overlays not to remove overlays
mpres = True ; Set map options
mpres at mpOutlineOn = True ; Turn on map outlines
mpres at mpFillOn = False ; Turn off map fill
mpres at mpDataBaseVersion = "Ncarg4_1"
mpres at mpDataSetName = "Earth..2" ; For counties
mpres at mpOutlineBoundarySets = "GeophysicalAndUSStates"
mpres at mpOutlineSpecifiers = (/"Land", "Oklahoma:counties"/)
mpres at tiMainString = run_length + " Run (" + year + ") - " + run_date + " " + end_time + " UTC"
mpres at gsnMaximize = True
;---Create the contours over the WRF map (nothing will be drawn yet).
plot = wrf_map_overlays(a,wks,contour,pltres,mpres)
end
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160414/383be6ac/attachment.html
More information about the ncl-talk
mailing list