pro SunDisk_limb, image, xcenter, ycenter, rsun, delxc, delyc, cutlevel=cutlevel, $ docfile=docfile, display=display ; ;+ ; ; NAME : ; SunDisk_limb ; CALLING SEQUENCE : SunDisk, image, xcenter, ycenter, rsun, dxc, dyc,$ ; cutlevel=cutlevel, display=display ; PURPOSE : ; Find the center and the radius of the Sun Disk ; from image containing the solar limb ; ARGUMENT : ; IMAGE : the image containing the solar limb (INPUT) ; XCENTER , YCENTER : x, y-coordinates of the sun disk (OUTPUT) ; origin = the lower left corner of the image. ; unit = pixel size ; x-direction : from the left to right ; y-direction : from the lower to the upper ; RSUN : the radius of the sun disk (OUTPUT) ; DXC , DYC: the standard deviation of XCENTER ; and YCENTER (OPTIONAL OUTPUT) ; KEYWORD PARAMETERS : ; CUTLEVEL : The level of cut used to define the limb points ; mag(gradient) > max(mag(gradient))*CUTLEVEL (Default=0.9) ; DISPLAY : If set, display the process or the result. ; REQUIRED ROUTINES : ; XYINDEX, GRADIENT ; ;- xyindex, image, x, y s=size(image) gradient,alog(float(image)), gx, gy g=sqrt(gx^2+gy^2)*(x ge 10 and x le s(1)-10) *( y ge 10 and y le s(2)-10) if not keyword_set(cutlevel) then cutlevel=0.9 limb = g ge cutlevel*max(g) if keyword_set(display) then tvscl, limb limb=where(limb) qx = -gx(limb)/g(limb) qy = -gy(limb)/g(limb) xdata = [transpose(qx), transpose(qy)] ydata = x(limb)*qx + y(limb)*qy result = regress(xdata, ydata,1.+ydata*0., yfit,rsun, sigma,/relative_weight) xcenter=result(0) ycenter=result(1) delxc = sigma(0) delyc = sigma(1) return end