Find stars. Sum up total light. It is spread over several pixels in a form given by the point spread function . However, also need to estimate and subtract background.
Error estimation:
we're going to sum over pixels. First just consider the object aperture:
So now we have to consider how we will estimate . In the simplest
case, we just go away from the star and take then mean level. Generally,
we want to minimize effects of any nonuniform background, so we consider
an annulus around the star. If this annulus contains pixels, then
Using this, one can consider the optimal choice of aperture. Clearly, as the aperture increses, the signal-to-noise decreases, so long as you have a reasonable fraction of the total starlight; this is especially true for fainter stars. The optimal choice of aperture will depend on the brightness of the star: a larger aperture will be better for brighter stars, a smaller aperture for fainter stars. But also recall that we don't want to use a too small aperture or else we won't be able to compare results from different frames because of changes in the PSF.
This leads to the commonly used technique of using small apertures for all of the stars on the frame, but large apertures for a few bright stars. The few bright stars are assumed to have representative PSFs for this frame, so all of the small aperture measurements can be aperture corrected to large aperture measurements without the increase in noise you would get if you actually used a large aperture. Note that you can't go arbitrarily small as you will eventually run into the problem of PSF variations across the frame if for no other reason than any small dependences on pixel centering.
In fact, you can do better for S/N if you use additional information.
If you know the shape of the PSF, you can use this information to fit
your stellar image, increasing the S/N in the process. Simple linear
least squares argument, if you know PSF and position accurately, leads
to
Note that you'll improve S/N, but only if your assumption that your knowledge of the PSF is good is valid. This naturally leads into the next area of stellar photometry in crowding fields, when you are forced into fitting the PSF whether you like it or not.