[Thread Prev][Thread Next][Index]

Re: [ferret_users] Data inside a polygon



Hi,
To read your lon_lat.txt data,
yes? file/var='xvert,yvert'  lon_lat_txt
Then there is a Ferret function, PT_IN_POLY,
yes? show function pt_in_poly
PT_IN_POLY(A,XVERT,YVERT)
    Return -1 outside, 0 if on edge, 1 if inside polygon
    A: Variable on the XY grid and region to be tested
    XVERT: X-coordinates of vertices of polygon
    YVERT: Y-coordinates of vertices of polygon
which returns a mask which is -1 outside of the described polygon and 1 inside.  I'm not sure from your question whether your netcdf files contain gridded data. If the data is on a grid, or if it is on a "degenerate" grid of a single  xy location then the function should work.

Maybe this will get you started.

-Ansley

On 4/3/2014 7:56 PM, nhacoceano . wrote:
Hi Folks,

I'm relatively new in Ferret. I have a collection of netcdf data, 5 different files each one within a particular domain with lon,lat coordinates. I will collect temporal series from a lon, lat spot. And I need to delimit the area of each domain to get the temporal data from the right domain (netcdf file).

For this I have the polygon of each domain. For example, one polygon.

~$ cat lon_lat.txt

-51.5694966551446 -27.25074563697085
-51.9358954273831 -34.45036737205019
-44.12361781657283 -34.25415718650989
-44.75504598711086 -26.95605841341487
-51.5694966551446 -27.25074563697085

How can I start to do that in ferret?

Thanks in advance for any help.



--
Adriano Wiermann Barroso

Oceanólogo 
Universidade Federal do Rio Grande - FURG/RS


[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement