CHAPTER 14    GALAXY PROFILES AND PARAMETERS





            14.1 INTRODUCTION



                 In this chapter  we  describe  how  to  obtain  the  surface

            brightness  distributions  and  the  seeing-free  photometric and

            structural parameters of elliptical galaxies which may or may not

            overlap,  from  two-dimensional  images.  The modules can also be

            used to model star images which may or may not overlap, as  well.

            The   surface   brightness   distributions  are  averages  around

            elliptical contours expressed as a function  of  semimajor  axis.

            The  central  location,  inclination,  and  eccentricity  of each

            elliptical contour are allowed to be independent  of  each  other

            and  can  be  solved  for  as a function of semimajor axis by the

            method of Fourier coefficients if desired.  Thus one can look for

            twisting    of   isophotes   and   variations   of   ellipticity.

            Alternately, these quantities can be  held  constant  and  simple

            contour  averages  made.  This approach is less desirable, but is

            sometimes necessary if the center of  the  galaxy  lies  off  the

            frame.   The photometric and structural parameters, e.g., central

            surface brightness, effective surface brightness,  Hubble  radius

            parameter,  effective  radius  parameter,  etc., are derived from

            nonlinear least squares fits  (with  image  smearing  taken  into

            account)   of  one-dimensional  files  representing  the  contour

            averaged surface brightness.

                 The surface brightness distribution of an isolated galaxy is

            easily  solved  for,  however  the  images  of  most galaxies are

            contaminated by overlapping images  of  nearby  stars  and  other

            galaxies,  especially  if  one  is  working  in a rich cluster of

            galaxies.  Bad pixels and ghost images must also be  dealt  with.

            Briefly,  one  proceeds  with  the  following  recipe,  which  is

            explained in more detail in the later sections of  this  chapter.

            The  editing  options  EC  (EDITCIRCLE),  EP  (EDITPOINT), and ER

            (EDITRECT) allow one to remove bad  areas  of  the  2-dimensional

            image  (SAD  file)  when  starting  the  analysis.   We use these

            options to edit out everything but the brightest galaxy,  or  the

            galaxy  of  interest.  Then by using the options EA (ANNULUS), PR

            (PROFILE),  and/or  SG  (SMOOTHGAL)  (described  in  more  detail

            below), we arrive at a first approximation to the two-dimensional

            surface brightness distribution of that galaxy.   By  subtracting

            this  first  approximation  model  with option FG (FAKGAL), other

            objects which were contaminated by the light from this galaxy can

            now  more  accurately  be  modeled  by  further use of these same

            options.  Stars  and  ghost  images  are  similarly  modeled  and

            subtracted.   A  helpful  option  at  this stage is SA (SADMASK),

            which operates with with a mask file to quickly remove areas know

            to  be bad or which contain objects in the frame, too small to be

            modeled.  In general, one proceeds from the brightest  object  to

            the  fainter  ones.   You may not wish to model the very faintest

            galaxies since less accurate surface  brightness  parameters  and

            radius  parameters  will  result.  However, these fainter objects

            are sometimes located where their modeling and  subtraction  will

            improve  the  results  for  another  more  desirable galaxy.  The

            fainter objects are still useful for obtaining  aperture  derived


                                                                Page 2





            integrated  magnitudes  with  option BB (BBEN).  Once the initial

            models for the objects have been determined and  subtracted,  the

            frame  should  look  reasonably  clear  except  for the unmodeled

            fainter and less offensive objects.   The  first  object  can  be

            remodeled in a second iteration.  Severely overlapping images may

            require several iterations before a final model is obtained.

                 The  surface  brightness  distribution   as   derived   from

            iterative  modeling  is still affected by atmospheric seeing.  In

            order to derive the actual galaxian surface brightness  parameter

            and  radius  parameter,  this smearing must be accounted for.  In

            the nonlinear least  squares  fitting  routine,  RG  (RADGAL),  a

            stellar  profile  is  used as a smearing function to convolve the

            fitting function before the actual fit  is  made.   Finally,  the

            photometric  parameters  are  calibrated  by placing them on some

            photometric system, and the structural parameters are transformed

            to  units  of arc seconds.  These conversions operations are done

            with options ED (EDITDATA1) and E3 (EDITDATA3).

                 Galaxies' models too faint to be accurately fit with RG  can

            be  integrated  to  yield  magnitudes  with option E3, command I.

            Galaxies too faint to be modeled can be photometered with  option

            BB.





            14.2 CONSTRUCTING A FINDING CHART



                 Before any modeling work on a frame can begin, it is helpful

            to have a finding chart.  Option AC can be used here to produce a

            contour plot.  However, if the flat fielded exposure of the frame

            of  interest  contains  an  enormous  galaxy which overlaps other

            galaxies, it may be necessary to subtract out this galaxy  before

            constructing the contour plot.  Once the frame has been selected,

            use option GA to determine the sky level and  the  sigma  of  the

            exposure  in  a  blank  area.  The lowest contour intensity level

            should be set  at  approximately  the  sky  plus  7  sigma.   The

            hightest  contour  level should be set equal to the center of the

            brightest interesting object.  Intermediate contour levels, say 4

            of  them, should be spaced in a geometric progression between the

            lowest and highest levels.  Some trial and error may be necessary

            before finding the right intensity levels.  Experiment on a small

            area of the map, as this option is slow.  Write  the  plot  to  a

            file  but  do not put a frame around the plot.  The plot file can

            then be sent to one of the supported plot devices.   Observe  the

            offsets,  scale,  and rotations recommended in Chapter 15 of this

            volume.  The option FI (FIND) can be used to automatically create

            a list of objects and their positions in the frame, or one can do

            this manually with option CT (CENTR).





            14.3 CONSTRUCTING A MASK FILE



                 When operating on the galaxy images in  a  frame,  one  will

            find  that  certain  areas need to be repeatedly excluded at each

            stage of the iterative process.  These areas might be stars  that

            have saturated, bad pixels, cosmic ray events, and faint galaxies

            that are not to be modeled and subtracted.  It is thus convenient


                                                                Page 3





            to  have a mask file which can quickly set those areas to zero in

            the working frame.  At some point, one can edit all such areas in

            a  frame  and  set  them  equal  to  zero  with  the  options  EC

            (EDITCIRCL), EP (EDITPOINT),  and  ER  (EDITRECT),  for  circles,

            single  pixels,  and rectangles, respectively.  This is then used

            repeatedly as a mask frame in the option SA.





            14.4 MODELING THE GALAXIES AND STARS



                 One begins  this  iterative  procedure  by  making  a  first

            approximation  to the brightest object in the field.  In order to

            do this in a way which is reasonably free of  contamination,  one

            should  edit out areas of the less brighter objects which overlap

            the program object.  The editing options EC, EP, and  ER  can  be

            used for this purpose.  If a mask file has been constructed, that

            can be used with option SA.  Keep a copy of the original file  of

            course.   The  preferred  way to make the model is with option PR

            (PROFILE).  See the file PR.DOC for an example of how to do this.

            Option  PR  will yield a character file of type 1 with columns of

            values for distance  along  the  major  axis,  x  and  y  central

            location  of  each elliptical contour, inclination, eccentricity,

            and  surface  brightness.   It  also   integrates   the   surface

            brightness, but option RG should be used for the final integrated

            value.  An alternative way to obtain some of the information that

            option PR provides, is available through the option EA (ANNULUS).

            This  option  simply  uses  fixed  values  of  central  location,

            inclination,  and  eccentricity  for  each  contour.  It does not

            solve for these quantities; they  must  be  input  by  the  user.

            Option EA is useful when an object lies off the edge of the frame

            and no detailed solution for the model  is  possible.   For  each

            model,  one  should  estimate  a  sky  level  which  needs  to be

            subtracted from the file when writing data back to the  frame  at

            latter  stages  in the modeling.  To do this, display the surface

            brightness values in a plot  on  a  graphics  terminal.   One  is

            prompted for this plot in both option PR and EA.  Press R and the

            crosshairs will appear.  Position the crosshairs at the left  and

            right  boundaries  of  the  section  of the plot to be replotted,

            pressing the <CR> after each position.  A sky value can  be  read

            by  pressing  C  to  turn on the crosshairs, and then the <CR> to

            read a value.  Press Q to turn off the crosshairs.  The plot will

            also  indicate  if  certain  values  at  large distances from the

            center, are bad.  If this is the case,  use  the  EDT  editor  to

            delete those outer contours.  Option SG (SMOOTHGAL) is useful for

            recomputing the run of surface brightness with distance from  the

            center  of  an  object.   The  operation  which  it  provides  is

            available in option PR, but it is possible that the user may wish

            to  smooth  the outer profile parameters by polynomial fitting at

            some later time,  without  going  throught  the  entire  solution

            again.   This  option  operates on the 2-dimensional SAD file and

            the character file containing the previous solution for  a  given

            object.   Another  use  of the option is to recompute the surface

            brightness distribution after some change has been  made  to  the

            SAD  file,  such  as  removing  addditional  contamination.  Here

            again, a saving results by not  having  to  run  option  PR  over


                                                                Page 4





            again.   Although  options PR, EA, and SG provide plotting of all

            profile parameters  against  distance  from  the  center  of  the

            object,  it  is possible to request only plotting of a particular

            data file by using option DA (DISPANN).  One  simply  enters  the

            name  of  the file in response to the prompt and selects what set

            of parameters is to be plotted.





            14.5 GHOSTS, THE LED EFFECT, AND THE LEFT SIDE OF THE CCD



                 Occasionally, a CCD frame  with  suffer  from  one  or  more

            artifacts  which  produce  unwanted  images  in  the  area  to be

            analyzed.  Ghost images, resulting  from  reflections  of  bright

            stars  from  the  dewar  window or other optical surfaces, can be

            modeled in a way similar to galaxies and stars.   A  ghost  image

            will  usually  have  a  donut  appearance,  circular  symmetry, a

            central hole, and uniform surface brightness out to some limiting

            radius.   In  this  case, option PR will not work; the derivative

            will be  positive  and  the  central  region  will  not  offer  a

            solution.   Here  we must use option EA, assuming an eccentricity

            of 0.0, and an estimated central location.  If the ghost image is

            free  of  ovelapping objects, the first model will be sufficient.

            Usually, however, more than one iteration is required.   On  some

            frames,  an  LED  effect  will  be  evident.   This  is caused by

            excessive current throught the on-chip amplifier on the CCD.  For

            long  exposures,  some  CCD systems turn off the CCD amplifier to

            avoid this problem.  If it is present, there  will  be  a  bright

            radiating source in one of the corners of the CCD (upper right on

            the RCA CCD).  This source cannot be modeled with either  options

            PR  or  EA.   One  must model the LED effect by selecting several

            dark frames of the same exposure as the program frame,  averaging

            them,  and  then  subtracting  a constant background level.  This

            model should be set to zero everywhere except in  the  region  of

            the  LED  effect,  and  subtracted  from  each  program  frame as

            required.  Since the effect is repeatable, only one model need be

            kept.  The leftmost columns on some CCDs have a higher background

            level due to some unknown cause.  To model this effect, which may

            be  slightly different on each exposure, model and subtract stars

            and galaxies near the left edge of the frame.  If the  effect  is

            strong,  these  models  will be only a first approximation.  Next

            use option AV to compute average values  for  each  column.   The

            averaging  process  will  neglect  edited areas which were set to

            zero.  These average values can be written to a frame.   At  some

            point, say column 20 or so, the effect fades into the background.

            Subtract this background from the frame and set  the  columns  to

            the  right  of  that point, exactly equal to zero.  This frame is

            then  subtracted  from  the  program  frame  to  rid  it  of  the

            troublesome columns on the left side.





            14.6 THE SECOND AND HIGHER ITERATIONS



                 Let us assume that you have modeled a few  of  the  brighter

            objects  (galaxies  and  stars) and have data files of type 1 for

            each of these objects.  These models were created by editing  out


                                                                Page 5





            contamination from overlapping objects.  The files themselves may

            have required additional editing to  remove  the  outer  contours

            which may have been too noisy or contaminated.  In this stage you

            will obtain a better approximation to each object by  subtracting

            away  contamination,  rather than editing it out.  With option FG

            (FAKGAL) one can subtract an image from the working SAD file.  To

            start  this process, the SAD file must be exactly the same as the

            original frame (no edited areas).  Option FG will prompt for  the

            sky,  which  was  determined  with  the  cursor,  and for a scale

            factor.  Enter -1 for the scale factor since  we  must  subtract.

            Do  this  operation  for  the  second  brightest  object and then

            observe the  frame  on  the  TV  display.   There  will  be  less

            contamination  from  this  object.  Repeat this for all the other

            objects fainter than the second, and then run option  PR  on  the

            brightest  object once more.  There should be an improvement.  If

            the brightest object is now subtracted, and the second  brightest

            written  back  to  the frame (set the scale factor equal to +1 in

            option FG), the second brightest object can  be  more  accurately

            modeled.   This  process  is  continued  until all of the brigher

            objects in the frame have been modeled a few times.  You are done

            when,  by  subtracting  all  objects,  a  uniform  field results.

            Several iterations may be required for rich fields.  Some of  the

            processing  can  be  done  by batch; simply create a command file

            with all of the  information  required  by  the  option  prompts,

            contained in the file.





            14.7 THE STELLAR POINT SPREAD FUNCTION



                 In order to fit surface brightness formulas to  the  surface

            brightness  data,  a proper accounting of atmospheric seeing must

            be made.  It is thus necessary to model the stellar point  spread

            function.   While  the  original  exposures  are  two-dimensional

            files,  the  surface  brightness  data  is   in   the   form   of

            one-dimensional files.  The point spread function will also be in

            this form.  In modeling the objects in the field, one  will  have

            modeled  several  stars  as  well  as the galaxies.  Usually, the

            stars in the center of the frame will not be different than those

            at  the  edges,  but  one  should  verify  this before adding the

            stellar  profiles  together.   Since  the  stellar  profiles,  as

            produced  by  option PR, already exist, one only has to average a

            few of these profiles in order to  obtain  a  good  point  spread

            function.    Option   ED   allows  one  to  perform  mathematical

            operations on profile data.  With this option, we first  add  the

            surface  brightness,  inclination, and eccentricity values of all

            the stellar files, and then divide each of  these  parameters  by

            the  number  of  files.  Two files may be operating on each time,

            with several parameters being operated on at once.  The positions

            of   the  stars  are  unimportant  for  deconvolution,  hence  no

            operation is performed on x  and  y.   Likewise,  the  integrated

            surface  brightness  is  also  ignored.   The averaged files will

            still have a sky background which must be removed.   The  sky  is

            estimated  in  the  same  way as described above in section 14.4.

            Here however, access to the plotting prompt is obtained by use of

            option  DA.  This sky value is then subtracted from the file with


                                                                Page 6





            option ED.  See the file [-.MIIPS.SAMPLES]POINT_SPREAD.DAT for an

            example of how a stellar point spread function looks, and plot it

            with option DA.





            14.8 STRUCTURAL AND PHOTOMETRIC PARAMETERS



                 Once an object has been modeled with options PR or  EA,  one

            will  have  a  data  file  of type 1 where the surface brightness

            averaged around elliptical contours is presented as a function of

            distance  outward  along  the  major  axis of each contour.  This

            one-dimensional file can be used to obtain  the  photometric  and

            structural  parameters of the particular object.  It is necessary

            to take account of the blurring of the light passing through  the

            earth's  atmosphere  and the imaging optics which make the galaxy

            image appear to be larger than its true size, and  to  possess  a

            dimmer central surface brightness than it actually has.  The data

            file for the stellar point spread function, derived as  indicated

            above,  is  used  in  conjuction  with  a nonlinear least squares

            fitting routine to derive the galaxy's parameters.

                 Parameters  from  several   different   surface   brightness

            formulas can be solved for with the option RG, e.g., the modified

            Reynolds Hubble formula, the de Vaucouleurs  formula,  etc.   The

            command  HE  RG will provide online help in the form of an actual

            example solution.  Alternately, one could TYPE the file RG.DOC in

            the  [-.MIIPS.DOC]  directory, to see this.  A sample file of the

            data type needed for using option RG (data file type 1) is  given

            in     the     [-.MIIPS.SAMPLES]     directory.     This    file,

            GALAXY_PROFILES.DAT, contains a large  galaxy,  ID=70,  extending

            out  to  243 pixels, and a small galaxy, ID=170, extending out to

            50 pixels.  A solution should be  tried  with  the  point  spread

            functions  given  in the sample file POINT_SPREAD.DAT in the same

            directory.  This file contains three objects, with ID=STARS, 138,

            and  STARS2,  which  extend  out as far as 17 pixels.  The object

            STARS represent an average of severage stars whose  point  spread

            functions were measured by option PR.





            14.9 CALIBRATING THE FILES



                 For the files of surface brightness distribution  (type  1),

            the  following  calibrations  will  be necessary.  1) The surface

            brightness values will be  noisy  at  large  distances  from  the

            center  of  the  object,  and  some  smoothing by binning will be

            necessary if plots are to be made.  The binning is not  necessary

            in  order  to  use  option RG.  2) Since the inclination angle is

            measured on the frame, and the frame may be  tilted  relative  to

            north on the sky, a constant may have to be added.  3) The radius

            is in pixels and should be converted  to  arc  seconds.   4)  The

            surface  brightness  values are in ADU and should be converted to

            magnitudes for plots and tables.

                 These  calibrations  are  carried  out  with  option  ED  in

            successive  steps.   The  binning  can  be  done with a step size

            proportional to the radius (command B1) and in  the  log  domain.

            Before converting to magnitude units, the sky (as determined from


                                                                Page 7





            option RG) must be subtracted.  It is most convenient to  do  all

            the  computations  in  batch mode where the command file contains

            the  necessary  answers  to  the  prompts  and  the   calibration

            constants.   Start  with  a small amount of binning and then plot

            the file with option DA to see the effect.  The  file  of  galaxy

            parameters  (type  3)  also  needs  to  be  calibrated.   Here  a

            conversion from ADU to magnitudes, and a conversion  from  pixels

            to  arc  seconds  must  be made.  The conversion to magnitudes is

            given simply by m=-2.5log(ADU)+constant.  Certain  options,  e.g.

            CG,  will  ask for the constant when plotting error bars.  Option

            E3  (EDITDATA3)  is  designed  to  files  of  galaxy  parameters.

            Similar  operations,  ie., addition, multiplication, etc., can be

            done on several columns simultaneously.  In this  regard,  it  is

            similar to option ED.





            14.10  PLOTS  OF  THE  SURFACE   BRIGHTNESS   DISTRIBUTIONS   AND

            PARAMETERS



                 Option DA  can  be  used  to  plot  the  surface  brightness

            distrbution  in the units which exist in a single file of type 1.

            No error bars can be included with  this  option  however.   This

            option  is  most  useful  for looking at the raw data, before any

            calibrations or binning have been done.  When it is desirable  to

            include  a  fitting  function formula and error bars in a plot of

            measured surface brightness in magnitude units,  one  should  use

            option  CG.   The data file should have already been converted to

            magnitude units, and have been binned (see above).   The  fitting

            function  must  exist  as  a  data  file  of  type  1 in units of

            magnitudes and should have been convolved  with  the  appropriate

            point         spread         function.          The         files

            [-.MIIPS.SAMPLES]GALAXYPROFILESMAG.DAT                        and

            [-.MIIPS.SAMPLES]GALAXYPROFILESMAGDEVAUC.DAT are examples of data

            and reconstructed profiles using the de Vaucouluers  formula,  of

            two    galaxies,    ID    70   and   170.    The   command   file

            [-.MIIPS.SAMPLES]GALAXYPROFILESMAG.COM   illustrates   how    the

            binning  and  calibration were carried out for ID 170 under batch

            operation.  Option FG is used to  create  the  reconstructed,  or

            artificial,  data  file,  making use of the parameters which were

            solved for with option RG, and the point spread function.   After

            this  stage,  option  ED is used to convert to magnitudes and arc

            seconds.               The              command              file

            [-.MIIPS.SAMPLES]GALAXYPROFILESDEVAUC.COM   illustrates  how  the

            reconstruction was accomplished in batch mode for the galaxy with

            ID=170.  Try plotting the data for these galaxies with option CG,

            command TD.  Answer the prompts with  the  following  parameters:

            readout noise and gain = default, sky and sigma of sky = 491 0.05

            for ID 70 (sky and sigma of sky  =  491  0.1  for  ID  170),  and

            calibration constant = 27.4212.

                 Option CG can also be used to plot color as  a  function  of

            radius,  along  with the predictions of two fitting formulas, the

            de Vaucouleurs formula and the modified Hubble formula (Abell and

            Mihalas  1966, A.J.).  Here one requires several files, two files

            for the blue and red data, two  files  for  the  modified  Hubble

            formula  at  blue  and  red wavelengths, and two files for the de


                                                                Page 8





            Vaucouleurs formula at two wavelengths.  An example of this usage

            is given in CG.DOC.

                 Option DG (DISPGAL) is used  to  plot  the  photometric  and

            structural  parameters  (character  file  of  type 3) and perform

            various kinds of fits.  One could, for example,  plot  log(radius

            parameter)  against  magnitude, fitting two intersecting straight

            lines to  the  bright  and  faint  ranges.   One  can  also  plot

            luminosity   functions,   surface  brightness  parameter  against

            magnitude,  color  delta  against  magnitude,  etc.   In  certain

            instances,  a  histogram of the residuals about a fitted line can

            be made.  The file DG.DOC gives two  examples  of  the  usage  of

            option  DG.   Also,  the directory [-.MIIPS.SAMPLES] contains the

            files  GALAXY_PARAMETERS_BLUE.DAT  and  GALAXY_PARAMETERS_RED.DAT

            which can be used to get familiar with option DG.