; ; plot errors as we change the location of the center ; ; 3 param fit: radius : 265.176 ; 4 param fit: radius : 265.1001 ; zcenter moved by just about the change in radius ; ; plot what the radial errors would be if we used a 265.176 radius ; on a dish that had a true radius of 265.1000 meters ; 0 radius3=265.176d radius4=265.1001d xcen4=0. zcen4=radius4 xcen3=0. zcen3=radius3 elMax=34. thMax= elMax - 90. thMin= thMax - 2*elMax arc=[thmin,thmax] ; if hard then pscol,'errVsCenter.ps',/full !p.multi=[0,1,2] hor, -140,140 ver,-1,42 xtit='x distance [meters]' ytit='z distance [meters]' cs=1.4 font=1 tit='xz slice of sphere' drawcircle,xcen4,zcen4,radius4,npnts=npnts,arc=arc,$ chars=cs,font=font,$ xret=xret4,yret=zret4,$ xtit=xtit,ytit=ytit,$ tit=tit drawcircle,xcen3,zcen3,radius3,npnts=npnts,arc=arc,/over,col=2,$ xret=xret3,yret=zret3 csn=1.5 ln=2 xp=.2 scl=.7 note,ln ,"radius = 265.100 meters",chars=csn,font=font,xp=xp,col=colph[1] note,ln+1*scl,"radius = 265.176 meters",chars=csn,font=font,xp=xp,col=colph[2] ; ; compute the radial error by moving center to ycen3 and then compute errors you'd get ; from radius3 ; rNew= sqrt( xret4^2 + (zret4-zcen3)^2) rerr= rnew -radius3 tit='radial error using 265.176[m] radius for 265.1[m] curvature' ver,-1.2,.1 ytit='Radial error [cm]' plot,xret4,rerr*100.,$ chars=cs,font=font,$ xtit=xtit,ytit=ytit,$ tit=tit ln=17 xp=.04 note,ln,"<0 --> radius too short",chars=csn,font=font,xp=xp ; ; look at error my shifting x by 2 cm. ; ver,-1.2,1.2 dxShift=.02d rNew= sqrt( (xret4 - dxShift)^2 + (zret4-zcen4)^2) rerr=rnew - radius4 ytit='Radial error [cm]' tit='Radial error cause by shifting xCenter by 2 cm in the +x direction' plot,xret4,rerr*100. ,$ chars=cs,font=font,$ xtit=xtit,ytit=ytit,$ tit=tit ; ; look at the 3 and 4 parameter fits. ; - generate a sphere using the 4 parameter fit ; - and then try a 3 paramer fit to it.. see what it does tothe center and radius ; nodata=-999. eps=.01 zaDmax=35. radius=rad4 npnts=100l ngood=xyzgridsph(zadmax,radius,npnts,xyzgrid) ii=where(abs(xyzgrid[0,*,*] - nodata) lt eps,cnt1) ; ; add some noise to the z position ; xyzgrid[2,*,*]+=randomN(0,100,100)*.03 ; ; now fit to the sphere ; x0=0. y0=0. z0=0. eps=.1 r=rad4 + eps fitA=[1.,1.,1.,1.] ; fit all 4 params initCoef=[x0,y0,z0,r] ntot=npnts*npnts istat=blmfitsphere(reform(xyzgrid,3,ntot),fitA=fitA,fitICf,initCoef=initCoef,fitRadDif=fitraddif) print,fiticf.fitcoef print,fiticf.sigmas ; ; and try fitting for the if hard then hardcopy x ldcolph end