[Thread Prev][Thread Next][Index]

Re: [ferret_users] making a contour a variable



Hi Paul,

> I would like to define a variable which is of the line of grid points which
> separates two values of a mask (the end product would look like a contour
> line). I attached a picture of the mask. How could I "select" the grid
> points which lie in the 0 value region (the shelf) but are adjacent to the 1
> value region (off shore).

That's very interesting.  I'm not 100% sure, but I think Ferret has a
2D smoother (moving average), which is similar to

    a_new(i,j) = [a(i-1,j) + a(i+1, j) + a(i,j-1) + a(i,j+1)]/4

If so, the grid points you want is

    mask = if (a_new ne 0) and (a eq 0) then 1

If the grid point is in the "interior" of the shelf, a_new = 0.  So,
a_new /= 0 and a == 0 only when the grid point is adjacent to the "1"
region.

Regards,

Ryo

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

Privacy Policy | Disclaimer | Accessibility Statement