PROGRAM PROFILE C C This code should be called from the IRAF script profscr.cl. C It produces ASCII tables from your galaxy and model images C containing two columns: the first column is the pixel distance C to the centre, and the second is its surface brightness in C mag per square arcsec. The tables are in files named editprof.dat C (for you galaxy image), galprof.dat (for the full model image) C etc. You should comment the parts corresponding to non-existent C components (and remember to recompile it before running profscr.cl). C Below, the AGN component is commented. The code asks the total number C of pixels in your images, the coordinates of the galaxy centre in the C image, pixel size in arcsec and the zero point of your magnitude scale. C Just use your favourite plot tool afterwards to produce nice C pixel-by-pixel surface brightness profiles. (Note that pixels with C values less than or equal to 0 are ignored.) C C D. Gadotti C Munich, 2008 C implicit none INTEGER n,npix REAL x,y,pixvl,x0,y0,magzero,r,mag,pixsize WRITE (*,*) 'Enter total number of pixels:' READ (*,*) npix WRITE (*,*) 'Enter center coordinates (e.g.: 100.5 100.5):' READ (*,*) x0,y0 WRITE (*,*) 'Enter pixel size in arcsec:' READ (*,*) pixsize WRITE (*,*) 'Enter magnitude zero point:' READ (*,*) magzero DO n=1,npix OPEN (UNIT=1,FILE='editpix.dat',STATUS='OLD') OPEN (UNIT=2,FILE='editprof.dat',STATUS='NEW') READ (1,*) x,y,pixvl IF(pixvl.LE.0) GOTO 10 r=(x-x0)*(x-x0)+(y-y0)*(y-y0) r=SQRT(r) mag=-2.5*LOG10(pixvl)+magzero r=r*pixsize WRITE (2,*) r,mag 10 ENDDO CLOSE (1) CLOSE (2) DO n=1,npix OPEN (UNIT=1,FILE='galpix.dat',STATUS='OLD') OPEN (UNIT=2,FILE='galprof.dat',STATUS='NEW') READ (1,*) x,y,pixvl IF(pixvl.LE.0) GOTO 20 r=(x-x0)*(x-x0)+(y-y0)*(y-y0) r=SQRT(r) mag=-2.5*LOG10(pixvl)+magzero r=r*pixsize WRITE (2,*) r,mag 20 ENDDO CLOSE (1) CLOSE (2) C DO n=1,npix C OPEN (UNIT=1,FILE='agnpix.dat',STATUS='OLD') C OPEN (UNIT=2,FILE='agnprof.dat',STATUS='NEW') C READ (1,*) x,y,pixvl C IF(pixvl.LE.0) GOTO 30 C r=(x-x0)*(x-x0)+(y-y0)*(y-y0) C r=SQRT(r) C mag=-2.5*LOG10(pixvl)+magzero C r=r*pixsize C WRITE (2,*) r,mag C30 ENDDO C CLOSE (1) C CLOSE (2) DO n=1,npix OPEN (UNIT=1,FILE='barpix.dat',STATUS='OLD') OPEN (UNIT=2,FILE='barprof.dat',STATUS='NEW') READ (1,*) x,y,pixvl IF(pixvl.LE.0) GOTO 40 r=(x-x0)*(x-x0)+(y-y0)*(y-y0) r=SQRT(r) mag=-2.5*LOG10(pixvl)+magzero r=r*pixsize WRITE (2,*) r,mag 40 ENDDO CLOSE (1) CLOSE (2) DO n=1,npix OPEN (UNIT=1,FILE='bulgepix.dat',STATUS='OLD') OPEN (UNIT=2,FILE='bulgeprof.dat',STATUS='NEW') READ (1,*) x,y,pixvl IF(pixvl.LE.0) GOTO 50 r=(x-x0)*(x-x0)+(y-y0)*(y-y0) r=SQRT(r) mag=-2.5*LOG10(pixvl)+magzero r=r*pixsize WRITE (2,*) r,mag 50 ENDDO CLOSE (1) CLOSE (2) DO n=1,npix OPEN (UNIT=1,FILE='diskpix.dat',STATUS='OLD') OPEN (UNIT=2,FILE='diskprof.dat',STATUS='NEW') READ (1,*) x,y,pixvl IF(pixvl.LE.0) GOTO 60 r=(x-x0)*(x-x0)+(y-y0)*(y-y0) r=SQRT(r) mag=-2.5*LOG10(pixvl)+magzero r=r*pixsize WRITE (2,*) r,mag 60 ENDDO CLOSE (1) CLOSE (2) END