pro getallphot,tilelist,starid,ra,dec,u,g,r,i,z,gred,d51,j2m,h2m,k2m,mags,names ; This routine opens all of the tile databases in the ascii file tilelist, ; and concatenates the positions and magnitudes of the stars found therein. ; The magnitudes are also returned in the array mags(nst,10), with filter names ; in the corresponding array names. ;make tile list from survey/stars/ by 'ls t*+*.dbh > tilelist' zdbase=getenv('ZDBASE') starpath=zdbase+'/survey/stars/' names=['u','g','r','i','z','Gred','D51','J','H','K'] astrolib openr,iun,tilelist,/get_lun ss='' nt=0 while(not eof(iun)) do begin readf,iun,ss ; ss=strtrim(strmid(ss, 0, strlen(ss)-4),2) ;added strmid to remove suff (djk) dbname=starpath+ss ierr=findfile(dbname+'.dbh') berr=byte(ierr) if(berr(0) ne 0) then begin dbopen,dbname dbext,-1,'starid,ra,dec,u,g,r,i,z,gred,d51',$ sida,raa,deca,ua,ga,rr,ia,za,greda,d51a dbext,-1,'j,h,k',ja,ha,ka if(nt eq 0) then begin starid=sida ra=raa dec=deca u=ua g=ga r=rr i=ia z=za gred=greda d51=d51a j2m=ja h2m=ha k2m=ka nmax=n_elements(raa) tmax=ss endif else begin starid=[starid,sida] ra=[ra,raa] dec=[dec,deca] u=[u,ua] g=[g,ga] r=[r,rr] i=[i,ia] z=[z,za] gred=[gred,greda] d51=[d51,d51a] j2m=[j2m,ja] h2m=[h2m,ha] k2m=[k2m,ka] nel=n_elements(raa) if(nel gt nmax) then begin nmax=nel tmax=ss endif endelse nt=nt+1 endif endwhile nst=n_elements(ra) mags=fltarr(nst,10) mags(*,0)=u mags(*,1)=g mags(*,2)=r mags(*,3)=i mags(*,4)=z mags(*,5)=gred mags(*,6)=d51 mags(*,7)=j2m mags(*,8)=h2m mags(*,9)=k2m print,'max of ',nmax,' stars found in tile '+tmax end