;*************************************************************************************; ;************************RADIUS FITS**************************************************; function radiusfits, file image=readfits(file, header) imagedims=size(image, /dimensions) ;binnig of slit-jaw if imagedims[0] eq 1280 then begin image = rebin(image, 640, 512) endif base=widget_base(title=file , xsize=700, ysize=700) draw=widget_draw(base, xsize=imagedims[0], ysize=imagedims[1], $ x_scroll_size=640, y_scroll_size=650) widget_control, base, /realize widget_control, draw, get_value=windex wset, windex tvscl, image !mouse.button = 1 i=0 xs=indgen(15)*0 ;number of limb fitting points ys=indgen(15)*0 while (i lt 15) do begin cursor, x,y, /device, /down case !mouse.button of 1: begin xs[i]=x ys[i]=y i=i+1 end 4: i=i-1;per endcase check=i-1 if check lt 0 then begin i=0 check=0 tvscl, image print,'image',[1] endif else begin tvscl, image plots, xs[0:check],ys[0:check], psym=1, color='ff'xl, /device endelse endwhile ps=mpfitellipse(xs,ys, /circular) ;compute error x=xs-ps[2] y=ys-ps[3] chyba=0 for i=0,14, 1 do begin rt=sqrt(x[i]^2+y[i]^2) chyba=chyba+abs(rt-ps[0]) msg=(rt-ps[0]) print, "Odchylka od vypocitaneho polomeru pro bod", i, " je", msg endfor error=chyba/15 print, "Celkova chyba je:",error print, ps widget_control, base, /destroy return, ps end