0

I am an IDL beginner and I was wondering if I could get some help on clustering in IDL. I found a good example on Harris Geospatial that explains the method, however, I am confused on how to run the clustering on my own data (ASCII) to perform the K-mean analysis. How can I use my data instead of the 'random' function that generates random numbers
Below is the code I found on Harris:

n = 50
c1 = RANDOMN(seed, 3, n)
c1[0:1,*] -= 3
c2 = RANDOMN(seed, 3, n)
c2[0,*] += 3
c2[1,*] -= 3
c3 = RANDOMN(seed, 3, n)
c3[1:2,*] += 3
array = [[c1], [c2], [c3]]
; Compute cluster weights, using three clusters: 
weights = CLUST_WTS(array, N_CLUSTERS = 3) 
; Compute the classification of each sample: 
result = CLUSTER(array, weights, N_CLUSTERS = 3)

Thank you.

asynchronos
  • 583
  • 2
  • 14
Dan
  • 11
  • 3

1 Answers1

0

you'll need to get your data into IDL. If it's a comma-separated (or other "delimiter") file, then you can just use READ_CSV. Or you could try using READ_ASCII but then you need to know the specific format. Either way, you just need to use one of the read routines. https://www.harrisgeospatial.com/docs/READ_CSV.html

Chris Torrence
  • 452
  • 3
  • 11