[Thread Prev][Thread Next][Index]

Re: [ferret_users] PT_IN_POLY



Hi Anja,
Thank you for writing. You are right, the function does not apply a modulo operation to translate longitudes if they don't match the longitude range in the grid of the variable. Also, the grid of the etopo datasets are perhaps unexpected in that the longitudes run from 20 to 380 instead of 0 to 360.

I'll put a note in the documentation about this, and we should be able to improve the function itself so that it would do that translation.

Ansley

On 9/5/2012 12:01 AM, Anja Eggert wrote:
Dear Ferret developers,
I just noticed a problem when I used the function PT_IN_POLY and the choice of the region. First I used the example from the ferret site. It worked and I wanted to run my own example in the Benguela upwelling area off Namibia at approx. 10°E-14°E.


This is my example that does not work:

use etopo60
let xp = {10.1,10.4,10.3,11.6,14,11.5,10.1}
let yp = {-17,-19,-20,-23,-23,-17,-17}
go basemap x=-20:50 y=10:-40 20
plot/vs/thick/line/color=blue/over/nolab xp,yp
let mask = if pt_in_poly(rose,xp, yp) gt 0 then 1
shade /over mask


This is my example that does work:

use etopo60
let xp = {370.1,370.4,370.3,371.6,374,371.5,370.1}
let yp = {-17,-19,-20,-23,-23,-17,-17}
go basemap x=340:410 y=10:-40 20
plot/vs/thick/line/color=blue/over/nolab xp,yp
let mask = if pt_in_poly(rose,xp, yp) gt 0 then 1
shade /over mask

Okay, I know now what I need to do. But it was very confusing for several hours.... So maybe this problem is worth to get your attention?

Cheers,
Anja




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

Privacy Policy | Disclaimer | Accessibility Statement