[ncl-talk] Need help for extracting the polygon average value for a parameter from wrfout* file using a shapefile

Mary Haley haley at ucar.edu
Fri Mar 6 09:01:45 MST 2015


I forgot to attach the sh_utils.ncl script. Here it is. This has the
average function, which is based on the one on the shapefiles page.

--Mary


On Fri, Mar 6, 2015 at 9:00 AM, Mary Haley <haley at ucar.edu> wrote:

> Dipak,
>
> I do see your other message to me offline, but I will send this example in
> case it helps.  Sorry it took so long.
>
> This example uses the HGT variable on a WRF output file, because this is
> an easy one to see if the values look correct.  I then used the USA_adm
> shapefile to get all the counties in Pennsylvania (mostly so it would run
> faster while I was testing it) and averaged the HGT value over each county.
> The function that does the averaging also draws filled polygons on a map
> plot of the averaged area, so you can compare the plots.
>
> See the attached script, and the final PNG image which shows the original
> HGT field as a filled contour plot, and then the HGT field over
> Pennsylvania only, averaged for each county.
>
> --Mary
>
> On Wed, Mar 4, 2015 at 4:04 PM, Mary Haley <haley at ucar.edu> wrote:
>
>> I will create an example for you soon, based on shapefiles_14.ncl and
>> shapefiles_11.ncl
>>
>> --Mary
>>
>>
>> On Tue, Mar 3, 2015 at 2:13 PM, Dipak Sahu <dipakmath at gmail.com> wrote:
>>
>>> Dear NCL developers and experts
>>>     Now I have some issues with wrfout files from WRF model. I need to
>>> extract the polygon average value of surface temperatures for each polygon
>>> using a shapefile over southern California. I have the shapefiles with
>>> .shp, .dbf, .sbx, .shx and .sbn.
>>>
>>> I just able to plot the variables for different polygon (i.e, for
>>> different county) with the help of the sample script "shapefiles_11.ncl",
>>> but still I am facing problem how to make the average over the county and
>>> how to save the masked county data in .nc file or .csv file with latitude,
>>> longitude and variable.
>>>
>>> I am waiting for any suggestions and help from the NCL experts how to
>>> resolve this issue. If any sample scripts are there it will be more
>>> appreciable.
>>>
>>> with thanks and regards
>>> Dipak
>>>
>>>
>>> _______________________________________________
>>> ncl-talk mailing list
>>> 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/20150306/eec17181/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: shp_utils.ncl
Type: application/octet-stream
Size: 6032 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150306/eec17181/attachment.obj 


More information about the ncl-talk mailing list