Introduction

Because all reconstruction algorithms require identical mapping of the target images onto the sky, the preprocessing is an essential step. The standard preprocessing algorithm uses five parameters to rotate, scale and translate an image. Therefore, the parameters specified in the dialog window (see figure 1) must be precise.

Preprocessing dialog
Figure 1: Dialog window containing the preprocessing parameters.

The following parameters are presented in the preprocessing setup:

  1. The list of files containing calibrated images is used to select the file for which the preprocessing parameters should be inspected and/or modified.
  2. If a file contains more than one image (different position angles), the <- and >-buttons are used to select a specific image number.
  3. It is possible to specify an image as a reference image. The orientation of that image is then used as a reference if the transformation parameters of the other images must be calculated.
  4. Several algorithms are available for transforming an image:
  5. There are several ways to determine the transformation parameters:
  6. All available transformation parameters use up to five parameters for scaling, rotation, and translation. Image scaling is currently not implemented.

If the FITS header keywords are available and sufficient, they are preferred over a calculation of the transformation parameters. If an explicit calculation of the parameters is required, a set of reference points (reference stars) is needed. These reference stars are created by using the reference star tool. During an inspection of the calibrated data, several reference points or stars are identified. At least two stars are needed in order to calculate the rotation angle. All reference stars must be defined in each calibrated image, and each star must have the same reference number in each image. Figure 2 shows a calibrated image with two defined reference stars. Because the calculation of the rotation angle or translation vector works only between two images, one image must be marked as the reference image (see Reference checkbox in the preprocessing parameter dialog window).

Calibrated data
Figure 2: Calibrated data.

Reference Star Tool

The reference star tool (see section Tools) provides the usual image navigation interface (zooming and panning of an image) and allows the creation, modification, and deletion of reference stars.

Mouse buttonFunction
Left clickCreates a new reference star at the mouse click position.
Middle clickShows the dialog window containing all information about the selected reference star.
Right clickDeletes the selected reference star.
Middle dragMoves the selected reference star to a different position.
Shift left clickZooms into the image, and the click position is used as the new image center (from view tool).
Shift middle clickUses the click position as the new image center (from view tool).
Shift right clickZooms out of the image, and the click position is used as the new image center (from view tool).
Shift middle dragMoves the image (from view tool).
Table 1: Reference star tool mouse button assignment
Reference star objectReference star infos
Figure 3: Graphical representation and dialog window of a reference star.

The dialog window of a reference star shows the following information:

  1. The label of a reference star is automatically created and updated.
  2. The position of a reference star uses fractional values. It is possible to recenter the reference star or set the position explicitly. The Update button recalculates the statistical information after changing the position of a reference star.
  3. The values of the pixel in the center of the reference star and the eight neighbors are shown. The orientation in the dialog window and in the displayed image is identical.
  4. The statistical information uses only the neighbor pixels; the central pixel is ignored.
  5. The deviation describes the pixel value as mean + σ × deviation. If the deviation is too big, it is possible that the central pixel is a defect pixel.

Estimating the Transformation Parameters

The code snippet in source 1 contains the method of calculating the rotation angle of an image according to the fixed rotation angle of a reference image. For each reference star, the basic algorithm calculates the angle between the x-axis and the line from the center of the reference star set (center of gravity) to that reference star. The distance of that star from the center of gravity determines the significance (weight) of the calculated angle.

; refAngle : rotation angle of the reference image ; refPos[0,*] : x coordinate of a star in the reference image ; refPos[1,*] : y coordinate of a star in the reference image ; refCX, refCY : center of gravity of all stars in the reference image ; imgPos[0,*] : x coordinate of a star in the current image ; imgPos[1,*] : y coordinate of a star in the current image ; imgCX, imgCY : center of gravity of all stars in the current image angle = 0.0 weight = 0.0 FOR nr=0,nstars-1 DO BEGIN dx = refPos[0,nr] - refCX dy = refPos[1,nr] - refCY d = SQRT(dx*dx + dy*dy) ; the distance from the center as weight refAngle = ATAN(refPos[1,nr] - refCY, refPos[0,nr] - refCX) imgAngle = ATAN(imgPos[1,nr] - imgCY, imgPos[0,nr] - imgCX) diffAngle = imgAngle - refAngle IF diffAngle GT !PI THEN diffAngle -= 2.0*!PI IF diffAngle LT -!PI THEN diffAngle += 2.0*!PI angle += d*diffAngle weight += d ENDFOR angle /= weight
Source 1: Code snippet for calculating the rotation angle.

The code snippet in source 2 contains the method of calculating the translation vector of an image according to the fixed position of a reference image. This method requires a precise rotation angle because this angle is used to rotate the reference stars in an image and calculate the vectors between the same stars in the reference image.

; refAngle : rotation angle of the reference image ; refPos[0,*] : x coordinate of a star in the reference image ; refPos[1,*] : y coordinate of a star in the reference image ; imgPos[0,*] : x coordinate of a star in the current image ; imgPos[1,*] : y coordinate of a star in the current image phi = !DTOR*(r - refAngle) FOR nr=0, nstars-1 DO BEGIN xs = imgPos[0,nr]*COS(phi) - imgPos[1,nr]*SIN(phi) ys = imgPos[0,nr]*SIN(phi) + imgPos[1,nr]*COS(phi) transX[nr] = refPos[0,nr] - xs transY[nr] = refPos[1,nr] - ys ENDFOR tx = MEAN(transX) ty = MEAN(transY)
Source 2: Code snippet for calcuating the translation vector.

Recentering a Reference Star

If a closer look at a reference star (high magnification) shows that the position is not correct, some methods to automatically recenter the graphical object exist:

Additional information: