  The stray light uniformity is one of the important factors affecting the
signal-to-noise ratio of the optical astronomical telescope. It will cause
regional differences in the background intensity of the detector image,
resulting in a decrease of the differential photometry accuracy. The source
that affects stray light uniformity is the inconsistency of the brightness of
the sky background, which comes from moonlight, bright star, and city lighting
pollution. During CCD reduction, the effect of background uniformity cannot be
eliminated by dividing the flat field. Star deletion method is used in
real-time stray light analysis. It's very convenient to achieve a 'clear'
background image without stars in MATLAB. A contour map of stray light
distribution for each object image will be given to demonstrate the background
uniformity directly. The stray light uniformity analysis method is implemented
by the following steps: 1) CCD reduction, including preprocessing of an object
image with bias and flat field; 2) Histogram generation, performing star
subtraction automatically based on ADU value and frequency; 3) Background stray
light contour map generation, stray light uniformity and other parameters
calculations. This method will calculate the uniformity of image surface in
real time, provide background intensity distribution, statistical data of the
CCD image and suggestion on compare star selection during CCD data processing
and improve the photometry accuracy.
