function check_circularity,clnmap,flevel,PLOT=plot ; Returns a measure of the circularity of the flevel contour ; plevel = fraction of maximum ; Gets the flevel contour using ; the structure produced by keyword PATH_INFO in IDL's contour ; returns a measure of circularity ; (max(radius)-min(radius))/(max(radius)+min(radius)) ; For a 2:1 ellipse, measure=0.33 ; for a 1.5:1 ellipse, measure=0.20 ; for a 1.25:1 ellipse, measure=0.11 if (flevel LE 0 OR flevel GE 1.0) then message,'flevel out of range' CONTOUR, clnmap, level=[flevel]*max(clnmap),PATH_XY=xy, PATH_INFO=info ncontours=n_elements(info) x=reform(xy(0,*)) y=reform(xy(1,*)) if keyword_set(PLOT) then plot,[x,x[0]],[y,y[0]];,xra=[0,1],yra=[0,1] xbar=mean(x) & ybar=mean(y) radius=sqrt((x-xbar)^2+(y-ybar)^2) measure=(max(radius)-min(radius))/(max(radius)+min(radius)) return,measure end ; TEST xx=(findgen(64)-32)#replicate(1,64) yy=transpose(xx) a=8 & b=10 a=16 & b=20 ;a=0.8*a & b=0.8*b z=2.^(-(xx/a)^2-(yy/b)^2) mea=check_circularity(z,0.5,/plot) print,mea end