comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Clustering x,y coordinates with IDL?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Clustering x,y coordinates with IDL? [message #70315 is a reply to message #70220] Mon, 29 March 2010 08:38 Go to previous message
Mort Canty is currently offline  Mort Canty
Messages: 134
Registered: March 2003
Senior Member
Am 29.03.2010 11:44, schrieb Maxwell Peck:
> Hi All, This is not strictly an IDL question but I'm hoping it's
> something simple to do and I'm not missing something painfully
> obvious!
>
> I have a set of x,y values e.g.
>
> x = [34.5,36.7,35.6,80.5,81.2,79.3]
> y = [50.6,51.2,53.2,48.5,50.3,51.2]
>
> The values will be sparsely clustered overall but tightly within an
> approximate 10x10 box. What I'd like to do is replace each clusters
> values with the average x,y value. This doesn't have to be 'perfect',
> the edges aren't that important.
>
> My initial thought was to use hist_2d or hist_nd to try and calculate
> the 2d histogram with a binsize of 10 and use this to average the
> values but I can't get it to work. My other thought was using griddata
> or something similar, or at worst generating an approximate binary
> image and running a window over it.
>
> Any advice or suggestions would be appreciated.
>
> Regards
>
> Max
>


The IDL function CLUSTER() implements k-means clustering. I think that's
what you want.

Mort
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Conversion of 2D to 1D
Next Topic: "Help file not found: idl"

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 16:14:24 PDT 2025

Total time taken to generate the page: 0.00486 seconds