clusterStatistics
Return to directory of Todd's CASA extensions
Reads the x and y coordinates of points from specified columns
in an ASCII file, and computes useful statistics.
Usage:
au.clusterStatistics(filename, xcol, ycol, delimiter=None, skyCoordinates=False,
maxLines=None, showplot=False, plotcenter=None,
showtitle=False, showcenter=False, showseparations=False,
plotfile=None, plotwidths=None, filledpoints=None,
horizontalGrid=None, maxEdgeLength=-1, scaleBar=None,
distance=1200, lw=1.5)
Inputs:
- filename: ASCII table that contains X and Y points in separate columns
- Note
- if a colon is in the data string for the X column, then treat the colon-delimited X and Y strings as sexagesimal RA/Dec and convert to radians
- xcol: the column to use for x (column numbers start at zero)
- ycol: the column to use for y (column numbers start at zero)
- delimiter: the character(s) which delimit column in the file (default = white space)
- skyCoordinates: if True, then use spherical great circle distance, otherwise treat as rectilinear coordinates and use Pythagorean.
- showplot: if True, show a plot of the minimum spanning tree
- plotcenter: sexagesimal string in RA/Dec, or None for mean position
- showtitle: include cluster radius and mean separation in title
- showcenter: mark the center of the cluster
- showseparations: mark the length of each edge
- plotfile: the name of the plotfile to generate (.png and .eps)
- plotwidths: [width,height] in degrees (as per aplpy's recenter command) if not specified, then automatic limits are used, with axis('scaled')
- filledpoints: if showplot==True, mark these positions with filled points and the rest with unfilled points
- horizontalGrid: draw dotted lines every X arcsec
- maxEdgeLength: edges longer than this get drawn as grey lines instead of black
- distance: in parsec
- scaleBar: length in arcsec
- lw: linewidth of black edges (i.e. those shorter than maxEdgeLength
Returns:
- mean separation (in arcsec if skyCoordinates == True)
- cluster radius (in arcsec if skyCoordinates == True)
- mean edge length of minimum spannig tree (in arcsec if skyCoordinates == True)
- Q-parameter (see Cartwright & Whitworth 2004, MNRAS)
Example:
au.clusterStatistics('23regions_clb_ap_big.crtf.imfit',1,2,skyCoordinates=True,maxLines=25,
showplot=True,plotwidths=[0.013,0.017],plotfile='mst',filledpoints=[0,2,4,12,15,23])
Stopping after reading 25 lines
Mean separation = 0.000095
Mean separation = 19.645909 arcsec
Cluster radius = 0.000156
Cluster radius = 32.139237 arcsec
17:20:55.19024, -035:45:13.345200
Mean position = 17:20:55.19024, -035:45:13.345200
mean edge length = 5.924113 arcsec / [(N*pi*R**2)**0.5 / (N-1)]
mean edge length = 5.924113 / 12.133561 = 0.488242
xoff=0.000000, yoff=0.000000 arcsec
Q = (5.924/12.134) / (19.646/32.139) = (0.488242/0.611275) = 0.799
plot left in mst.png and mst.eps
--
ToddHunter - 2014-02-03