<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Yes,<div class="">I would suggest you to first create a netcdf file with the mask (otherwise using the shapefile every time takes too much time): see example 11 here <a href="https://www.ncl.ucar.edu/Applications/shapefiles.shtml" class="">https://www.ncl.ucar.edu/Applications/shapefiles.shtml</a>. </div><div class=""><br class=""></div><div class="">Once you have the netcdf file with the mask you can mask the data and compute the average simply as </div><div class=""><br class=""></div><div class=""><div class="">;mask data over italy </div><div class="">ndvi_it=mask(ndvi_it, ita_mask.eq.1, ndvi@_FillValue)</div><div class="">ndvi_avg=dim_avg_n_Wrap(ndvi_it,(/1,2/))</div></div><div class=""><br class=""></div><div class="">Cheers </div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">Il giorno 31 ott 2017, alle ore 12:07, Damjan Jelić <<a href="mailto:damjan.jelic@fmf.uni-lj.si" class="">damjan.jelic@fmf.uni-lj.si</a>> ha scritto:</div><br class="Apple-interchange-newline"><div class=""><div class="">Dear NCL support,<br class=""><br class="">supose i have 2D georef. data and i have shape file of one country borders within that 2D field. Is it possible to use that shape file to approximately cut out data from that 2D field and do some math with it?<br class="">To visualize the question, Im attaching a figure containing lightning-strikes of some period on 1x1km^2 resolution over Croatia and im interested for begining how much of strikes occurred over land part of Croatia.<br class=""><br class="">Best,<br class="">Damjan<span id="cid:DAC0095A-ADFB-49C6-A301-17E7C6978624@fritz.box"><lightning_test.png></span>_______________________________________________<br class="">ncl-talk mailing list<br class=""><a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a><br class="">List instructions, subscriber options, unsubscribe:<br class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk<br class=""></div></div></blockquote></div><br class=""></div></body></html>