;---------------------------------------------------------------------- ; dataonmap_5_640.ncl ; ; Concepts illustrated: ; - Contouring one-dimensional X, Y, Z data ; - Using the special "lat1d" / "lon1d" attributes for plotting ;---------------------------------------------------------------------- ; These files are loaded by default in NCL V6.2.0 and newer ; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" ; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl" begin ; ; Data is stored in four columns: station_name lat lon pwv ; Read in each line as a string, use "str_get_field" to ; read in the fields of interest and "tofloat" to convert ; to float. ; lines = asciiread("pw.dat",-1,"string") pwv = tofloat(str_get_field(lines(1:),4," ")) ; 32 points pwv@lat1d = tofloat(str_get_field(lines(1:),2," ")) ; 32 points pwv@lon1d = tofloat(str_get_field(lines(1:),3," ")) ; 32 points wks = gsn_open_wks("png","dataonmap") ; send graphics to PNG file res = True res@gsnMaximize = True res@cnLevelSelectionMode = "ManualLevels" res@cnMinLevelValF = 15 ; 15.25 res@cnMaxLevelValF = 50 ; 49.75 res@cnLevelSpacingF = 1.125 res@cnFillOn = True res@cnLinesOn = False res@cnFillPalette = "cmp_flux" res@tiMainString = "GPS PWV (18Z)" ;---Zoom in on map res@mpMinLatF = min(pwv@lat1d)-1 res@mpMaxLatF = max(pwv@lat1d)+1 res@mpMinLonF = min(pwv@lon1d)-1 res@mpMaxLonF = max(pwv@lon1d)+1 ;---Customize the map outlines. res@mpDataBaseVersion = "MediumRes" res@mpFillOn = False res@mpOutlineBoundarySets = "GeophysicalAndUSStates" res@mpUSStateLineColor = "Gray10" res@pmTickMarkDisplayMode = "Always" plot = gsn_csm_contour_map(wks,pwv,res) end