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

Home » Public Forums » archive » help me to test the following code
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
help me to test the following code [message #69242] Sun, 27 December 2009 15:06
chenbo09@gmail.com is currently offline  chenbo09@gmail.com
Messages: 15
Registered: May 2009
Junior Member
Hi everyone,

Something weird happened when I was trying to cluster some points
into to 2 classes based on their location. I kept on compiling and
executing the code, sometimes it reported error, but sometimes it run
sucessfully and gave me an answer(without modifying anything)!!!!!

Here is the code:
************************************************************ **************************
pro cluster_test
a= [ [558288.75d, 4609749.2d, 236.88000, 3.0000000],
$
[558285.49d, 4609729.9d, 236.77000, 3.0000000],
$
[558288.75d, 4609749.2d, 236.88000, 3.0000000],
$
[558286.91d, 4609749.5d, 236.79000, 3.0000000],
$
[558282.26d, 4609732.0d, 236.11000, 3.0000000],
$
[558285.20d, 4609730.7d, 236.41000, 3.0000000],
$
[558283.38d, 4609731.0d, 236.67000, 3.0000000],
$
[558281.54d, 4609731.3d, 236.83000, 3.0000000],
$
[558281.82d, 4609730.5d, 237.23000, 3.0000000],
$
[558283.67d, 4609730.2d, 237.05000, 3.0000000],
$
[558284.16d, 4609729.4d, 237.27000, 3.0000000],
$
[558282.31d, 4609729.7d, 237.36000,
3.0000000]]

b = a[0:1,*]
b[0,*] = b[0,*] - long(a[0,*]/100)*100
b[1,*] = b[1,*] - long(a[1,*]/100)*100

plot,b[0,*],b[1,*]

print,b

weights = CLUST_WTS(b, N_CLUSTERS = 2)

rst = CLUSTER(b,weights,n_clusters = 2)
sub = where(rst eq 0)
pa = a[*,sub]

print,pa

end
************************************************************ **************************
The first and second column of the array a is X,Y
coordinate,respectivly. Because the numbers are too huge, I tried to
make them relatively smaller by substracting a number, then I tried to
cluster the points using the new coordinates(array b). If you plot tha
array b you will find that the points can be clustered into 2 classes.

I'm sitting here waiting for your help, thanks a lot!
[Message index]
 
Read Message
Previous Topic: Writing eps files from iplot
Next Topic: compile of several pro files

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

Current Time: Thu Oct 09 22:13:12 PDT 2025

Total time taken to generate the page: 0.80169 seconds