Thus ideally for calibration we would have Bias, Dark, Flats. If flats are not available, then we can use the `doApplyGains` instead.
There are three ways to detect donuts, depending on the fidelity of the WCS information attached to the exposure.
1) WCS is within ~10 px - can use that directly to get sources from the reference catalog : only defocal images needed
2) WCS is within ~100 px + rotation > 6deg - too much as a starting point for astrometry : need in-focus image to run sourceDetectionTask and find WCS from astrometryTask. The donuts at defocal images are used at that positions
3) WCS is within or more than 100 px off (or not available at all) - use donut template fitting: only defocal images needed
Suggested sequence would be in-focus, extra-focal, intra-focal, similar to https://confluence.lsstcorp.org/display/LSSTCOM/2021-11-04+Aux-Tel+Night+Log . Since in cases 1) and 2) the in-focus source position is used for selecting defocal donut location, it would be ideal to minimize the telescope movement between in-focus and defocal exposures (i.e. take several in-focus+defocal sequences:
intra-focal #1, extra-focal #1, in-focus #1
intra-focal #2, extra-focal #2, in-focus #2
intra-focal #1, intra-focal #2, intra-focal #3,
in-focus #1, in-focus #2, in-focus #3,
extra-focal #1, extra-focal #2, extra-focal #3
(unless in the latter case the pointing does not dither drastically)