AUTOMARK: Locate Stars Automatically in an Image



AUTOMARK finds objects on an image, storing their positions in a photometry file. It works this way:

REJECT is used to reject stars that are near masked pixels. See MASK for instructions on masking pixels. RADIUS should be set to a value that is near the FWHM of the stars in pixels. REJECT should be at least 3 times RADIUS. REJECT=0 (or REJECT not given) means that stars will be found all over the image. Default values are RADIUS=2 and REJECT=0.

The centroiding algorithm will recompute the centroid using a shifted region if the last centroid falls off the middle of the centroiding region. If it does not converge within 6 iterations, it does not mark the object. The maximum number of iterations can be changed with the NITER=n keyword. Also, you can force the program to find something by using the FORCE keyword, in which case the routine will use the last centroid computed, regardless of whether it has converged or not - be cautious with this!

Note that this program will find high points in an image which are not stars. It will center on galaxies, cosmic ray hits, etc. The program was designed for moderately crowded images with few defects - images for which the number of stars is much larger than the number of defects. Use MASK to mark cosmic ray hits, bad columns, galaxies, etc.

If no RANGE of peak values is given, the program will center on peaks with heights between 0 and 1.0E10. If only one value is given, it will find peaks with values from that given upwards to 1.0E10.

AUTOMARK appends to the current photometry file, if there is one. If the keyword NEW is given, it creates a new list.

Object ID numbers which will be output into DAOPHOT files using the SAVE DAO= or SAVE COO= command can be specified with the ID= or OBSNUM keywords. Using ID=id associates the first detection with the number 'id', then subsequent detections have 'id' incremented by one. The observation number (from the FITS header value OBSNUM) will be coded into the ID number if the OBSNUM keyword is specified.

Example:

A 'local peak' is defined as a pixel for which ALL 8 adjacent pixels (left, right, top, bottom, and the 4 diagonals) have lower values.

Here is a procedure which masks pixels larger than a certain value, then finds the stars. This rejection of bright stars can be used to eliminate saturated stars. The program also masks the edge pixels so that stars too close to the borders of the image are not found.

  PRINTF 'PROCEDURE FINDALLSTARS'                       ! PRINT HEADER.
  PRINTF 'THIS PROCEDURE FINDS ALL STARS ON AN IMAGE.'
  ASK         'USE WHICH IMAGE                             >> ' I
  ASK         'WHAT IS THE BRIGHT LIMIT FOR STARS          >> ' BRIGHT
  ASK         'WHAT IS THE FAINT  LIMIT FOR STARS          >> ' FAINT
  ASK         'AVOIDANCE RADIUS FOR MASKED/EDGE PIXELS     >> ' REJECT
  ASK         'RADIUS FOR COMPUTATION OF CENTROID          >> ' RAD
  STRING OPT '?TYPE NEW TO START A NEW LIST, OR HIT RETURN >> ' OPT
  UNMASK! CLEAR MASK LIST
  !  Insert here a call for masking pixels other than the edges.
  ER=SR[I]+NR[I]-1 EC=SC[I]+NC[I]-1                 ! FIND END ROW, COLUMN
  MASK R=SR[I] R=ER C=SC[I] C=EC                    ! MASK EDGES
  CLIP $I MASKONLY VMAX=BRIGHT                      ! MASK BRIGHT STARS
  AUTOMARK $I RADIUS=RAD REJECT=REJECT RANGE=FAINT,BRIGHT {OPT}
  END