History

The centroiding algorithmn has changed recently, in order to make it more sensitive to faint stars and insensitive to variations in Dark current and horizontal readout ramps. The Previous algorithm was a Centre of Gravity Based Algorithm which was sensitive to noise, dark current and readout ramps. It has been replaced in this version with an algorithm based upon the cross-correlation of a gaussian profile with the 1d stellar profile.

Several other steps have been added to make the algorithm even more robust.

Centroiding

The Centroid procedure uses the raw ccd data copied to buffer #im-cen. If the peak of the image is above 32767, then the data are divided by 2 in order to allow signed 16 bit arithmetic. this saves on storage space later. the average pixel value in each row and column are then calculated to make 2 1D profiles.

for the UES slit, X and Y profiles area treated differently. At all other configurations, the X and Y profiles area treated as follows.

The profile is filtered with a running 3 pixel average to reduce the noise present.
Any ramp present in the signal is removed by differntiating the signal and calculating the mean pixel to pixel slope. This is subtracted from each pixel in turn. The slope is calculated to 0.01 pixels and rounded after subtraction from each pixel. Thus a slope of 3 pixels over the whole profile is correctly removed. This becomes significant when the siognal peak is only a few 10s of adu.

The profile is then differentiated again and the distance between the +ve and -ve peaks of the slope signal taken as a rough estimate of the width of the star. A Gaussian function with this width is then prepared by scaling a reference look up table. The Gaussian is also differentiated.

The differential signal is inserted into a blank frame with an offset of 1/2 the width of the gaussian reference, so that the correlation will start by comparing the first pixel in the image with the centre of the gaussian profile. Using differentials allow insertion into a blank frame without affecting the result.

The Cross-Correlation function of these two difference functions is calculated next. The cross-correlation is the multiplication of the two signals as a function of offset between them. The offset corresponding to best correlation is taken as the star position.

I order to stop the system recognising a small gaussian shape in the noise floor, instead of a large non-gaussian star ( as happened during testing ) the correlation function is multiplied with the input signal, so that the peak of this function is a combination of good correlation and high signal level.

The peak of the original correlation function is extracted and its Centre of Gravity calculated to estimate the star position to sub pixel accuracy.

The Correlation function by nature contains several ripples near to the peak, these are ignored in the centroid process by extracting only twice the FWHM of the gaussian reference and thresholding at 60 % of peak value.

UES Slit Guiding

The algorithm used for the UES slit is built on top of the correlation centroid described above. The first thing done is to split the window into three parts: The Whole window The area above the slit centre The area below the slit centre The first question is: Is the star straddling the slit? If the signal to noise ratio in both halves of the window above and below the slit is above a threshold, then the start straddles the slit.

If the star does appear on both sides of the slit, then the centroid of each half is calculated with the correlation based routine mentioned above. Then the two peaks of the Y profile od the whole window area found and the area in between filled in with an artificial signal. The resulting profile with a single peak in it is then correlated with a wide gaussian profile so that this will fit the gaussian to the wings of the profile. The result is the 'filled' centroid. The system puts a message on the bottom left hand corner of the display when operating in this mode.

If the star does not straddle the slit, it is treated as a single object and the whole window is centroided normally.

The X profile is always treated as a single 'star' and centroided normally.

The average correlation peak is displayed as well as the signal to noise for the 2D window.



abg@ast.cam.ac.uk