; ; try to label the bad spots. ; ; make sure we have xx,yy defined ; xout,yout from gridding nx=n_elements(xout) ny=n_elements(yout) xx=fltarr(nx,nx) yy=fltarr(nx,nx) for i=0,nx-1 do xx[*,i]=xout for i=0,ny-1 do yy[i,*]=yout ;nmain=dishtarmain(cblI,/tdonly) font_size=20 font_style=1 ; bold badv=min(img) ii=where(img ne minv) ; a={ val: 0.,$ ; value at the spot xbad: 0.,$; x pos bad val ybad: 0.,$; y pos bad val tdNm: '',$ tdpos:fltarr(3), $; x,y,z of td plotOffY:0. $ ; when plotting value to add to y when ploting } maxbad=10000l Bsp=replicate(a,maxbad) ; ;plot,xx[ii],yy[ii],psym=3 x0=-500. xstep=25. ncable=long(1000./25 + .5) xeps=.2 tdeps=3. cableEps=3 cliplev=3.; cm yx=findgen(2000) icol=2 icur=0l for i=0,ncable-1 do begin &$ x=x0 + i*xstep &$ ix=where(abs(xx[*,0] -x) lt cableeps,cnt) &$ print,i,x,cnt &$ if cnt eq 0 then continue &$ ix=ix[0] &$ ; ; now find the high/low spots along y ; ii=where((abs(img[ix,*]) gt cliplev) and (img[ix,*] ne badv),cnty) &$ plot,yy[ix,*],img[ix,*] &$ if cnty gt 1 then begin oplot,yy[ix,ii],img[ix,ii],psym=-2,col=colph[icol] &$ endif else begin print," found ",cnty," bad spots" endelse for iy=0,cnty-1 do begin y0=yy[ix,ii[iy]] print,x,y0 if cnt gt 0 then begin ; ; find the closest td cable icable=where(abs(cbli.xth - x) lt cableEps,cnt) if cnt eq 0 then begin print,"did not find main cable for x:",x continue endif ; now find the td along the cable icable=icable[0] jj=where(abs(cblI[icable].ti.pos[1] - y0) lt tdeps,cnttd) if cnttd eq 0 then begin lin=string(format='("no td found within ",f4.1," feet of x,y:",f5.0,1x,f5.0)',$ tdeps,x,y0) print,lin endif else begin print,x,y0," ",cblI[icable].ti[jj[0]].nm bsp[icur].val= img[ix,ii[iy]] bsp[icur].xbad=x bsp[icur].ybad=y0 bsp[icur].tdNm=cblI[icable].ti[jj[0]].nm bsp[icur].tdpos=cblI[icable].ti[jj[0]].pos icur++ endelse endif endfor endfor ; ntot=icur bsp=bsp[0:ntot-1] xyrad=sqrt(bsp.tdpos[0]^2 + bsp.tdpos[1]^2) minradius=50. maxradius=495. ii=where((xyrad gt minradius) and (xyrad lt maxradius)) bsp=bsp[ii] ii=uniq(bsp.tdnm,sort(bsp.tdnm)) bsp=bsp[ii] ntot=n_elements(bsp) stop ; ; some labels overlap in x.. ; labels with the same for digits are on the same y level ; manually fix them for now ; bsp.plotoffy=0. yoff=-7. yofflist=['SE2B2300','SW2B1700','NE4B0100','NE4C0100','SE4A0500','SE4A0900','SE050900','NE4B0100','NE4C0100' ] yoffAr =[ yoff , yoff , yoff , -yoff , yoff , yoff , yoff , yoff , -yoff ] for i=0,n_elements(yofflist)-1 do begin &$ ii=where(bsp.tdnm eq yofflist[i],cnt) &$ if cnt eq 1 then bsp[ii].plotOffY=yoffAr[i] &$ endfor ; ii=where(img ne badv) plot,xx[ii],yy[ii],psym=3,/iso ii=where(bsp.val gt 0) oplot,bsp[ii].tdpos[0],bsp[ii].tdpos[1],psym=2,col=colph[2] ii=where(bsp.val lt 0) oplot,bsp[ii].tdpos[0],bsp[ii].tdpos[1],psym=2,col=colph[4] csn=1 for i=0,ntot-1 do begin &$ xyouts,bsp[i].tdpos[0],bsp[i].tdpos[1],bsp[i].tdnm,col=colph[4],chars=csn &$ endfor stop ; ; then ; iimage,"radialerrs3rotated.isv" ; imgid=igetid('image') fs=10l for i=0,n_elements(bsp)-1 do begin &$ x=bsp[i].tdpos[0] &$ y=bsp[i].tdpos[1] + bsp[i].plotOffY &$ text=bsp[i].tdnm &$ itext,text,x,y,target_identifier=imgid,/data,/visualization,identifier=txtid,font_style=font_style,font_size=fs &$ endfor end