; ; plot the weights using the final final interation of the fit ; ; need rtp in scanner centered coord ; ; i'm using xy radius but i passed it the range from scanner ; ; ; compute xy radius ; radxy=sqrt(reform(xyz[0,iikeepf4])^2 + reform(xyz[1,iikeepf4])^2) rbin=1. h=histogram(radxy,binsize=rbin,loc=hloc,reverse_indices=r) delt=rbin*1d delt2=delt*delt nh=n_elements(h) rw=dblarr(nh) for i=0,nh-1 do begin &$ i0=r[i] &$ i1=r[i+1]-1 &$ ni=i1-i0 + 1 &$ if ni ne 0 then begin &$ area=!pi*(2*hloc[i]*delt + delt2) &$ areaDen=(1d*ni)/area &$ scl=1d/(sqrt(areaDen)) &$ rw[i]=scl &$ endif &$ endfor ; if hard then pscol,'fitsphere_pltwghts.ps',/full hor,0,150 cs=1.4 font=1 !p.multi=[0,1,2] ver,0,5e5 xtit='xy range [meters]' ytit='counts' tit='Histogram of points vs xy range (final 4param fit)' plot,hloc,h,$ chars=cs,font=font,$ xtit=xtit,ytit=ytit,$ tit=tit xp=.14 ln=2 csn=1.5 note,ln,"bin size 1 meter",chars=csn,font=font,xp=xp ver,0,.15 ytit='weight for points' tit='Weighting of points vs xyrange' plot,hloc,rw,$ chars=cs,font=font,$ xtit=xtit,ytit=ytit,$ tit=tit if hard then hardcopy x ldcolph end