ING Banner
Home > Astronomy > William Herschel Telescope > Quality Control > Shack-Hartmann recipe

Shack-Hartmann recipe


The following recipe is for carrying out and analysing Shack-Hartmann tests at the WHT. The procedure should be similar for the INT and JKT. Allow one hour to obtain Shack-Hartmann data at two elevations (e.g. 90 and 30 deg), and another hour to reduce them.

Contents:

  1. A few days before the camera is to be mounted
  2. Afternoon activities
  3. At night
  4. Data analysis
  5. Interpretation
  6. Acknowledgments
  1. Check that all components (and the manual) have been located.
  2. Check that directory /data/qc/shack is visible.
  3. Check that a solaris computer (e.g. lpss26) is available, for running the data-reduction software.
  4. Run through a test reduction of some old data, e.g. runs 993 and 996 in /data/qc/shack.
  1. Put the Shack-Hartmann camera somewhere accessible (i.e. not on WHT aux-port), with a monitor showing the output from the TV camera.
  2. Move the blue filter into the TV path, i.e. move the slide (which is quite stiff) to its lowest position as viewed with the camera oriented in the position in the photo below. Don't use the central slide position - this is a green filter, which has very different focus.
  3. Switch on the power supply for the lamp - usually two boxes left on the desk in the control room (NB both boxes must be switched on).
  4. Set the lamp current to about 2.8 Amps (2/07).
  5. Release the two clamping bolts on the TV slide (2.5-mm Allen key needed, NB the central locking screw mentioned in the manual seems not to exist). Focus by moving the slide to minimise the size of the image on the TV. Reclamp.
  6. Mark the position of the lamp spot on the TV screen (this where stars should be acquired).
  7. If the bulb fails, you'll need to remove 4 bolts holding the lamp housing (spare bulbs in instrument-store cupboard).
  8. Mount the Shack-Hartmann unit (4 sections) on the required focal station (section 3 of the manual), with a standard CCD as detector. Beware accidental 120-deg rotation of the CCD. TEK1 and TEK2 both need the filler tube on the right, i.e. at 3 o'clock:

    Check that the lamp spot is still on the TV screen.
  9. Set CCD readout speed = 'Fast'.
  10. Make a trial exposure with e.g.:
    run aux2 5
  11. Determine the exposure time needed to obtain a lamp frame with maximum counts ~ 30000 (~ 6 sec in 2/2012).
  12. Rotate the CCD so that the spots run along rows and columns, with tilt < 4 pixels across the whole frame (capstan D = 3.1 for TEK1 on AUX, 8.0 for TEK1 on WHT PF).
  13. Check that the distance between spots is approx 1 mm.
  14. If light from the lamp is detected on the TV, but not on the CCD, the CCD is probably not responding properly, even if the bias image appears normal (this happened 2/07). If the CCD is responding OK, it should detect dome light scattered into the camera. If you suspect a problem with the optics, ask the DE to remove the CCD, then look into the camera with your eye on-axis, roughly where the CCD would be. With the calibration lamp on (and the dome lights off), you should see a faint blue spot, square in shape.
  15. If some of the central spots are missing or attenuated, and the background is brighter in that region (this happened 12/02), there may be condensation on some of the optical surfaces.

    Example exposure of lamp:

  1. Point the telescope to a bright star (e.g. from the pointing grid).
  2. Acquire the star on the TV, at the position where the lamp spot was detected. The field of view of the TV at Cass is about 20 arcsec, and the scale on the WHT control-room monitor around 0.2 arcsec/mm. NB the image is degraded near the edge of the field of view.
  3. Focus the telescope. With the Shack-Hartmann camera mounted on the Cassegrain A&G box, the focus should be ~ 98.00 (found 2/2012), similar to that for other Cass instruments. (At prime focus, it will be ~ 88.0 mm.) Focus by minimising the diameter of the star on the TV. Seeing must be <~ 2.5 arcsec for the Shack-Hartmann data to be useful.
  4. Rotate the instrument platform so that the spider vanes run along the rows and columns of the chip (then these areas can easily be masked out). The spider vanes may be difficult to see when nearly aligned (tip: stand back from display and defocus your eyes or, equivalently, look at the small copy of the image usually found in the top right corner of the ds9 image display).
    Usually ROT MOUNT 0 is OK (ROT MOUNT 10 was needed in 2/2012).
  5. Switch tracking of rotator off.
  6. Print a copy of the image, and select a reference spot.
  7. Determine the coordinate system on the CCD by offsetting the star 10 arcsec in azimuth, then zero in azimuth, 10 in elevation (if you offset both at once, star will be vignetted). The direction of any observed aberrations with respect to the mirror can then be determined.
    With ROT MOUNT 0 (2/2007, 2/2012), a +ve change in AZ moved the star in direction ~ lower left on the CCD; a +ve change in EL moved the star in direction ~ upper left.

    Example exposure of star:

    Repeat the next three steps at each of the desired positions of the telescope, e.g. elevations 90, 50, 20, 50, 90 (i.e. including a test for hysteresis with elevation).

  8. Acquire a bright star (mag ~ 4 - 5 for WHT aux) at the position on the TV where the lamp spot appeared. The telescope should be tracking. The rotator should be set to the fixed mount position as above (e.g. ROT MOUNT 0) and NOT tracking.
  9. Don't do the test in bright twilight, because pisafind translates the gradient in the background into changes in spot position!
  10. Check that most of the spots are present. (During the Dec 2002 tests, many of the spots near the centre of the array were weak, and embedded in a diffuse glow, perhaps as a result of condensation.) The FWHM of the spots will be ~ 10 pixels.
  11. The telescope must be hand guided.
  12. Take 2 - 3 exposures of the star, aiming for ~ 20000 counts peak signal (about 50 sec for a 4th-mag star). The exposures should be long enough to average out seeing variations (i.e. > 10 sec).
  13. Move the telescope a few arcmin, switch on the lamp and take a lamp exposure (see previous section). Star exposures are useless without lamp exposures at the same position of the telescope.
  14. If imaging is available at another focus, obtain hardcopies of images of a bright star sufficiently out of focus that the spider vanes are clearly visible. Obtain one image either side of focus (by the same amount). A recipe for this can be found here. These out-of-focus images should reveal any gross aberrations and serve to confirm the results of the Shack-Hartmann analyses, but they are not essential.
    The Cass TV is probably not useful for this, because of the aberrations in the TV optics, although in principle these could be taken into account by taking taking a second pair of intra/extra-focal images with the mount PA changed by 180 deg.
  15. Record the seeing e.g. as measured by the RoboDIMM.
Work in /data/qc/shack, or in your own directory. NB the programs redhart and newhart have to be run on a solaris computer (e.g. lpss26), they won't run under linux (although the changes required to the code for it to run under linux are probably trivial).
  1. If any of the following files are not present, or need updating, copy them across:
    • defaults.dat (really needed??)
    • wht/whtc_parms.dat (or whtp.. or intc.. or intp.. or jktc..)
    • wht/whtab_parms.dat (or intab.. or jktab..)
    • The executables bin/redhart and bin/newhart (chmod 755 redhart, chmod 755 newhart may be needed).
    The data files are a copy of those that were stored in ~optics/oldsunos/hartmann (copied to /scr/fs1a/crb/optics by Don, 2/07). Example raw star and lamp frames are in /data/qc/shack/teststar.fit, testlamp.fit.
  2. Check that the pixel size (next to last datum in whtc_parms.dat) is correct. If not, edit it.
  3. Copy across the data files rnnnnnn.fit, then within iraf convert them to 2-D files, to allow FIGARO to read them:
    imcopy r******[1] r***
  4. Type figaro, then pisa (use fighelp and pisahelp for help).
  5. Convert the data to .sdf format with:
    rdfits r***.fits
    giving r*** as the required output filename (will be r***.sdf), and accept defaults for the other parameters. NB the FIGARO filename should not begin with a digit.
  6. On each frame, check the maximum counts with:
    istat rnnn
    If > 32768 (pisa cannot handle this) then:
    icdiv rnnn 2 rnnn
    If the maximum was 65535, it's necessary to subtract 1 as well: icsub rnnn 1 rnnn
  7. On each frame, find the coordinates of the spots with pisafind.
    1. Display the frame:
      pisagrey device=xwindows
      Try device=x2windows if this fails
      Respond to the prompts for filename (don't give this on the command line), size (e.g. 1,1124) and min, max (e.g. 0,3000).
    2. Find the spots:
      pisafind results=rnnn.dat
      Use minpix typically 4 - 10 (usually 10), method 0, background default, threshold probably about 2000. It should find ~ 500 spots on the star image, ~ 550 on the lamp image.
    3. If pisafind fails with 'Internal storage space exhausted', it's probably finding too many objects, e.g. when the seeing is bad. Try raising the threshold (e.g. doubling it).
    4. Plot the positions on the image:
      pisaplot overlay annota=f results=rnnn.dat
      This shows whether the selection criteria for pisafind need changing.
      Sometimes pisafind crashes after a long pause, with a bus error, try raising the threshold.
  8. For each set of lamp + star frames, obtain the shifts of the Hartmann spots, by running (on a solaris computer, e.g. via ssh -X crb@lpss26):
    redhart
    which compares the x,y positions recorded in the two rnnn.dat files. Say 'yes' to the plot option, otherwise it will not generate the text file of vectors either. Use SCALE=1. There is an option to remove spots whose centroids are affected by vignetting (spider vanes or edge of mirror). Give /vps as plot device. Output files are e.g. hart682.dat, red682.dat, pgplot.ps (vector plot). Print red682.dat and pgplot.ps.

    Example vector plot (the points near the inner or outer circumference should not be included in the analysis):

  9. Derive the aberrations from the measured shifts of the spots:
    1. newhart
      This reads e.g. hart682 and generates e.g. new682 and pgplot.ps. Give /vps as plot device.
    2. Print both files.
    3. NB newhart falls over if two successive reductions are done by redhart, because it puts in two sets of title lines, you need to edit out one of them.
The vector plot (above) shows the spot shifts remaining after the mean x,y shift (movement of star) and mean radial expansion (focus shift) have been removed. What is left is a superposition of the effects of spherical aberration, astigmatism and coma, higher-order aberrations and random terms.

Spherical aberration vectors point inwards or outwards, size increasing (non-linearly) with radius from centre. Astigmatism yields vectors pointing outwards at two opposite position angles, and pointing inwards at the two position angles at 90 deg to these. The vectors are larger at the edge than at the centre. Coma yields vectors which point in the SAME direction at two opposite position angles, and are zero at the two position angles at 90 deg to these. Vector size goes as radius^2. Bear in mind that even if one of these simple aberrations dominates, the vectors will have had a mean radial-expansion term subtracted by redhart.

Newhart interprets the vector pattern for you, in terms of a superposition of the three simple low-order aberrations. Newhart generates an output text file newhart.dat and a plot file.

The text file reports the amplitude of the aberrations as 80% diameters and as rms (in mm and in arcsec). Note that FWHM = 2.35 * rms.

The total rms is given about half way down the first page in x and y directions. Even in the absence of higher-order aberrations, this is not a simple quadratic sum of the individual rms given lower down the page for spherical aberration, astigmatism and coma. Coma is given as an extent as well as rms - the images look like an axial slice through a cone. Coma is a signature of mirror tilt.

The 8-plot graphical output from newhart shows the spot patterns after subtracting the three low-order aberrations, and compares the relative sizes of the three aberrations.

Example plot from newhart:

The above notes are based on: the Fisher/Worswick Shack-Hartmann manual; pre-1995 notes by Vik Dhillon (setup) and Dave King (reduction); experience since 1995 at the WHT; and comments from Marie Hrudkova in 2012.

Chris Benn

30 April 2002, last revised 15 April 2012



Top | Back

Contact:  (WHT Manager)
Last modified: 15 April 2012