[Thread Prev][Thread Next][Index]

Re: [ferret_users] polygon to mask country



Hi Nicolas,

As a check of your definition, does a plot of the points

  PLOT/VS/LINE xp, yp

show the outline of the boundary you want?

On 3/25/2019 4:18 AM, Nicolas Freychet wrote:
Dear Ferret users,

I'm trying to create a mask for a country, following this discussion: https://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2012/msg00019.html

I managed to have a netcdf file with all lon/lat coordinate to define a polygon of the country as in the discussion, but now I am not sure how to apply it to mask my data. The pt_in_poly function (https://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/appendix-a-external-functions/pt_in_poly) requires to define a table of xp/yp. I tried to do something like:

let xp=LON[d=7,i=1:735178]
let yp=LAT[d=7,i=1:735178]
let mask = if pt_in_poly(Tmax[d=1,l=1],xp,yp) gt 0 then 1

But it doesn't seem to work. I think it's the way I define xp/yp that is wrong, but I don't know how to make a table {} from a coordinate. Any idea?

Cheers,
Nico



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

Privacy Policy | Disclaimer | Accessibility Statement