plot data by county level

From: Luo, Chao <chao.luo_at_nyahnyahspammersnyahnyah>
Date: Fri Mar 08 2013 - 14:29:32 MST

Hello,

I am trying to plot emission data over county map in GA. I use Earth..2 function to plot map by county level in GA and county map plot is fine, but there is error when emission data over the county map.
Error: scalar_field: If the input data is 1-dimensional, you must set sfXArray and sfYArray to 1-dimensional arrays of the same length
I was wondering how to setup sfXArry and sfYArry for county level dataset. Following is my NCL script.

Thanks for your comments and help!

cl
---------------------------------

load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"

begin
wks = gsn_open_wks("ps","maponly")
gsn_define_colormap(wks,"BlAqGrYeOrRe") ; choose colormap
plot = new(2,graphic)

res = True
res@cnFillColors = (/ 0,5,10,20,30,40,50,65,75,85,96/)
res@cnLevels = (/1.,5.,10.,15.,20.,25.,30.,35,40/)

mpres = True
; mpres@gsnMaximize = True
mpres@mpFillOn = False

;
; These next three resources set up the drawing of county boundaries.
;
mpres@mpOutlineBoundarySets = "AllBoundaries"
mpres@mpDataBaseVersion = "Ncarg4_1"
mpres@mpDataSetName = "Earth..2"

mpres@mpGridAndLimbOn = False
mpres@mpPerimOn = True

mpres@mpLimitMode = "LatLon"
mpres@mpMinLatF = 25.
mpres@mpMaxLatF = 50.
mpres@mpMinLonF = -130.
mpres@mpMaxLonF = -60.
mpres@tiMainString = ":F22:US with all counties outlined"

; map = gsn_csm_map(wks,mpres)

mpres@mpOutlineBoundarySets = "GeophysicalAndUSStates" georgia_counties = \
(/"Appling", "Atkinson", "Bacon", "Baker", "Baldwin", "Banks", "Barrow", \
"Bartow", "Ben Hill", "Berrien", "Bibb", "Bleckley", "Brantley", "Brooks",\
"Bryan", "Bulloch", "Burke", "Butts", "Calhoun", "Camden", \
"Candler", "Carroll", "Catoosa", "Charlton", "Chatham", "Chattahoochee", \
"Chattooga", "Cherokee", "Clarke", "Clay", "Clayton", "Clinch","Cobb", \
"Coffee", "Colquitt", "Columbia", "Cook", "Coweta", \
"Crawford", "Crisp", "Dade", "Dawson", "Decatur", "DeKalb", "Dodge", \
"Dooly", "Dougherty", "Douglas", "Early", "Echols", "Effingham", "Elbert", \
"Emanuel", "Evans", "Fannin", "Fayette","Floyd", "Forsyth", \
"Franklin", "Fulton", "Gilmer", "Glascock", "Glynn", "Gordon", "Grady", \
"Greene", "Gwinnett", "Habersham", "Hall", "Hancock", "Haralson", \
"Harris", "Hart", "Heard", "Henry", "Houston", "Irwin", \
"Jackson", "Jasper", "Jeff Davis", "Jefferson", "Jenkins", "Johnson", \
"Jones", "Lamar", "Lanier", "Laurens", "Lee", "Liberty", "Lincoln", \
"Long", "Lowndes", "Lumpkin", "Macon", "Madison", "Marion", \
"McDuffie", "McIntosh", "Meriwether", "Miller", "Mitchell", "Monroe", \
"Montgomery", "Morgan", "Murray", "Muscogee", "Newton", "Oconee", \
"Oglethorpe", "Paulding", "Peach", "Pickens", "Pierce", "Pike", \
"Polk", "Pulaski", "Putnam", "Quitman", "Rabun", "Randolph", "Richmond", \
"Rockdale", "Schley", "Screven", "Seminole", "Spalding", "Stephens", "Stewart", \
"Sumter", "Talbot", "Taliaferro", "Tattnall", "Taylor", "Telfair", "Terrell", \
"Thomas", "Tift", "Toombs", "Towns", "Treutlen", "Troup", "Turner", \
"Twiggs", "Union", "Upson", "Walker", "Walton", "Ware", "Warren", "Washington", \
"Wayne", "Webster","Wheeler", "White", "Whitfield", "Wilcox", "Wilkes", \
"Wilkinson", "Worth" /)
delete(mpres@mpOutlineSpecifiers)
mpres@mpOutlineSpecifiers = "Georgia . " + georgia_counties
mpres@mpMinLatF = 30.5
mpres@mpMaxLatF = 35.2
mpres@mpMinLonF = -85.8
mpres@mpMaxLonF = -81.
mpres@tiMainString = ":F22:Georgia and its counties outlined"

; read emis data
emis = asciiread("BBEP_159x7.dat" , (/159,7/),"float")

plot(0) = gsn_csm_contour_map_ce(wks,emis(:,6),mpres)

end

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Mar 8 12:29:46 2013

This archive was generated by hypermail 2.1.8 : Wed Mar 13 2013 - 14:19:38 MDT