[ncl-talk] Mask 1D station data with shapefile?

Meina Wang mnawang at ucdavis.edu
Mon Jul 24 12:54:00 MDT 2017

Dear Dave,

Thank you very much for your detailed explanation.  I went though the
examples for shapefiles and found the function "shapefile_mask_data" to
filtered out the data outside specific shapefile.  I previously didn't
realized this function also works for 1D unstructured data as well besides
gridded 2D data, and it did what you've demonstrated for reading the lat/lon
from shapefile and determining if each station is within the shapefile.  So
this function worked for my case with no problem.  Thank you very much
again for your kind reply :)

Best regards,

On Mon, Jul 24, 2017 at 11:43 AM, Dave Allured - NOAA Affiliate <
dave.allured at noaa.gov> wrote:

> Meina,
> Read the geometry data from the shape file.  The geometry data is
> essentially a set of one or more polygon outlines in lat/lon coordinates.
> Now select the polygon that defines your area to mask.  Then use the NCL
> function gc_inout to determine whether each station is within the masked
> area.
> Please see NCL example shapefiles_13 for a demonstration of how to read
> the geometry and apply polygons to select station point data.  That is a
> general example for a shape file containing multiple features and multiple
> polygons per feature.  If your shape file contains only one feature or one
> polygon, you can simplify your program and eliminate one or two of the
> loops from the example.
>    http://www.ncl.ucar.edu/Applications/shapefiles.shtml
> --Dave
> On Sat, Jul 22, 2017 at 11:57 PM, Meina Wang <mnawang at ucdavis.edu> wrote:
>> Dear NCL users,
>> I wanted to use shapefile to mask the station observational data (1D) in
>> the grey area (sample plot attached below), and would like to pick out the
>> station data in the grey area (for calculation purpose later).  I'm
>> wondering if there is a way to do this using shapefile in ncl? Any
>> suggestion is much appreciated.  Thank you.
>> Best,
>> Meina

Meina Wang
PhD candidate in Atmospheric Science
Department of Land, Air and Water Resources
University of California, Davis
Davis, CA 95616
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170724/ba56a4e1/attachment.html 

More information about the ncl-talk mailing list