Processed images of the globular cluster M92.
Introduction
The original motivation for PSF fitting methods was for crowded field photometry, where often stellar images are blended, and any reasonable size aperture might include more than one star. DAOphot was developed by Dr. Peter Stetson at the Dominion Astrophysical Observatory, Victoria BC, for precise ground-based photometry in the crowded fields of globular clusters. It has since been incorporated into IRAF as the PSF fitting package. If you want to know all the gory details see Stetson (1987). However, even for uncrowded environments PSF methods may still yield improved signal-to-noise by more than 10% compared to aperture photometry, since more of the available information is being used. The profiles of stars from the ground have been found to consist of an approximately Gaussian core, due to seeing. In addition, the profiles have large wings decreasing only as an inverse square in intensity, largely a result of atmospheric scattering off dust and aerosols, plus dirt and scratches in the optical system. Use of profile fitting techniques can remove most of the variations due to seeing changes, as well as enabling larger effective radii to be used.
Here is a summary of the procedure one must follow.
Although the PSFis modelled over a large radius (typically twice the FWHM), one may choose the central region over which the fitting is done. About 1 times the FWHM PSF works well, that is, about the same as the radius used for the preceding aperture photometry.

Figure 1. PSF fitting photometry flowchart
In this assignment you will be asked to log your data onto the answer worksheet. Because the final results depend crucially on your answers at the beginning, make sure you check your parameters with your instructor, TA, or the web page on-line. For clarity, Figure 1 shows a flowchart showing the various steps involved. Review these steps and consider whether or not they seem reasonable. We'll go through them with the M92 dataset.
Throughout this handout, we will use "m920004" as the image you work on. However, this could just be any fully processed (i.e. bias- and dark-subtracted, and QE corrected) image on which you want to do photometry, especially one with many, many stars in the field. Make sure you use only the fully processed M92 files here.
| (Note the key at the left as you will need to repeat the following steps for m920006 once you finish with m920004.) |
First you need to set the characteristics of the CCD image data in the datapars file; daoedit is a useful task for this, providing you with information on the FWHM PSF of stars, sky mean and sky sigma.
| ecl> digiphot | # Did you "unlearn" it first? |
| di> daophot | |
| di> disp m920004 1 | |
| da> daoedit m920004 | |
| ? | # list cursor options |
| # WHAT PARAMETER SETS ARE USED? | |
| r | # produce radial plot for star, FWHM PSF, sky mean and sigma tabulated in graphics window. |
| a | # gives you an on-screen record |
Now do Problem #1, repeating the steps for 5 stars in each filter.
Select isolated stars over a range of brightnesses to get representative values. We are getting set up to determine parameter values for the task datapars. The values we set are crucial for the success of DAOphot! After you determine your values, check them against those shown on-line to make sure that yours are not only reasonable but also ones that will work. It is OK if yours are slightly different from the on-line ones.
The other critical parameters you need to set in datapars are:
Find the actual image header keywords for the following parameters and enter them in datapars:
Now do Problem #2, filling in the table. Do not run daofind quite yet.
| Thought questions: What would happen with the number of stars selected if you set datamin too low? Too high? We will be working with images of M92, a globular cluster taken through a visual and a blue filter. Would you expect the datamin (minimum detection threshold) value to be greater or less in the visual filter than in the blue? For a given datamin, would you expect more stars to be selected in the visual image or the blue? Why? Why would we even want to set a datamax value? Under what conditions would setting this value be required? |
After you have filled out the table with your values, compare those values with the instructor's or TA's copy of the datapars listing to see if your values are reasonable.
![]() |
Cautionary Note: You will most likely need to run daofind many times until you get results that you are satisfied with. Each time you run it, more output files are generated. The best thing to do is delete those files before rerunning daofind so that all files are version ".1" as in m920004.mag.1, m920004.coo.1, etc. DON'T TRUST YOUR MEMORY TO KNOW WHICH VERSION OF .MAG, .COO, AND OTHER FILES GENERATED GO WITH WHICH OTHER VERSIONS. Trust your instructor on this fine point of working within IRAF; deleting files and starting completely over will save you time in the long run. |
| da> daofind m920004 | #defaults should be okay- threshold may sometimes require adjustment |
| HIT THE SPACEBAR TO ACTIVATE THE PHOTOMETRY. You will then "q" and "w" just like qphot. | |
| da> tvmark 1 m920004.coo.1 mar=cir rad=3 | # mark ID'd stars on image |
| da> txdump >> m920004.coo | #generate simple ascii coordinate list. |
m920004.coo.1 |
#respond to prompt |
xc,yc |
#respond to prompt |
| da> tvmark 1 m920004.coo mar=cir rad=4 | # check results |
In m920004.coo you now have a list of all stars upon which daophot thinks it can perform PSF fitting. If only a few stars were selected, then perhaps some of the parameter values need to be adjusted. What do you think?
| This part of the tutorial and exercise is extremely important! Make sure you understand what is going on. It helps to use phelp often and seriously. |
The task phot uses a number of different parameter files: its very own photpars, the general CCD/image one (datapars), one for centering (centerpars) and yet another for the sky fitting (fitskypars). You need to edit each of these. Remember, it is usually an excellent idea to "unlearn" each parameter set before entering in your values. Accept the defaults as as given, unless itemized below.
| da> epar photpars | |
apertures = ? |
# choose an appropriate aperture size for relatively faint stars |
| da> epar centerpars | |
calgorithm = centroid |
#calgori |
cbox = 5.0 |
|
| da> epar fitskypars | |
salgorithm = mode |
#salgori |
annulus = ? |
# choose sensible values here to start with |
dannulus = ? |
Now do Problem #3. After marking down your choices, compare them with those of a classmate and then your instructor or TA before proceeding.
| da>lpar phot | # What’s there? Do you see what other tasks are called? |
| da> phot m920004 m920004.coo | # output file m920004.mag.1 (same as qphot) |
Get a listing of the files in your directory. If you run phot more than once, you get more than one ".mag" file for an image. The second file is named ".mag.2" and if you run phot again, you get a ".mag.3" etc. The program will not overwrite a .mag file. This also happens to the .coo files and the .als files, and so on. We STRONGLY recommend that you either move the previous output files to a subdirectory or delete them altogether. Having multiple versions of these files WILL result in confusion and irregular results. Previous statement has been proven many times before. See warning with the
above.
First set your PSFparameters:
| da> epar daopars | # give your values a run first |
function = auto |
|
psfrad = ? |
# the radius within which the stars, PSFis defined |
fitrad = ? |
# region in which fitting performed |
Then select your stars interactively:
| da> epar pstselect | # 5 is probably all you will need |
maxnpsf = 5 |
|
interac = yes |
Five is a reasonable number of stars to use to make template. The fainter they are, the more you need; it is all a matter of making a good model. Choose isolated, fairly bright stars. Now may be a good time to do a "phelp pstselect."
da> pstselect m920004
Accept the defaults echoed or change them. The program accepts the .mag file with the HIGHEST version number.
MAKE SURE YOU CAN SEE ALL OF EVERY WINDOW! |
Select suitable PSF stars (i.e. bright and isolated), saving each one as desired until you reach maxnpsf, save and quit.
The steps are "a" for add when in the image, and "a" for accept when in the graph as you examine the 3-D profile. It is best if you do not rush the program here. We found that it takes a few seconds to activate the graphics window. You can delete a star from the list by putting the cursor over it and hitting "d."
| da> ls | #Your directory should contain a m920004.pst.1 file |
Now go back to the
and do the steps again for m920006.
There has to be the same number of lines in each ".lis" file. IRAF processes these lists on a line-by-line basis.
| da> ls m92*.fits > im.lis | # generate list of images |
| da> ls *.mag.1 > mag.lis | #generate corresponding list of mag files |
| da> ls *.pst.1 > pst.lis | # |
| da> psf @im.lis @mag.lis @pst.lis interac- | #run PSF non-interactively; the @ sign tells the program to look in the file for lines of data |
Now to examine the model PSF (something you should ALWAYS do under PSF fitting photometry!):
| da> lpar seepsf | |
| da> seepsf m920004.fits.psf.1 m920004.fits.psf.1s | |
| da> seepsf m920006.fits.psf.1 m920006.fits.psf.1s | |
| da> disp m920004.fits.psf.1s | # display |
| da> disp m920006.fits.psf.1s | # display |
| Use imexam to check that profile looks like that of single star (No sign of contamination from near neighbors) | |
| da> imexam | |
Now do Problem #4.
| da> ls *psf.1.fits > psf.lis | # generate list of PSFfiles |
The next step finally produces the PSF fitting photometry files *.als.1 - nothing short of magic.
da> allstar @im.lis @mag.lis @PSF.lis
Now do Problem #5, and check your results with those of another student and with your instructor.
You will need to obtain a program called "match." This program, written in C and PERL, is a terrific time saver. Following are the steps you should take to install the program in one of your directories. You will be deleting these files after you finish this exercise, but we figured the installation process is an important one for you to learn. NOTE: MATCH IS RUN UNDER LINUX, NOT IRAF!
Summarize here, as much as you can understand, what you think the .configure, make, and make check commands are doing.
Have your instructor initial that you’ve tried to figure things out: ___________
One of the extracted files is called "match.html." It describes how to use match to extract the information for stars that are "matched" in both the visual and blue images. You should read through the introduction, preparing the input, and usage sections of the manual.
Within IRAF, extract the ID, XCENTER, YCENTER, MAG, AND MERR from your two *.als.1 files. You should not run match in your bin directory but rather in the directory where your processing has been occurring.
Noting that the first column of the table is given the index number "0," the following command works fine for our work if you extracted the information exactly as given (substitute your file names for the italized names):
match starsA.dat 1 2 3 starsB.dat 1 2 3 outfile=matched id1=0 id2=0
Compare the results side-by-side by using the following command
diff --side-by-side *mt* | less
References