; ; look at the 9 scans of the 15 degree wedge to check the statistics ; do this after the fits to the sphere (since i used the fit values). ; ; scans 10-18 ; for blmselectpnts needinp=0 restore,'fitiarAll.sav',/verb xyrad=150. ; ifit 0 is 4parm fit , ifit 1 is 3 param fit ifit=0 ; below values came from running wedgegenclip manually ; and checking for where the good data is stp=.3 xmin=-6. xmaxL=4. nx=long((xmaxl -xmin)/stp) - 1 xmax=xmin + (nx+1)*stp ; ymin=60.7 ymaxL=86. ny=long((ymaxL -ymin)/stp) - 1 ymax=ymin + (ny+1)*stp wI={$ indFit: ifit,$ ; 0-> use 4 param 1-> use 3param center: fitiar[9,ifit].fitcoef[0:2],$; from fit R0 : fitiar[9,ifit].fitcoef[3] ,$; from fit ; limits zlim:[-.7,47.],$ xyrad:150.,$ elrange:[6.,9.],$ ; limit elevation to this` azrange:[-5.7,4.],$; ; for grid nx : nx,$; ny : ny,$; stp: .3,$ ; for grid .3 meters yrange :[ymin,ymax],$; to get rectangle with good data xrange :[xmin,xmax]} ; ; input all of the wedges.. ; if needinp then begin ;.run wedgeinp endif ; try fitting the sphere. ;.run wedgegenclip .. do manually to get numbers above. nscans=n_elements(dar) ; ; generate results struct ; nx=wI.nx ny=wI.ny a= {scannum: 0l,$ npnts : 0l,$; we had in region rmsAll : 0D,$; over entire grid avgAll : 0D,$; ditto cntAr : lonarr(nx,ny),$ rmsAr : dblarr(nx,ny),$ avgAr : dblarr(nx,ny),$ medAr : dblarr(nx,ny)} ; wedge results: wr=replicate(a,nscans) for iscan=0,nscans-1 do begin xyz=blmscale(dar[iscan].hdr,*dar[iscan].pd) ; range,th,phi rtp=blmxyztosph(xyz,/deg,/cwy) ; compute measured radius Rm=reform(blmcmpradius(xyz,center=wI.center)) wr[iscan].scannum=dar[iscan].scannum npnts=dar[iscan].npnts ; select the grid ok=intarr(npnts) + 1 ii=where((xyz[0,*] lt wi.xrange[0]) or (xyz[0,*] gt wi.xrange[1]) or $ (xyz[1,*] lt wi.yrange[0]) or (xyz[1,*] gt wi.yrange[1]) or $ (xyz[2,*] lt wi.zlim[0]) or (xyz[2,*] gt wi.zlim[1]) or $ (rtp[1,*] lt wi.azrange[0]) or (rtp[1,*] gt wi.azrange[1]) or $ (rtp[2,*] lt wi.elrange[0]) or (rtp[2,*] gt wi.elrange[1]),cnt) ok[ii]=0 ii=where(ok eq 1,npnts) wr[iscan].npnts=npnts xyzT=xyz[*,ii] rdifT=blmcmpradius(xyzt,center=wi.center) - wi.r0 a=rms(rdift,/quiet) &$ wr[iscan].rmsAll=a[1] wr[iscan].avgAll=a[0] nx=wi.nx ny=wi.ny stp=wi.stp for ix=0,nx-1 do begin &$ print,iscan,ix &$ xs=wi.xrange[0] + ix*stp &$ xe=xs + stp &$ iix=where((xyzt[0,*] ge xs) and (xyzt[0,*] lt xe),cnt) &$ for iy=0,ny-1 do begin &$ ys=wi.yrange[0] + iy*stp &$ ye=ys + stp &$ ii=where((xyzt[1,iix] ge ys) and (xyzt[1,iix] lt ye),cnt) &$ wr[iscan].cntAr[ix,iy]=cnt &$ if (cnt gt 2) then begin &$ a=rms(rdift[iix[ii]],/quiet) &$ wr[iscan].avgAr[ix,iy]=a[0] &$ wr[iscan].rmsAr[ix,iy]=a[1] &$ wr[iscan].medAr[ix,iy]=median(rdift[iix[ii]]) endif &$ endfor &$ endfor endfor save,wi,wr,file='wedge.sav' end