[ncl-talk] plot shapefile precip data

Mary Haley haley at ucar.edu
Fri May 27 13:10:15 MDT 2016


Andrew,

Can you either provide the data files, or the output from:

ncl_filedump nws_precip_1day_observed_20160221.shp

It's possible that your shapefile has just one feature on it, and if so,
you can technically read the data as a series of 1D arrays, and plot with
something like:

; UNTESTED

f = addfile("nws_precip_1day_observed_20160221.shp","r")
pcp = ndtooned (f->PCP)  ; or whatever it's called
lat = ndtooned(f->y)
lon = ndtooned(f->x)

res = True

res at sfXArray = lon
res at sfYArray = lat
res at gsnAddCyclic = False
res at cnFillOn = True
res at cnFillMode = "RasterFill"

plot = gsn_csm_contour_map(wks,pcp,res)

--Mary


On Fri, May 27, 2016 at 11:07 AM, Andrew Kren - NOAA Affiliate <
andrew.kren at noaa.gov> wrote:

> Dear NCL talk,
>
> I am trying to read a shape file that has lat/lon coordinates and
> precipitation. My issue is that my pcp data is one-dimensional and so not
> sure how to connect the metadata to the lat/lon coordinates so it plots
> correctly. I attached my code. Any help is appreciated.
>
> Thanks,
>
> --
> Andrew Kren, PhD
> Research Scientist I, Global Observing Systems Analysis (GOSA) Group
> NOAA ESRL Global Systems Division (Rm 3C515)
> 325 Broadway, Boulder, CO 80305
> (303) 497-5418
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160527/d3bec9fe/attachment.html 


More information about the ncl-talk mailing list