### SELFC

To perform self-correlations on an NDF image file

#### Description:

Performs a self-correlation calculation on an input NDF image file. The resulting correlation image/plot is stored to disk.

The self-correlated image may be used to find flat-fielding faults and faint diffuse objects of a given size.

To reduce the influence of bright objects or cosmic rays; the user may elect to employ a cut out pixel count value where any pixel found to be above that value is ignored. The cutout value is determined by the user inputting a global mode value (usually the sky background count - obtained via HISTPEAK), the background count standard deviation and the number of standard deviations above sky level at which the cutout should occur.

The user is required to enter a value for the size of object(s) of interest (roughly the template size) and also the image pixel size.

The value for each pixel of the output image is determined as follows. An imaginary circle is drawn about the pixel and all pixel pairs within that circle, that lie on opposite sides of the centre from each other, are stored.

Each pair is then considered in turn and the modal count value subtracted from each. The resultant residual pixel count values are then multiplied together. The values found for all the pairs are then summed, the total divided by the number of pixel pairs found and the square root taken. In the event of a negative sum being found the value given is the square root of the magnitude of the self-correlation multiplied by -1.

The resultant value is some measure of the extent to which points within that circle (about the current pixel) are correlated.

The method assumes some sort of symmetry is present in the objects detected but appears to work well on a wide range of image types.

A border is present in the output image which the same width as the radius of the template. All pixels within this border are assigned the value bad.

#### Usage:

SELFC IN OUT DIAM PSIZE BACK USEALL [SIGMA] [NSIGMA]

#### Parameters:

The modal pixel count value found in the input NDF. Units counts.
The diameter of the galaxies to be searched for in the image. Units arc seconds.
The name of the NDF data that is to be examined.
The number of standard deviations above the sky level count value, where the pixel count cutoff occurs.
##### OUT = _NDF (Write)
The name of the NDF that will be created.
The size of each pixel in arc seconds. If the image contains a SKY co-ordinate frame this value will be determined automatically.
The standard deviation of the background count within the input NDF. Should be determined using a routine such as HISTPEAK which ignores outliers.
Used to indicate whether a pixel count threshold is to be a applied when calculating the self-correlation.

#### Examples:

selfc in=search out=scorr diam=15. psize=0.5 back=727. useall=true
A self-correlation is carried out on image GALAXIES. The search is for an object 15 arc seconds across. The image pixel size is .5 arc seconds and the background count level is 727. USEALL=TRUE ensures that no pixels are excluded from the correlation calculation.
selfc in=plate out=plates diam=5. back=6600. useall=false sigma=35. nsigma=5.
A self-correlation is carried out on image PLATE. The search is for an object 5 arc seconds across. The background count level is 6600 and the image pixel size in arc seconds will be determined from a SKY coordinate frame in the image’s WCS component if possible. Since USEALL=FALSE, all pixels with a count value above 6600$+$35.x5. are excluded from the correlation calculation. The output image is named PLATES.

#### Notes:

It is assumed through out that the x and y axis pixels sizes are the same.

#### Implementation Status:

At present suitable normalisation factors have not been implemented. These may be added. As the program stands it is useful for looking at an image to detect faint objects and provides a comparison for users employing cross-correlation techniques. In addition, it provides a simple way of detecting areas of an image where flatfielding has not been entirely successful.