;This program reads in the x and y values of a .mag.1 file from IRAF ;and outputs .txt files for each .mag.1 file that has the center ;image coordinates followed by each individual x and y coords. Also ;it finds the fluxes of the five stars from each phot *mag.1 files and ;corrects them for airmass. These fluxes are then printed to a file ;"images.info" in each galaxies directory. ;.r align ;align pro align readcol,'images.list',F='A',file flux=FLTARR(5) ;get length of a *.mag.1 file lines='' m=0 openr,1,file[0] WHILE (not EOF(1)) DO BEGIN readf,1,lines m+=1 ENDWHILE close,1 length=m nimages=N_ELEMENTS(file) centerx=0 centery=0 OPENW,2,'imagesinfofiles.list' OPENW,5,'scale.cl' FOR i=0, nimages-1 DO BEGIN IF (strmatch(file[i],'*center*') EQ 1) THEN BEGIN temp=strsplit(file[i],'/',/extract) directory=temp(0)+'/'+temp(1)+'/'+temp(2) telescope=temp(2) close,4 OPENW,4,directory+'/images.info' printf,4,F='(A,37x,A,8x,A,8x,A,8x,A,8x,A)','##','NE','NW','SW','SE','Mid' printf,4,F='(A,3x,A,9x,A,3x,A,5x,A,5x,A,5x,A,5x,A,5x,A)',$ '##','Image','Filt','Airmass','Flux1','Flux2','Flux3',$ 'Flux4','Flux5' readcol,file[i],input1,input2,/silent print,file[i] centerx=[input1[0],input1[4],input1[8],input1[12],input1[16]] centery=[input2[0],input2[4],input2[8],input2[12],input2[16]] printf,2,file[i] ENDIF ELSE BEGIN readcol,file[i],input1,input2,/silent ninput=N_ELEMENTS(input1) x=[input1[0],input1[4],input1[8],input1[12],input1[16]] y=[input2[0],input2[4],input2[8],input2[12],input2[16]] airmass=input2[2] newdir=strsplit(file[i],'.mag.1',/extract,/regex) galaxy=strsplit(newdir,'galaxies',/extract,/regex) ;print,galaxy OPENW,U,newdir+'.txt',/GET_LUN printf,U,centerx[0],centery[0],x[0],y[0] printf,U,centerx[1],centery[1],x[1],y[1] printf,U,centerx[2],centery[2],x[2],y[2] printf,U,centerx[3],centery[3],x[3],y[3] printf,U,centerx[4],centery[4],x[4],y[4] FREE_LUN,U ;get airmass & fluxes l=0 openr,3,file[i] FOR j=0, length-1 DO BEGIN readf,3,lines temp=STRSPLIT(lines,' ',/extract) IF (strmatch(temp(0),'#*') EQ 1) THEN BEGIN goto,loop ENDIF IF (strmatch(temp(0),'a*') EQ 1) THEN BEGIN image=temp(0) goto,loop ENDIF IF (EOF(3)) THEN BEGIN goto,loopend ENDIF readf,3,lines IF (EOF(3)) THEN BEGIN goto,loopend ENDIF readf,3,lines temp=STRSPLIT(lines,' ',/extract) filt=temp(2) IF (STRMATCH(telescope,'*wiro*',/fold_case) EQ 1) THEN BEGIN IF (filt EQ 'U') THEN BEGIN amcoeff=0.5 ENDIF ELSE IF (filt EQ 'B') THEN BEGIN amcoeff=0.295 ENDIF ELSE IF (filt EQ 'V') THEN BEGIN amcoeff=0.193 ENDIF ELSE IF (filt EQ 'R') THEN BEGIN amcoeff=0.139 ENDIF ELSE IF (filt EQ 'I') THEN BEGIN amcoeff=0.061 ENDIF ENDIF ELSE IF (STRMATCH(telescope,'*bok*',/fold_case) EQ 1) THEN BEGIN IF (filt EQ 'U') THEN BEGIN amcoeff=0.5 ENDIF ELSE IF (filt EQ 'B') THEN BEGIN amcoeff=0.25 ENDIF ELSE IF (filt EQ 'V') THEN BEGIN amcoeff=0.15 ENDIF ELSE IF (filt EQ 'R') THEN BEGIN amcoeff=0.10 ENDIF ELSE IF (filt EQ 'I') THEN BEGIN amcoeff=0.07 ENDIF ENDIF ELSE IF (STRMATCH(telescope,'*ctio*',/fold_case) EQ 1) THEN BEGIN IF (filt EQ 'U') THEN BEGIN amcoeff=0.45 ENDIF ELSE IF (filt EQ 'B') THEN BEGIN amcoeff=0.232 ENDIF ELSE IF (filt EQ 'V') THEN BEGIN amcoeff=0.144 ENDIF ELSE IF (filt EQ 'R') THEN BEGIN amcoeff=0.083 ENDIF ELSE IF (filt EQ 'I') THEN BEGIN amcoeff=0.056 ENDIF ENDELSE IF (EOF(3)) THEN BEGIN goto,loopend ENDIF readf,3,lines temp=STRSPLIT(lines,' ',/extract) flux[l]=temp(3) correction=10^(0.4*airmass*amcoeff) flux[l]=flux[l]*correction l++ IF (EOF(3)) THEN BEGIN goto,loopend ENDIF loop: ENDFOR loopend: close,3 printf,2,F='(A,2x,F4.2)',file[i],airmass printf,4,F='(A,3x,A,6x,F4.2,7x,F8.0,2x,F8.0,2x,F8.0,2x,F8.0,2x,F8.0)',$ image,filt,airmass,flux[0],flux[1],flux[2],flux[3],flux[4] printf,5,F='(A,A,A,F,A,A,A)','imarith /pawnee3/davec/clusters/data/photometry',$ STRJOIN(galaxy),$ ' *',correction,' /pawnee3/davec/clusters/data/photometry',$ STRJOIN(galaxy)+'S' ENDELSE IF (i EQ nimages-1) THEN BEGIN close,4 close,5 ENDIF ENDFOR CLOSE,2 STOP END