Starry Vistas by Don J. McCrady

Adding Diffraction Effects to a Focus Mask

Three-hole mask with diffractive strips

One of the hardest things to get right in an astrophoto, surprisingly, is focus.  For visual observing, our eyes are very good at compensating for slightly out-of-focus eyepiece images, but CCD cameras are not so forgiving.  If you miss focus, your stars will be larger than they should be, and softer.  The light from faint stars will be spread so thinly as to make them undetectable, and fine detail will be lost.  It is almost a given, then, that achieving good focus is one of the most important elements in getting good astrophotos.  (One "not-so-bad" effect of being slightly out of focus should not go unsaid:  it will make the star colours more visible.)

Focusing also becomes harder as the f/ratio of your optical system gets faster.  With short focal ratios, the difference between perfect focus and poor focus can be just a few microns of focuser travel.

In the time I've been avidly astro-imaging, I've tried a variety of focusing methods.

  1. Estimating focus through the camera's viewfinder.

    This is simply unreliable.  The magnification provided by the viewfinder is simply too weak to determine focus accurately. 

  2. Estimating focus visually from downloaded test images.

    This simple method can produce satisfactory results.  However, I've found it difficult to determine whether a given test star is as small as it can possibly be (and therefore in best focus).  It's all too easy to misjudge a test image.

  3. Software-assisted focus evaluation (FWHM).

    In theory, software-assisted focusing should be very accurate.  The FWHM focusing method basically computes the size of the test star, and your goal when focusing is to get this value as small as possible.   However, my results using this method have been disappointing.  More than once I've gotten my numbers down to what I thought was the smallest value possible, only to find my resulting image out-of-focus.  Like the previous method, it is very difficult to judge when to stop.

  4. Hartmann masks

    Kendrick KwikFocusA Hartmann mask generally has two or three holes, and is placed over the objective of your telescope.  One commercially available Hartmann mask is the Kendrik Kwik-Focus, seen here.  When a bright star is out-of-focus, the mask produces  three separate images (depending on the number of holes).  As you move closer and closer to good focus, these separate images begin to merge.  At perfect focus, each separate image should lie exactly on top of the others, forming a single image.  A Hartmann mask provides good visual feedback about how close you are to good focus, but has one critical flaw... it's hard to tell when all three images are exactly aligned.

Adding Diffraction Effects

Diffractive strip through a mask holeThe Hartmann mask shown at the top of this page was hand-made from a polystyrene plate, and is similar to the three-holed Kendrik Kwik Focus.  Note, however, the thin strips of tape down the center of each of them.  These behave like the spider veins of a Newtonian reflector, adding diffraction spikes to the image.  Each hole has one strip, and take note of the orientation above.  Each strip points toward the center of the Hartmann mask, so that when they overlay each other, they form a 3-spoked wheel.  This is important, because we can use these to determine whether the separate star images are exactly overlaid.

The following example shows how a bright star (Arcturus) appears through this mask, beginning badly out of focus, until we've reached almost perfect focus.  (Click on the image for an animation of this sequence.)

Focus sequence showing diffraction effects

The first three examples (along the top row) are clearly out of focus since we still see three distinct star images.  The fourth one shows only one star image, but we can still tell pretty easily that the three star images aren't quite overlaying each other.

In the fifth image, we begin to really see the value of having diffraction spikes.  The star looks pretty small and the three star images look like they're exactly overlaid.  But the diffraction spikes clearly indicate that they are not.  How does it tell us this?  Simply, because the three diffraction spikes do not meet at a common point in the center of the star image.

The sixth image is noticeably closer to focus, but the lines still do not quite meet at the same point.

The seventh image (enlarged) shows we've achieved pretty close to perfect focus.  I probably could have nudged the focuser a little bit to get better, but this was within my seeing limits on the night I did this test.

Without the diffraction spikes to help us, it would have been very difficult to judge the difference between the last three focus tests.

One way to make it even easier to tell whether the diffraction spikes align is to use an image processing program to sharpen it.  This is particularly easy in Images Plus, which I use to capture my focus test images in the first place.  In Images Plus, the "Local / Sharpening and Texture Enhancement... / Statistical Difference" dialog does a good job of enhancing the diffraction spikes.

Extreme statistical difference to enhance focus image

Leaving all parameters at their default values, and moving the "Edge / Background" slider radically to the right, produces this image:

Focus image with extreme statistical difference

This has the useful effect of darkening the star's center, making it easier to visualize the intersection of all the lines.


The idea of combining diffraction effects with Hartmann masks originated from Ron Wodaski, in his excellent book, The New CCD Astronomy.  His mask used two holes, but instead of circular holes, he used triangles.  Each point on the triangle imparts a diffraction spike, and like my model above, best focus is achieved when the spikes intersect at the same point.  My only problem with Ron's design is that it produces twelve difraction spikes.  In my opinion, it's a lot easier to judge the intersection of six spikes than it is for twelve.