; load libraries, twice for good measure 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" ;load "/home/torn/ncl/wrf_map_info.ncl" ;load "/home/torn/ncl/array_stat.ncl" ;load "/home/torn/ncl/image_conv.ncl" 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" ;load "/home/torn/ncl/wrf_map_info.ncl" ;load "/home/torn/ncl/array_stat.ncl" ;load "/home/torn/ncl/image_conv.ncl" ;load "wrf_dart_util.ncl" begin ; ------ Load Data rows = numAsciiRow("usp01.txt") columns = numAsciiCol("usp01.txt") data01=asciiread("usp01.txt",(/rows,columns/),"float") templat = data01(:,2) templon = data01(:,3) tempdata= data01(:,4) p = onedtond(tempdata,(/7,9/)) lat = onedtond(templat,(/7,9/)) lon = onedtond(templon,(/7,9/)) p(0,0)=p(0,0)+.01 ; ------ Assign Coordinates uniquelat = lat(:,1) uniquelon = lon(1,:) uniquelat@units="degrees_north" uniquelon@units="degrees_east" fillvarlevel = p fillvarlevel!0="lat" fillvarlevel!1="lon" fillvarlevel&lon = uniquelon fillvarlevel&lat = uniquelat delim = "," lonmin = -81 ;round(min(sitelons),3)-2 lonmax = -71 ;round(max(sitelons),3)+2 latmin = 38 ;round(min(sitelats),3)-2 latmax = 48 ;round(max(sitelats),3)+2 wks_type = "png" wks_type@wkWidth = 4000 wks_type@wkHeight = 3200 wks = gsn_open_wks(wks_type,"plot") res = True res@gsnFrame = False res@mpProjection = "CylindricalEquidistant" ;res@mpOutlineBoundarySets = "GeophysicalAndUSStates" res@gsnMaximize = True res@lbBoxMinorExtentF = 0.25 res@cnFillOn = False ; this controls whether or not a label bar exists res@cnLinesOn = False ;no contours on top of fill res@cnFillMode = "RasterFill" res@cnRasterSmoothingOn = True res@mpMinLonF = lonmin ;-- min longitude res@mpMaxLonF = lonmax ;-- max longitude res@mpMinLatF = latmin ;-- min latitude res@mpMaxLatF = latmax ;-- max latitude res@tfDoNDCOverlay = True ;this is a resource for overlaying multiple plots res@cnInfoLabelOn = False ; turn off contour label res@mpDataBaseVersion = "Ncarg4_1" res@mpDataSetName = "Earth..4" ; For counties res@mpFillAreaSpecifiers = (/"Land", "United States:States","Water"/) ; for states only res@mpFillAreaSpecifiers = (/"Land", "Land:North America:United States:Conterminous US:New York","Water"/) res@mpSpecifiedFillColors = (/"transparent","transparent", "transparent"/) res@mpInlandWaterFillColor = 238 res@mpLandFillColor = -1 ; transparent res@mpOutlineOn = True res@mpMaskOutlineSpecifiers = (/"Land"/) res@mpOutlineSpecifiers = (/ "Land:North America:United States:Conterminous US:New York:counties"/) res@mpGeophysicalLineThicknessF = 20 res@mpUSStateLineThicknessF = 20 res@mpNationalLineThicknessF = 20 res@mpCountyLineThicknessF = 5 res@mpGridLonSpacingF = 2 res@mpDataBaseVersion = "MediumRes" ;-- better map resolution res@gsnAddCyclic = False res@cnGridBoundFillColor = "Transparent" res@tmXBBorderOn = False res@tmXBMinorPerMajor = 1 res@tmXBOn = False res@tmXTBorderOn = False res@tmXTOn = False res@tmYLBorderOn = False res@tmYLMinorPerMajor = 1 res@tmYLOn = False res@tmYRBorderOn = False res@tmYROn = False res@lbLabelBarOn = False res@gsnDraw = False res@mpOutlineDrawOrder = "PreDraw" ; = "PostDraw" ; make feelslike plot below wks_type = "png" wks_type@wkWidth = 4000 wks_type@wkHeight = 3200 wks = gsn_open_wks(wks_type,"stationfeelslike") gsn_define_colormap(wks,"GMT_wysiwygcont") sitefile = "maxwc3day.dat" sitedata = asciiread(sitefile,-1,"string") sitelats = tofloat(str_get_field(sitedata,1,delim)) sitelons = tofloat(str_get_field(sitedata,2,delim)) siteanom = tofloat(str_get_field(sitedata,3,delim)) size = dimsizes(sitelons) plot = gsn_csm_contour_map(wks,fillvarlevel,res) labels = (/"-40","-30","-20","-10","0","10","20","30","40","50","60","70","80","90","100","F"/) lbres = True ; Set up a resource list for the labelbar. lbres@vpWidthF = 0.1 lbres@vpHeightF = 0.35 lbres@lbBoxLinesOn = False lbres@lbFillColors = (/25,40,55,70,85,100,115,130,145,160,175,190,205,220,235,-1/) lbres@lbMonoFillPattern = True lbres@lbOrientation = "Vertical" lbres@lbPerimOn = False lbres@lbLabelFontHeightF = .013 lbres@lbLabelAutoStride = False lbres@lbLabelStride = 1 lbid = gsn_create_labelbar_ndc(wks,16,labels,.7,.5,lbres) amres = True amres@amZone = 0 amres@amParallelPosF = 0.4 amres@amOrthogonalPosF = 0 ;annoid = gsn_add_annotation(plot,lbid,amres) ;;;;;;;;;;;; this part tells the marker what color to be based on the anomaly markercolors = new(size(0),"integer") do n=0,size(0)-1,1 markercolors(n) = round(2.5*siteanom(n),3)+135 end do markercolors=where((markercolors.lt.2),2,markercolors) markercolors=where((markercolors.gt.199),199,markercolors) stationmarker = new(size(0),graphic) do n=0,size(0)-1,1 mres = True ; marker resources for best track mres@gsMarkerIndex = 16 ; marker style (filled circle) mres@gsMarkerSizeF = 21.0 ; marker size mres@gsMarkerColor = markercolors(n) ; marker color mres@tfPolyDrawOrder= "PostDraw" stationmarker(n) = gsn_add_polymarker(wks,plot,sitelons(n),sitelats(n),mres) tres = True ; text mods desired tres@tfPolyDrawOrder = "PostDraw" tres@txFont = "helvetica-bold" tres@txFontHeightF = 0.012 if any(siteanom.lt.-9.5) tres@txFontHeightF = 0.011 end if stationtext = gsn_add_text(wks,plot,round(siteanom(n),3),sitelons(n),sitelats(n),tres) end do txres = True txres@txFontHeightF = .02 ; Set the font height txres@txJust = "CenterCenter" quote = inttochar(34) label = "Coldest Wind Chill (~S~o~N~F)" gsn_text_ndc(wks,label,.37,.36 ,txres) txres@txFontHeightF = .018 label = "2019-01-19 Through 2019-01-22" gsn_text_ndc(wks,label,.37,.32 ,txres) minute = tochar(systemfunc("date +%M")) draw(plot) frame(wks) exit() delete(sitefile) delete(sitelats) delete(sitelons) delete(sitedata) delete(siteanom) delete(markercolors) delete(stationmarker) ; make temperature plot below wks_type = "png" wks_type@wkWidth = 4000 wks_type@wkHeight = 3200 wks = gsn_open_wks(wks_type,"stationtemperature") gsn_define_colormap(wks,"GMT_wysiwygcont") sitefile = "temperature.dat" sitedata = asciiread(sitefile,-1,"string") sitelats = tofloat(str_get_field(sitedata,1,delim)) sitelons = tofloat(str_get_field(sitedata,2,delim)) siteanom = tofloat(str_get_field(sitedata,3,delim)) size = dimsizes(sitelons) plot = gsn_csm_contour_map(wks,fillvarlevel,res) labels = (/"-40","-30","-20","-10","0","10","20","30","40","50","60","70","80","90","100","F"/) lbres = True ; Set up a resource list for the labelbar. lbres@vpWidthF = 0.1 lbres@vpHeightF = 0.35 lbres@lbBoxLinesOn = False lbres@lbFillColors = (/25,40,55,70,85,100,115,130,145,160,175,190,205,220,235,-1/) lbres@lbMonoFillPattern = True lbres@lbOrientation = "Vertical" lbres@lbPerimOn = False lbres@lbLabelFontHeightF = .013 lbres@lbLabelAutoStride = False lbres@lbLabelStride = 1 lbid = gsn_create_labelbar_ndc(wks,16,labels,.7,.5,lbres) amres = True amres@amZone = 0 amres@amParallelPosF = 0.4 amres@amOrthogonalPosF = 0 ;annoid = gsn_add_annotation(plot,lbid,amres) ;;;;;;;;;;;; this part tells the marker what color to be based on the anomaly markercolors = new(size(0),"integer") do n=0,size(0)-1,1 markercolors(n) = round((siteanom(n)),3)+61 end do markercolors=where((markercolors.lt.2),2,markercolors) markercolors=where((markercolors.gt.199),199,markercolors) stationmarker = new(size(0),graphic) do n=0,size(0)-1,1 mres = True ; marker resources for best track mres@gsMarkerIndex = 16 ; marker style (filled circle) mres@gsMarkerSizeF = 21.0 ; marker size mres@gsMarkerColor = markercolors(n) ; marker color mres@tfPolyDrawOrder= "PostDraw" stationmarker(n) = gsn_add_polymarker(wks,plot,sitelons(n),sitelats(n),mres) tres = True ; text mods desired tres@tfPolyDrawOrder = "PostDraw" tres@txFont = "helvetica-bold" tres@txFontHeightF = 0.012 if any(siteanom.lt.-9.5) tres@txFontHeightF = 0.011 end if stationtext = gsn_add_text(wks,plot,round(siteanom(n),3),sitelons(n),sitelats(n),tres) end do txres = True txres@txFontHeightF = .02 ; Set the font height txres@txJust = "CenterCenter" label = "Temperature (~S~o~N~F)" gsn_text_ndc(wks,label,.37,.36 ,txres) txres@txFontHeightF = .018 label = systemfunc("date +%A") + ", " + systemfunc("date +%F") gsn_text_ndc(wks,label,.37,.32 ,txres) minute = tochar(systemfunc("date +%M")) label = "At " + systemfunc("date +%I") + ":" + minute(0)+"0 " + systemfunc("date +%p") gsn_text_ndc(wks,label,.37,.29 ,txres) draw(plot) frame(wks) delete(sitefile) delete(sitelats) delete(sitelons) delete(sitedata) delete(siteanom) delete(markercolors) delete(stationmarker) ;;;;; precip section below ; make precip hourly total plot below wks_type = "png" wks_type@wkWidth = 4000 wks_type@wkHeight = 3200 wks = gsn_open_wks(wks_type,"stationpreciphour") gsn_define_colormap(wks,"WhiteBlueGreenYellowRed") sitefile = "precip1hour.dat" sitedata = asciiread(sitefile,-1,"string") sitelats = tofloat(str_get_field(sitedata,1,delim)) sitelons = tofloat(str_get_field(sitedata,2,delim)) siteanom = tofloat(str_get_field(sitedata,3,delim)) size = dimsizes(sitelons) plot = gsn_csm_contour_map(wks,fillvarlevel,res) lbres = True ; Set up a resource list for the labelbar. labels := (/"0","0.1","0.2","0.4","0.7","1.0","1.5","2.0","2.5","3.0","4.0","in"/) ;lbres@lbFillColors = (/10,15,20,30,45,60,85,110,135,160,200,-1/) ; use these with gsn_define_colormap(wks,"WhiteGreen") lbres@vpWidthF = 0.1 lbres@vpHeightF = 0.25 lbres@lbBoxLinesOn = False lbres@lbFillColors := (/140,139,138,136,133,130,125,120,115,110,100,-1/) lbres@lbMonoFillPattern = True lbres@lbOrientation = "Vertical" lbres@lbPerimOn = False lbres@lbLabelFontHeightF = .013 lbres@lbLabelAutoStride = True lbid = gsn_create_labelbar_ndc(wks,12,labels,.7,.5,lbres) amres = True amres@amZone = 0 amres@amParallelPosF = 0.4 amres@amOrthogonalPosF = 0 ;annoid = gsn_add_annotation(plot,lbid,amres) ;;;;;;;;;;;; this part tells the marker what color to be based on the anomaly markercolors = new(size(0),"integer") do n=0,size(0)-1,1 markercolors(n) = ((round((siteanom(n)*10),3))*-1)+140 end do stationmarker = new(size(0),graphic) do n=0,size(0)-1,1 mres = True ; marker resources for best track mres@gsMarkerIndex = 16 ; marker style (filled circle) mres@gsMarkerSizeF = 21.0 ; marker size mres@gsMarkerColor = markercolors(n) ; marker color mres@tfPolyDrawOrder= "PostDraw" if siteanom(n).gt.(0) stationmarker(n) = gsn_add_polymarker(wks,plot,sitelons(n),sitelats(n),mres) end if tres = True ; text mods desired tres@tfPolyDrawOrder = "PostDraw" tres@txFont = "helvetica-bold" tres@txFontHeightF = 0.010 if siteanom(n).eq.(0) text = " " end if if siteanom(n).gt.(0).and.siteanom(n).lt.(0.005) text = "T" tres@txFontHeightF = 0.007 end if if siteanom(n).ge.(0.005).and.siteanom(n).lt.(0.05) text = ""+.01*round(100*siteanom(n),3) tres@txFontHeightF = 0.007 end if if siteanom(n).ge.(.05) text = ""+.1*round(10*siteanom(n),3) tres@txFontHeightF = 0.010 end if stationtext = gsn_add_text(wks,plot,text,sitelons(n),sitelats(n),tres) end do txres = True txres@txFontHeightF = .02 ; Set the font height txres@txJust = "CenterCenter" label = "Total 1 Hour Precipitation (in)" gsn_text_ndc(wks,label,.37,.36 ,txres) txres@txFontHeightF = .018 label = "Ending at: "+ systemfunc("date +%A") + ", " + systemfunc("date +%F") gsn_text_ndc(wks,label,.37,.32 ,txres) minute = tochar(systemfunc("date +%M")) label = "At " + systemfunc("date +%I") + ":" + minute(0)+"0 " + systemfunc("date +%p") gsn_text_ndc(wks,label,.37,.29 ,txres) draw(plot) frame(wks) delete(sitefile) delete(sitelats) delete(sitelons) delete(sitedata) delete(siteanom) delete(markercolors) delete(stationmarker) ; make max 24 gust plot below wks_type = "png" wks_type@wkWidth = 4000 wks_type@wkHeight = 3200 wks = gsn_open_wks(wks_type,"stationmaxgust24") sitefile = "max24gust.dat" sitedata = asciiread(sitefile,-1,"string") sitelats = tofloat(str_get_field(sitedata,1,delim)) sitelons = tofloat(str_get_field(sitedata,2,delim)) siteanom = tofloat(str_get_field(sitedata,3,delim)) size = dimsizes(sitelons) plot = gsn_csm_contour_map(wks,fillvarlevel,res) labels = (/"0","10","20","30","40","50","60","70","80","90","100","mph"/) lbres = True ; Set up a resource list for the labelbar. lbres@vpWidthF = 0.1 lbres@vpHeightF = 0.25 lbres@lbBoxLinesOn = False lbres@lbFillColors = (/20,40,60,80,100,120,140,160,180,200,220,-1/) lbres@lbMonoFillPattern = True lbres@lbOrientation = "Vertical" lbres@lbPerimOn = False lbres@lbLabelFontHeightF = .013 lbres@lbLabelAutoStride = False lbid = gsn_create_labelbar_ndc(wks,12,labels,.7,.5,lbres) amres = True amres@amZone = 0 amres@amParallelPosF = 0.4 amres@amOrthogonalPosF = 0 ;annoid = gsn_add_annotation(plot,lbid,amres) ;;;;;;;;;;;; this part tells the marker what color to be based on the anomaly markercolors = new(size(0),"integer") do n=0,size(0)-1,1 markercolors(n) = round((siteanom(n)*3),3)+20 end do markercolors=where((markercolors.gt.254),254,markercolors) stationmarker = new(size(0),graphic) do n=0,size(0)-1,1 mres = True ; marker resources for best track mres@gsMarkerIndex = 16 ; marker style (filled circle) mres@gsMarkerSizeF = 21.0 ; marker size mres@gsMarkerColor = markercolors(n) ; marker color mres@tfPolyDrawOrder= "PostDraw" stationmarker(n) = gsn_add_polymarker(wks,plot,sitelons(n),sitelats(n),mres) tres = True ; text mods desired tres@tfPolyDrawOrder = "PostDraw" tres@txFont = "helvetica-bold" tres@txFontHeightF = 0.012 if any(siteanom.lt.-9.5) tres@txFontHeightF = 0.011 end if stationtext = gsn_add_text(wks,plot,round(siteanom(n),3),sitelons(n),sitelats(n),tres) end do txres = True txres@txFontHeightF = .02 ; Set the font height txres@txJust = "CenterCenter" label = "Maximum 24 Hour Wind Gust (mph)" gsn_text_ndc(wks,label,.37,.36 ,txres) txres@txFontHeightF = .018 label = "Ending at: "+ systemfunc("date +%A") + ", " + systemfunc("date +%F") gsn_text_ndc(wks,label,.37,.32 ,txres) minute = tochar(systemfunc("date +%M")) label = "At " + systemfunc("date +%I") + ":" + minute(0)+"0 " + systemfunc("date +%p") gsn_text_ndc(wks,label,.37,.29 ,txres) draw(plot) frame(wks) delete(sitefile) delete(sitelats) delete(sitelons) delete(sitedata) delete(siteanom) delete(markercolors) delete(stationmarker) ; make max gust plot below wks_type = "png" wks_type@wkWidth = 4000 wks_type@wkHeight = 3200 wks = gsn_open_wks(wks_type,"stationmaxgust") sitefile = "maxgust.dat" sitedata = asciiread(sitefile,-1,"string") sitelats = tofloat(str_get_field(sitedata,1,delim)) sitelons = tofloat(str_get_field(sitedata,2,delim)) siteanom = tofloat(str_get_field(sitedata,3,delim)) size = dimsizes(sitelons) plot = gsn_csm_contour_map(wks,fillvarlevel,res) labels = (/"0","10","20","30","40","50","60","70","80","90","100","mph"/) lbres = True ; Set up a resource list for the labelbar. lbres@vpWidthF = 0.1 lbres@vpHeightF = 0.25 lbres@lbBoxLinesOn = False lbres@lbFillColors = (/20,40,60,80,100,120,140,160,180,200,220,-1/) lbres@lbMonoFillPattern = True lbres@lbOrientation = "Vertical" lbres@lbPerimOn = False lbres@lbLabelFontHeightF = .013 lbres@lbLabelAutoStride = False lbid = gsn_create_labelbar_ndc(wks,12,labels,.7,.5,lbres) amres = True amres@amZone = 0 amres@amParallelPosF = 0.4 amres@amOrthogonalPosF = 0 ;annoid = gsn_add_annotation(plot,lbid,amres) ;;;;;;;;;;;; this part tells the marker what color to be based on the anomaly markercolors = new(size(0),"integer") do n=0,size(0)-1,1 markercolors(n) = round((siteanom(n)*3),3)+20 end do markercolors=where((markercolors.gt.254),254,markercolors) stationmarker = new(size(0),graphic) do n=0,size(0)-1,1 mres = True ; marker resources for best track mres@gsMarkerIndex = 16 ; marker style (filled circle) mres@gsMarkerSizeF = 21.0 ; marker size mres@gsMarkerColor = markercolors(n) ; marker color mres@tfPolyDrawOrder= "PostDraw" stationmarker(n) = gsn_add_polymarker(wks,plot,sitelons(n),sitelats(n),mres) tres = True ; text mods desired tres@tfPolyDrawOrder = "PostDraw" tres@txFont = "helvetica-bold" tres@txFontHeightF = 0.012 if any(siteanom.lt.-9.5) tres@txFontHeightF = 0.011 end if stationtext = gsn_add_text(wks,plot,round(siteanom(n),3),sitelons(n),sitelats(n),tres) end do txres = True txres@txFontHeightF = .02 ; Set the font height txres@txJust = "CenterCenter" label = "Maximum 1 Hour Wind Gust (mph)" gsn_text_ndc(wks,label,.37,.36 ,txres) txres@txFontHeightF = .018 label = "Ending at: "+ systemfunc("date +%A") + ", " + systemfunc("date +%F") gsn_text_ndc(wks,label,.37,.32 ,txres) minute = tochar(systemfunc("date +%M")) label = "At " + systemfunc("date +%I") + ":" + minute(0)+"0 " + systemfunc("date +%p") gsn_text_ndc(wks,label,.37,.29 ,txres) draw(plot) frame(wks) delete(sitefile) delete(sitelats) delete(sitelons) delete(sitedata) delete(siteanom) delete(markercolors) delete(stationmarker) ; make wind plot below wks_type = "png" wks_type@wkWidth = 4000 wks_type@wkHeight = 3200 wks = gsn_open_wks(wks_type,"stationwind") sitefile = "wind.dat" sitedata = asciiread(sitefile,-1,"string") sitelats = tofloat(str_get_field(sitedata,1,delim)) sitelons = tofloat(str_get_field(sitedata,2,delim)) siteanom = tofloat(str_get_field(sitedata,3,delim)) size = dimsizes(sitelons) plot = gsn_csm_contour_map(wks,fillvarlevel,res) labels = (/"0","10","20","30","40","50","60","70","80","90","100","mph"/) lbres = True ; Set up a resource list for the labelbar. lbres@vpWidthF = 0.1 lbres@vpHeightF = 0.25 lbres@lbBoxLinesOn = False lbres@lbFillColors = (/20,40,60,80,100,120,140,160,180,200,220,-1/) lbres@lbMonoFillPattern = True lbres@lbOrientation = "Vertical" lbres@lbPerimOn = False lbres@lbLabelFontHeightF = .013 lbres@lbLabelAutoStride = False lbid = gsn_create_labelbar_ndc(wks,12,labels,.7,.5,lbres) amres = True amres@amZone = 0 amres@amParallelPosF = 0.4 amres@amOrthogonalPosF = 0 ;annoid = gsn_add_annotation(plot,lbid,amres) ;;;;;;;;;;;; this part tells the marker what color to be based on the anomaly markercolors = new(size(0),"integer") do n=0,size(0)-1,1 markercolors(n) = round((siteanom(n)*4),3)+20 end do markercolors=where((markercolors.gt.254),254,markercolors) stationmarker = new(size(0),graphic) do n=0,size(0)-1,1 mres = True ; marker resources for best track mres@gsMarkerIndex = 16 ; marker style (filled circle) mres@gsMarkerSizeF = 21.0 ; marker size mres@gsMarkerColor = markercolors(n) ; marker color mres@tfPolyDrawOrder= "PostDraw" stationmarker(n) = gsn_add_polymarker(wks,plot,sitelons(n),sitelats(n),mres) tres = True ; text mods desired tres@tfPolyDrawOrder = "PostDraw" tres@txFont = "helvetica-bold" tres@txFontHeightF = 0.012 if any(siteanom.lt.-9.5) tres@txFontHeightF = 0.011 end if stationtext = gsn_add_text(wks,plot,round(siteanom(n),3),sitelons(n),sitelats(n),tres) end do txres = True txres@txFontHeightF = .02 ; Set the font height txres@txJust = "CenterCenter" label = "Wind Speed (mph)" gsn_text_ndc(wks,label,.37,.36 ,txres) txres@txFontHeightF = .018 label = "Ending at: "+ systemfunc("date +%A") + ", " + systemfunc("date +%F") gsn_text_ndc(wks,label,.37,.32 ,txres) minute = tochar(systemfunc("date +%M")) label = "At " + systemfunc("date +%I") + ":" + minute(0)+"0 " + systemfunc("date +%p") gsn_text_ndc(wks,label,.37,.29 ,txres) draw(plot) frame(wks) delete(sitefile) delete(sitelats) delete(sitelons) delete(sitedata) delete(siteanom) delete(markercolors) delete(stationmarker) ; make precip daily total plot below wks_type = "png" wks_type@wkWidth = 4000 wks_type@wkHeight = 3200 wks = gsn_open_wks(wks_type,"stationprecipday") sitefile = "precip1day.dat" sitedata = asciiread(sitefile,-1,"string") sitelats = tofloat(str_get_field(sitedata,1,delim)) sitelons = tofloat(str_get_field(sitedata,2,delim)) siteanom = tofloat(str_get_field(sitedata,3,delim)) size = dimsizes(sitelons) plot = gsn_csm_contour_map(wks,fillvarlevel,res) lbres = True ; Set up a resource list for the labelbar. labels = (/"0","0.1","0.2","0.4","0.7","1.0","1.5","2.0","2.5","3.0","4.0","in"/) ;lbres@lbFillColors = (/10,15,20,30,45,60,85,110,135,160,200,-1/) ; use these with gsn_define_colormap(wks,"WhiteGreen") lbres@vpWidthF = 0.1 lbres@vpHeightF = 0.25 lbres@lbBoxLinesOn = False lbres@lbFillColors = (/140,139,138,136,133,130,125,120,115,110,100,-1/) lbres@lbMonoFillPattern = True lbres@lbOrientation = "Vertical" lbres@lbPerimOn = False lbres@lbLabelFontHeightF = .013 lbres@lbLabelAutoStride = True lbid = gsn_create_labelbar_ndc(wks,12,labels,.7,.5,lbres) amres = True amres@amZone = 0 amres@amParallelPosF = 0.4 amres@amOrthogonalPosF = 0 ;annoid = gsn_add_annotation(plot,lbid,amres) ;;;;;;;;;;;; this part tells the marker what color to be based on the anomaly markercolors = new(size(0),"integer") do n=0,size(0)-1,1 markercolors(n) = ((round((siteanom(n)*10),3))*-1)+140 end do markercolors=where((markercolors.lt.80),80,markercolors) stationmarker = new(size(0),graphic) do n=0,size(0)-1,1 mres = True ; marker resources for best track mres@gsMarkerIndex = 16 ; marker style (filled circle) mres@gsMarkerSizeF = 21.0 ; marker size mres@gsMarkerColor = markercolors(n) ; marker color mres@tfPolyDrawOrder= "PostDraw" if siteanom(n).gt.(0) stationmarker(n) = gsn_add_polymarker(wks,plot,sitelons(n),sitelats(n),mres) end if tres = True ; text mods desired tres@tfPolyDrawOrder = "PostDraw" tres@txFont = "helvetica-bold" tres@txFontHeightF = 0.010 if siteanom(n).eq.(0) text = " " end if if siteanom(n).gt.(0).and.siteanom(n).lt.(0.005) text = "T" tres@txFontHeightF = 0.007 end if if siteanom(n).ge.(0.005).and.siteanom(n).lt.(0.05) text = ""+.01*round(100*siteanom(n),3) tres@txFontHeightF = 0.007 end if if siteanom(n).ge.(.05) text = ""+.1*round(10*siteanom(n),3) tres@txFontHeightF = 0.010 end if stationtext = gsn_add_text(wks,plot,text,sitelons(n),sitelats(n),tres) end do txres = True txres@txFontHeightF = .02 ; Set the font height txres@txJust = "CenterCenter" label = "Total 24 Hour Precipitation (in)" gsn_text_ndc(wks,label,.37,.36 ,txres) txres@txFontHeightF = .018 label = "Ending at: "+ systemfunc("date +%A") + ", " + systemfunc("date +%F") gsn_text_ndc(wks,label,.37,.32 ,txres) minute = tochar(systemfunc("date +%M")) label = "At " + systemfunc("date +%I") + ":" + minute(0)+"0 " + systemfunc("date +%p") gsn_text_ndc(wks,label,.37,.29 ,txres) draw(plot) frame(wks) delete(sitefile) delete(sitelats) delete(sitelons) delete(sitedata) delete(siteanom) delete(markercolors) delete(stationmarker) ; make snowfall hour total plot below wks_type = "png" wks_type@wkWidth = 4000 wks_type@wkHeight = 3200 wks = gsn_open_wks(wks_type,"stationsnowhour") sitefile = "snow1hour.dat" sitedata = asciiread(sitefile,-1,"string") sitelats = tofloat(str_get_field(sitedata,1,delim)) sitelons = tofloat(str_get_field(sitedata,2,delim)) siteanom = tofloat(str_get_field(sitedata,3,delim)) siteanom = where(siteanom.lt.0,0,siteanom) size = dimsizes(sitelons) plot = gsn_csm_contour_map(wks,fillvarlevel,res) lbres = True ; Set up a resource list for the labelbar. labels = (/"0","0.1","0.2","0.4","0.7","1.0","1.5","2.0","2.5","3.0","4.0","in"/) ;lbres@lbFillColors = (/10,15,20,30,45,60,85,110,135,160,200,-1/) ; use these with gsn_define_colormap(wks,"WhiteGreen") lbres@vpWidthF = 0.1 lbres@vpHeightF = 0.25 lbres@lbBoxLinesOn = False lbres@lbFillColors = (/140,139,138,136,133,130,125,120,115,110,100,-1/) lbres@lbMonoFillPattern = True lbres@lbOrientation = "Vertical" lbres@lbPerimOn = False lbres@lbLabelFontHeightF = .013 lbres@lbLabelAutoStride = True lbid = gsn_create_labelbar_ndc(wks,12,labels,.7,.5,lbres) amres = True amres@amZone = 0 amres@amParallelPosF = 0.4 amres@amOrthogonalPosF = 0 ;annoid = gsn_add_annotation(plot,lbid,amres) ;;;;;;;;;;;; this part tells the marker what color to be based on the anomaly markercolors = new(size(0),"integer") do n=0,size(0)-1,1 markercolors(n) = ((round((siteanom(n)*10),3))*-1)+140 end do markercolors=where((markercolors.lt.80),80,markercolors) stationmarker = new(size(0),graphic) do n=0,size(0)-1,1 mres = True ; marker resources for best track mres@gsMarkerIndex = 16 ; marker style (filled circle) mres@gsMarkerSizeF = 21.0 ; marker size mres@gsMarkerColor = markercolors(n) ; marker color mres@tfPolyDrawOrder= "PostDraw" if siteanom(n).ge.(.15) stationmarker(n) = gsn_add_polymarker(wks,plot,sitelons(n),sitelats(n),mres) end if tres = True ; text mods desired tres@tfPolyDrawOrder = "PostDraw" tres@txFont = "helvetica-bold" tres@txFontHeightF = 0.010 ; if any(siteanom.lt.-9.5) ; tres@txFontHeightF = 0.011 ; end if text = " " if siteanom(n).lt.(.15) text = " " end if if siteanom(n).ge.(.15).and.siteanom(n).le.(.5) text = "T" end if if siteanom(n).gt.(.5) text = ""+round(siteanom(n),3) end if stationtext = gsn_add_text(wks,plot,text,sitelons(n),sitelats(n),tres) end do txres = True txres@txFontHeightF = .02 ; Set the font height txres@txJust = "CenterCenter" label = "Total 1 Hour Snowfall (in)" gsn_text_ndc(wks,label,.37,.36 ,txres) txres@txFontHeightF = .018 label = "Ending at: "+ systemfunc("date +%A") + ", " + systemfunc("date +%F") gsn_text_ndc(wks,label,.37,.32 ,txres) minute = tochar(systemfunc("date +%M")) label = "At " + systemfunc("date +%I") + ":" + minute(0)+"0 " + systemfunc("date +%p") gsn_text_ndc(wks,label,.37,.29 ,txres) draw(plot) frame(wks) delete(sitefile) delete(sitelats) delete(sitelons) delete(sitedata) delete(siteanom) delete(markercolors) delete(stationmarker) ; make snowfall day total plot below wks_type = "png" wks_type@wkWidth = 4000 wks_type@wkHeight = 3200 wks = gsn_open_wks(wks_type,"stationsnowday") sitefile = "snow1day.dat" sitedata = asciiread(sitefile,-1,"string") sitelats = tofloat(str_get_field(sitedata,1,delim)) sitelons = tofloat(str_get_field(sitedata,2,delim)) siteanom = tofloat(str_get_field(sitedata,3,delim)) siteanom = where(siteanom.lt.0,0,siteanom) size = dimsizes(sitelons) plot = gsn_csm_contour_map(wks,fillvarlevel,res) lbres = True ; Set up a resource list for the labelbar. labels = (/"0","0.1","0.2","0.4","0.7","1.0","1.5","2.0","2.5","3.0","4.0","in"/) ;lbres@lbFillColors = (/10,15,20,30,45,60,85,110,135,160,200,-1/) ; use these with gsn_define_colormap(wks,"WhiteGreen") lbres@vpWidthF = 0.1 lbres@vpHeightF = 0.25 lbres@lbBoxLinesOn = False lbres@lbFillColors = (/140,139,138,136,133,130,125,120,115,110,100,-1/) lbres@lbMonoFillPattern = True lbres@lbOrientation = "Vertical" lbres@lbPerimOn = False lbres@lbLabelFontHeightF = .013 lbres@lbLabelAutoStride = True lbid = gsn_create_labelbar_ndc(wks,12,labels,.7,.5,lbres) amres = True amres@amZone = 0 amres@amParallelPosF = 0.4 amres@amOrthogonalPosF = 0 ;annoid = gsn_add_annotation(plot,lbid,amres) ;;;;;;;;;;;; this part tells the marker what color to be based on the anomaly markercolors = new(size(0),"integer") do n=0,size(0)-1,1 markercolors(n) = ((round((siteanom(n)*10),3))*-1)+140 end do markercolors=where((markercolors.lt.80),80,markercolors) stationmarker = new(size(0),graphic) do n=0,size(0)-1,1 mres = True ; marker resources for best track mres@gsMarkerIndex = 16 ; marker style (filled circle) mres@gsMarkerSizeF = 21.0 ; marker size mres@gsMarkerColor = markercolors(n) ; marker color mres@tfPolyDrawOrder= "PostDraw" if siteanom(n).ge.(.15) stationmarker(n) = gsn_add_polymarker(wks,plot,sitelons(n),sitelats(n),mres) end if tres = True ; text mods desired tres@tfPolyDrawOrder = "PostDraw" tres@txFont = "helvetica-bold" tres@txFontHeightF = 0.010 ; if any(siteanom.lt.-9.5) ; tres@txFontHeightF = 0.011 ; end if text = " " if siteanom(n).lt.(.15) text = " " end if if siteanom(n).ge.(.15).and.siteanom(n).le.(.5) text = "T" end if if siteanom(n).gt.(.5) text = ""+round(siteanom(n),3) end if stationtext = gsn_add_text(wks,plot,text,sitelons(n),sitelats(n),tres) end do txres = True txres@txFontHeightF = .02 ; Set the font height txres@txJust = "CenterCenter" label = "Total 24 Hour Snowfall (in)" gsn_text_ndc(wks,label,.37,.36 ,txres) txres@txFontHeightF = .018 label = "Ending at: "+ systemfunc("date +%A") + ", " + systemfunc("date +%F") gsn_text_ndc(wks,label,.37,.32 ,txres) minute = tochar(systemfunc("date +%M")) label = "At " + systemfunc("date +%I") + ":" + minute(0)+"0 " + systemfunc("date +%p") gsn_text_ndc(wks,label,.37,.29 ,txres) draw(plot) frame(wks) end