;************************************************* ; proj_3.ncl ; ; Concepts illustrated: ; - Drawing filled contours over an orthographic map ; - Changing the center latitude and longitude for an orthographic projection ; - Turning off map fill ; ;************************************************ ; ; 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 ;************************************************ ; read in netCDF file ;************************************************ a = addfile("may_hgt-hgt_1996-2012_850hPa.nc","r") ;************************************************ ; read in data ;************************************************ printVarSummary(a) t = a->regslope(:,:) ;************************************************ ; create plot ;************************************************ wks = gsn_open_wks("png","proj") ; send graphics to PNG file res = True res@cnLevelSelectionMode = "ManualLevels" res@cnMinLevelValF = -5.00 res@cnMaxLevelValF = 5.00 res@cnLevelSpacingF = 0.5 res@mpProjection = "Orthographic" ; choose projection res@mpPerimOn = False ; turn off box around plot res@mpFillOn = False res@mpCenterLonF = 122. ; choose center lon res@mpCenterLatF = 45. ; choose center lat res@mpDataBaseVersion = "MediumRes" res@mpOutlineOn = True res@cnFillOn = True ; color plot desired res@cnFillPalette = "BlueDarkRed18" ; select color map res@cnLineLabelsOn = False ; turn off contour line labels res@cnLinesOn = False ; turn off contour lines res@mpGridAndLimbOn = True ; turn on lat/lon grid lines res@mpGridMaskMode = "MaskNotOcean" ; don't draw over land or ; inland water bodies ; res@lbLabelFontHeightF = 0.015 ; label bar font height res@tiMainString = "Test Orthographic Projection" ; add a title ; res@tiMainFontHeightF = .018 ; font height ;;************************************************************ ;;Add shapefiles ;;************************************************************ load "./shapefile_utils.ncl" filename = "sig_regpval_1996-2012.shp" print_shapefile_info(filename) plot = gsn_csm_contour_map(wks,t,res) pres = True pres@gsMarkerIndex = 1 pres@gsMarkerColor = "black" poly = gsn_add_shapefile_polymarkers(wks,plot,filename,pres) end