[ncl-talk] Area average using multiple shapefiles

Dave Allured - NOAA Affiliate dave.allured at noaa.gov
Sat May 9 10:07:38 MDT 2020


You can do this in a single run in an NCL program.  Get a list of all the
shapefile names.  This can be done externally, or within NCL like this:

   file_names = systemfunc ("ls -1 path/*.shp")

Then read all the precip data into a large array, one time only.  Then loop
over all the names of the shape files.  For each shape file, use one of the
known NCL methods to compute areal average over the defined region on the
precip array.  When the loop is finished, you will have one areal average
for each region.


On Sat, May 9, 2020 at 9:40 AM Xueyan Zhang via ncl-talk <ncl-talk at ucar.edu>
wrote:

> Hello ncl-talk,
>
> I want to calculate areal average of precipitation (netcdf format) for
> hundreds of small regions that are defined by shapefiles with different
> names. Any ideas to do a batch work?
>
> Thank you!
>
> Xueyan
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200509/bfd9c2a1/attachment.html>


More information about the ncl-talk mailing list