Re: Regarding the Fit_Ellipse Program [message #59010 is a reply to message #58903] |
Thu, 28 February 2008 07:44  |
pgrigis
Messages: 436 Registered: September 2007
|
Senior Member |
|
|
plim.dream...@gmail.com wrote:
>> May ask again what are your staring points, before you do the contour?
>> How are these points defind? I have this feeling that there may be a
>> much
>> simpler way...
>>
>> Paolo
>
> Hi Paolo and David,
> Hummm, well, before I do the contour I just have a square field full
> of points, so a big array of x,y (this is input data, I do not choose
> the locations of these points, i read them in from a file), and to
> each point I have a density-value attributed, rho. The points are not
> in a matrix, they are randomly distributed in the field, so I do a:
> contour,rho,x,y,levels=level,triangulation=tri,path_xy=polic ons2,path_info=infocons2,/
> path_data_coords,/path_doublt,/noerase,/data
I don't think this is the right approach to the problem.
What I would do is to get a regularly gridded array
for rho first (for instance with trigrid, but there may
be other possibilities).
Once you have that, it is easy to produce an input array
suitable for fit_ellipse (just set all points higher (or lower)
than a threshold to 0, and the others to 1).
Try something like:
TRIANGULATE, x, y, Triangles
Result = TRIGRID( x,y,rho, Triangles,[dx,dy],[minx,miny,maxx,maxy]] )
where dx and dy is the spacing of the regular grid and minx etc. are
the boundaries.
Cheers,
Paolo
> That provides me with the xy positions of the vertices of several
> different contours in the field all of which have the same density
> level. For each contour I want to fit and plot an ellipse and obtain
> the parameters.
> Hope this helps,
> Bruno
|
|
|