[ncl-talk] Reading Ozone data with lat/lon

Emma Nelson enelson23 at wisc.edu
Thu Nov 9 10:53:25 MST 2017


Hi,

I've been trying to plot a file with data from an Ozone station with its lat/lon data from another file.  I've been following an example script but I keep getting an error that says, "fatal:Argument type mismatch on argument (1) of (gsn_csm_contour_map) can not coerce" when I try to plot.  Any help would be appreciated!  Here is my script:


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

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


diri = "/Users/EmmaNelson/Desktop/"

fili = "Ozone SanAn2016.csv"

data = asciiread(diri+fili, -1, "string")

header = True

delim = ","


data2 = asciiread(diri+"O3 Stationlatlon.csv", -1, "string")

header = True

delim = ","


sloc = str_get_field(data2, 1, ",")

lat = tofloat(str_get_field(data2, 2, ",") )

lon = tofloat(str_get_field(data2, 3, ",") )


pltDir = "/Users/EmmaNelson/Desktop/"

pltNam = "Ozone"

pltType = "x11"


wks = gsn_open_wks(pltType,pltDir+pltNam)

gsn_define_colormap(wks,"WhViBlGrYeOrRe")


res = True

res at gsnFrame = False

res at gsnMaximize = True

res at pmTickMarkDisplayMode = "Always"


res at mpOutlineBoundarySets = "USStates"


res at cnFillOn = True

res at cnLinesOn = True

res at cnLineLabelsOn = True

res at sfXArray = lon

res at sfYArray = lat


map = gsn_csm_contour_map(wks,data,res)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171109/d4f4cd5b/attachment.html>


More information about the ncl-talk mailing list