mesh plot

Chris Barker wrote:

Christian Kristukat wrote:

The second does a triangulation. Though I didn't understand what to do with the
triangulated data, as the result is still not an orthogonal grid.

Once you've got the triangulation, you can linearly interpolate between the three points of the triangle that a point is in for which you want the value.

I see. Thanks for explaining.

I've been meaning to wrap Jonathan Shewchuk's triangle code for Python, but haven't gotten around to it yet.

Triangle: A Two-Dimensional Quality Mesh Generator and Delaunay Triangulator

Does that code include the interpolation, i.e. the extraction of data on a regular grid? I can't imagine an easy way to achieve that.

Regards, Christian

Christian Kristukat wrote:

I've been meaning to wrap Jonathan Shewchuk's triangle code for Python, but haven't gotten around to it yet.

Triangle: A Two-Dimensional Quality Mesh Generator and Delaunay Triangulator

Does that code include the interpolation, i.e. the extraction of data on a regular grid? I can't imagine an easy way to achieve that.

No, you'd need to write the interpolation code yourself. That's another thing that's on my list. I have written some code for building a tree structure from the triangles created by triangle, so that the mesh can be quickly searched to find out what triangle a point is in. Interpolation would be easy from there.

If you need to do this for some data, and don't need to have a programming interface for it, and you're running Windows or MacOS, you can use this to do it:

http://response.restoration.noaa.gov/software/dogs/dogs.html

It's designed for other things, but it will do this as well.

You also might want to look into "Kriging" and software like Surfer.

I don't know if there is any open-source equivalent.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer
                                         
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...259...

Christian Kristukat wrote:

Chris Barker wrote:

Christian Kristukat wrote:

The second does a triangulation. Though I didn't understand what to do with the
triangulated data, as the result is still not an orthogonal grid.

Once you've got the triangulation, you can linearly interpolate between the three points of the triangle that a point is in for which you want the value.

I see. Thanks for explaining.

I've been meaning to wrap Jonathan Shewchuk's triangle code for Python, but haven't gotten around to it yet.

Triangle: A Two-Dimensional Quality Mesh Generator and Delaunay Triangulator

Does that code include the interpolation, i.e. the extraction of data on a regular grid? I can't imagine an easy way to achieve that.

Regards, Christian

Christian: CDAT (http://esg.llnl.gov/cdat/) has python bindings for natgrid (http://ngwww.ucar.edu/ngdoc/ng/ngmath/natgrid/nnhome.html), which I think does what you want.

-Jeff

···

--
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/CDC R/CDC1 Email : Jeffrey.S.Whitaker@...259...
325 Broadway Office : Skaggs Research Cntr 1D-124
Boulder, CO, USA 80303-3328 Web : Jeffrey S. Whitaker: NOAA Physical Sciences Laboratory

Jeff Whitaker wrote:

Christian Kristukat wrote:

Chris Barker wrote:

Christian Kristukat wrote:

The second does a triangulation. Though I didn't understand what to do with the
triangulated data, as the result is still not an orthogonal grid.

Once you've got the triangulation, you can linearly interpolate between the three points of the triangle that a point is in for which you want the value.

I see. Thanks for explaining.

I've been meaning to wrap Jonathan Shewchuk's triangle code for Python, but haven't gotten around to it yet.

Triangle: A Two-Dimensional Quality Mesh Generator and Delaunay Triangulator

Does that code include the interpolation, i.e. the extraction of data on a regular grid? I can't imagine an easy way to achieve that.

Regards, Christian

Christian: CDAT (http://esg.llnl.gov/cdat/) has python bindings for natgrid (http://ngwww.ucar.edu/ngdoc/ng/ngmath/natgrid/nnhome.html), which I think does what you want.

That works great! Moreover the package does not depend on cdat and can be used isolated.
Thanks a lot, Christian