Focussing with intra and extra focal images
A. Tokovinin and S. Heathcote (PASP 118, 1165; 2006) defined A4 as the square-root of the sum of the centralized image moments Mx2 plus My2. A4 generally lies on a straight slope, seeing can break the strict bi-linearity close to the focal position. If you measured the slope of A4 once, you can determine the focus position with two images: One (highly) extrafocal and on (highly) intrafocal.
From an estimated focal position, put the telescope into a far extrafocal, followed by a far intrafocal position and take two images, like in the example. Note the different shapes of the images, reminiscence of a not ideal alignment of the optical axis. Calculate A4 and read off the current best focal position. Note that the value of A4 varies, thus it is mandatory to take both, the extra- and the intrafocal image. Optical aberation, to first order, do not alter the result.