weighting: irregular grid

This is a discussion on weighting: irregular grid within the Idl-pvwave forums in Programming Languages category; Hello. I'm sure someone has come up with code to do this, so rather than re- invent the wheel: I have a dataset: f(x,y),x,y, where the x and y grids are somewhat irregular. I can use trigrid and triangulate to get an image of f, of course, but what I really need is f weighted by the area each data point occupies. One can define the area that a data point occupies by drawing lines perpendicular to the line connecting the point with neighboring points: eventually one will have some sort of polygon enclosing the point. One can then weight ...

Go Back   Application Development Forum > Programming Languages > Idl-pvwave

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 09-05-2008, 11:23 AM
Mark
Guest
 
Default weighting: irregular grid

Hello.

I'm sure someone has come up with code to do this, so rather than re-
invent the wheel:

I have a dataset: f(x,y),x,y, where the x and y grids are somewhat
irregular. I can use trigrid and triangulate to get an image of f, of
course, but what I really need is f weighted by the area each data
point occupies.

One can define the area that a data point occupies by drawing lines
perpendicular to the line connecting the point with neighboring
points: eventually one will have some sort of polygon enclosing the
point. One can then weight the f-value by the area of the polygon.
Something like this would work very well for me.

Does anyone know of code that accomplishes something like this before
I kill a day or two trying to write it myself? No doubt IDL has a
canned routine that does this but I haven't been able to find it....

Thanks very much,

Mark
Reply With Quote
  #2  
Old 09-05-2008, 11:53 AM
Jean H
Guest
 
Default Re: weighting: irregular grid

> One can define the area that a data point occupies by drawing lines
> perpendicular to the line connecting the point with neighboring
> points: eventually one will have some sort of polygon enclosing the
> point. One can then weight the f-value by the area of the polygon.
> Something like this would work very well for me.


the proper term for this is Voronoi Polygons... I have no idea if it's
implemented or not in IDL..

Jean
Reply With Quote
  #3  
Old 09-05-2008, 11:54 AM
Jean H
Guest
 
Default Re: weighting: irregular grid

Jean H wrote:
>> One can define the area that a data point occupies by drawing lines
>> perpendicular to the line connecting the point with neighboring
>> points: eventually one will have some sort of polygon enclosing the
>> point. One can then weight the f-value by the area of the polygon.
>> Something like this would work very well for me.

>
> the proper term for this is Voronoi Polygons... I have no idea if it's
> implemented or not in IDL..
>
> Jean


oops, I should have opened the help file before to say that... there is
a Voronoi procedure readily available!

Jean
Reply With Quote
  #4  
Old 09-05-2008, 11:58 AM
pgrigis@gmail.com
Guest
 
Default Re: weighting: irregular grid



Mark wrote:
> Hello.
>
> I'm sure someone has come up with code to do this, so rather than re-
> invent the wheel:
>
> I have a dataset: f(x,y),x,y, where the x and y grids are somewhat
> irregular. I can use trigrid and triangulate to get an image of f, of
> course, but what I really need is f weighted by the area each data
> point occupies.

Maybe you should first define "area each data point occupies"...
do you mean the area of the voronoi region around the point?

Ciao,
Paolo

>
> One can define the area that a data point occupies by drawing lines
> perpendicular to the line connecting the point with neighboring
> points: eventually one will have some sort of polygon enclosing the
> point. One can then weight the f-value by the area of the polygon.
> Something like this would work very well for me.
>
> Does anyone know of code that accomplishes something like this before
> I kill a day or two trying to write it myself? No doubt IDL has a
> canned routine that does this but I haven't been able to find it....
>
> Thanks very much,
>
> Mark

Reply With Quote
  #5  
Old 09-05-2008, 12:00 PM
pgrigis@gmail.com
Guest
 
Default Re: weighting: irregular grid



Mark wrote:
> Hello.
>
> I'm sure someone has come up with code to do this, so rather than re-
> invent the wheel:
>
> I have a dataset: f(x,y),x,y, where the x and y grids are somewhat
> irregular. I can use trigrid and triangulate to get an image of f, of
> course, but what I really need is f weighted by the area each data
> point occupies.
>
> One can define the area that a data point occupies by drawing lines
> perpendicular to the line connecting the point with neighboring
> points: eventually one will have some sort of polygon enclosing the
> point. One can then weight the f-value by the area of the polygon.
> Something like this would work very well for me.


This is called the "voronoi" region, which can easily be computed
from the Delauney triangulation: see 21.7 in Numerical recipes 3d
edition.
(ignore my previous post).

Paolo

>
> Does anyone know of code that accomplishes something like this before
> I kill a day or two trying to write it myself? No doubt IDL has a
> canned routine that does this but I haven't been able to find it....
>
> Thanks very much,
>
> Mark

Reply With Quote
  #6  
Old 09-05-2008, 02:13 PM
Mark
Guest
 
Default Re: weighting: irregular grid

On Sep 5, 11:54*am, Jean H <jghas...@DELTHIS.ucalgary.ANDTHIS.ca>
wrote:
> Jean H wrote:
> >> One can define the area that a data point occupies by drawing lines
> >> perpendicular to the line connecting the point with neighboring
> >> points: eventually one will have some sort of polygon enclosing the
> >> point. One can then weight the f-value by the area of the polygon.
> >> Something like this would work very well for me.

>
> > the proper term for this is Voronoi Polygons... *I have no idea if it's
> > implemented or not in IDL..

>
> > Jean

>
> oops, I should have opened the help file before to say that... there is
> a Voronoi procedure readily available!



Thanks everyone. I've never heard the expression Voronoi polygon so no
wonder I couldn't find anything in IDL help!

Mark
>
> Jean


Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 03:18 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.