<div dir="ltr"><div class="gmail_default" style="font-size:small">Mira,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">[I had already started this email before Adam responded, so I'm going to go ahead and send this. Adam's suggestions are perfectly valid as well.]</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">One way to average data over a particular region is to use a shapefile to provide the lat/lon area of interest, and then use the gc_inout function to collect all the points that fall inside (or outside) the region of interest, so you can then take an average. Of course, this average is not very meaningful because it's taken over a rather large area, but I wanted to show how you would do it.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">We have a number of examples of doing this using shapefiles (the country shapefiles are usually downloaded from the <a href="http://gadm.org/country" target="_blank">gadm.org/country</a>). See:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default"><a href="http://www.ncl.ucar.edu/Applications/shapefiles.shtml" target="_blank">http://www.ncl.ucar.edu/Applications/shapefiles.shtml</a><br></div><div class="gmail_default"><br></div><div class="gmail_default">In particular, see example shapefile_19.ncl, which uses "shapefile_mask_data" to mask the data based on outlines in a shapefile. It uses "gc_inout" under the hood.</div><div class="gmail_default"><br></div><div class="gmail_default">The tricky part for you is that it sounds like you only want to mask the data based on a particular subset of Greenland, which I don't know if it is available in a shapefile.</div><div class="gmail_default"><br></div><div class="gmail_default">I've attached an example that uses two regions of Greenland called "Ammassalik" and "Illoqqortoormiut", which I downloaded from <a href="http://gadm.org/country">gadm.org/country</a> (GRL_adm2.shp).</div><div class="gmail_default"><br></div><div class="gmail_default">The second image shows the original data grid drawn with markers, and the red markers indicate data that were set to missing by the masking routine.</div>
<div class="gmail_default"><br></div><div class="gmail_default">You can get the ts_Amon NetCDF data file from <a href="http://www.ncl.ucar.edu/Applications/Data/">http://www.ncl.ucar.edu/Applications/Data/</a></div><div class="gmail_default"><br></div><div class="gmail_default">--Mary</div><div class="gmail_default"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Sep 27, 2015 at 12:30 PM, <span dir="ltr"><<a href="mailto:mberdahl@envsci.rutgers.edu" target="_blank">mberdahl@envsci.rutgers.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
I have model output for the north atlantic/greenland region and I would<br>
like to take regional averages of precipitation. I'm wondering how to<br>
define the regions with NCL. For example, I would like to take the<br>
average of precipitation over the Southeast of Greenland, this region<br>
would have to be a polygon defined by the user. I would only like to<br>
consider grid cells on land as well. Does anyone have any advice on this?<br>
<br>
Independent of this, I would like to be able to choose the grid cell<br>
closest to a lat/lon point that is user-defined. Can someone point me in<br>
the right direction please?<br>
<br>
Thanks very much,<br>
Mira<br>
<br>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
</blockquote></div><br></div>