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.
The following parameters are presented in the preprocessing setup:
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).
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 button | Function |
---|---|
Left click | Creates a new reference star at the mouse click position. |
Middle click | Shows the dialog window containing all information about the selected reference star. |
Right click | Deletes the selected reference star. |
Middle drag | Moves the selected reference star to a different position. |
Shift left click | Zooms into the image, and the click position is used as the new image center (from view tool). |
Shift middle click | Uses the click position as the new image center (from view tool). |
Shift right click | Zooms out of the image, and the click position is used as the new image center (from view tool). |
Shift middle drag | Moves the image (from view tool). |
The dialog window of a reference star shows the following information:
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 |
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) |
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: