Density contour curves [message #15825] |
Thu, 10 June 1999 00:00 |
Eric Williams
Messages: 14 Registered: April 1997
|
Junior Member |
|
|
I am wondering if there is a better way of doing solving this problem:
I have a set of data (x,y coordinates) that represent a distribution
(actually the 2-D spatial distribution of a star field). I would like to
show the position of the stars and then overplot contours curves that
convey the spatial density of the stars. Here is my simplistic first approach:
************
array = fltarr(n,m)*0 ;n & m are dimensions I pick
;depending on the range of x,y values
for n=0,n_elements(x)-1 do array[x[n],y[n]]=1
sarray = smooth(array,5) ;3,5,7,9 for smooth depending
;on resolution I want, I guess
plot,x,y,psym=3
contour,sarray,/overplot ;with levels if desired.
************
So, is using smooth bogus? I did it to try and make the contours
smoother, but I don't understand if it would be better to not use them.
Is there a better/more proper way to do something like this?
Thanks for any suggestions!
Eric Williams
eric@astro.wesleyan.edu
|
|
|