Take 7 exposures of a star, each with the telescope focus offset by 0.1mm, centred around the expected focus value. For the expected focus value you can use the focus value that was used the night before, which should be a value close to 40.1mm.
Pick a focus star (e.g. 10-11 mag photometric standard) near zenith, point the telescope to it, select the appropriate filter to do the focusing with (usually V), and do a test exposure.
USER> source focusstar hh mm ss.s dd mm ss j2000 USER> next SYS> filter V SYS> tv off (get the TV flat out of the beam) SYS> run 15 focustestand check the result in IRAF
ing> das_get last ing> imexamine (keystrokes a, r and q)the count rate of the 15 second exposure should be sufficient to do a proper Gaussian fit. If your star is to bright, pick a fainter one; do not expose less than 15 seconds otherwise the seeing will not be sampled evenly. If your star is too faint, pick a brighter one.
When you have found a good star, make a 200x200 pixel window around it
SYS> window 1 200 200 xxx yyywhere the values of offsets xxx and yyy should be computed from the result of the centroid fit in IRAF (in this case and similar for yyy).
Set the telescope focus to 0.3mm less than the expected best focus, and do a RUN
SYS> focus 39.8 SYS> run 15 "focus 39.8"Then increase the focus by steps of 0.1mm and take a total of 7 runs. While doing these exposures, you can compute the FWHM of the stellar images in IRAF (the image scale for SITe2 is 0.33arcsec/pixel)
ing> das_get last ing> imexamine (keystrokes a, r and q)The image with the smallest FWHM will give you the best focus value. Set the focus and undo the windowing
SYS> focus 40.13 SYS> window 1 0 0 0 0
In cases of very good seeing repeat the focusing sequence with a focus increment of 0.05mm.