Statistics for Quality control of astronomical CCD observations