FWHM minimization
From a series of images, the FWHM of a single star is determined. The focus is then the position of minimal FWHM. Propbaly the easiest method to calculate the FWHM of a star (or a measure close enough to it), is by assuming a Gaussian point-spread-function (PSF):
psf(r)=I0·exp(-r2/2σ2), summing psf(r) as Σ and psf2(r) as ΣΣ over the entire range and simply writing
FWHM=√(2ln(2)/π)·Σ2/ΣΣ
Outliers should be rejected to stabilize the search, an initial focal position can be derived from a temperture-depending model.
![f4297.png](/media/images/f4297.max-300x300.png)
f=42.97mm
![f4305.png](/media/images/f4305.max-300x300.png)
f=43.05mm
![f4312.png](/media/images/f4312.max-300x300.png)
f=43.12mm
![f4320.png](/media/images/f4320.max-300x300.png)
f=43.20mm
![f4335.png](/media/images/f4335.max-300x300.png)
f=43.35mm
![f4342.png](/media/images/f4342.max-300x300.png)
f=43.42mm
Measuring the FWHM is strongly affected by varying seeing conditions, thus a parabola is fitted through the points. Outlier removal is advisable (in the example the measurement with FWHM≈14px, f≈43.25 has to be discarded) . The minimum of the fitting parabola is called the optimal focus.
![focusfit.png](/media/images/focusfit.max-600x600.png)
'Long' focal sequence, taken in robotic mode on WiFSIP, 2011-07-17