Script for aligning deep sky astronomical images using their coordinates. [more]

Keywords: alignment, coordinates




The alignment of images is a basic tool for processing of astronomical images. PixInsight has an excellent tool (StarAlignment) for aligning images that works comparing the overlapping areas between the target image and a reference image and trying to find a match between them. Then computes a lineal transformation that converts the geometry of the target image so that it is similar to the reference image.

AlignByCoordinates uses a different approach to the alignment: Instead of matching an image against other, it requires that the images are plate solved. Knowing the coordinates of each pixel of the image the script can reproject them so the geometries of the images are compatible.

The geometry of the image has to be defined using the convention FITS World Coordinate System (WCS)[1] [2] . This can be done using the scripts ImageSolver or ManualImageSolver. There are also other applications that can solve images using this convention such as PinPoint.

AlignByCoordinates can cope with two kind of geometric distortions:


Execution mode

The script has three modes operation that can be chosen using the Execution mode box.

Align images against reference

This mode uses an image as a reference and aligns all the images in the target list against this. For each target image a new image is generated that has the same geometry as the reference image.

This option is useful for stacking images that cover the same area.

Undistort images

This mode generates a new image for each target image removing the geometric optical aberrations. The geometry of the output images keep the characteristics of the original geometries (projection, resolution, rotation and dimensions) but removing the aberrations. This mode doesn't use a reference image.


Reference image

The reference image for the execution mode Align images against reference can be selected using the Reference image list box. This parameter is not used when the Execution mode is "Undistort image".

You can select as reference an open image or a file. The list enumerates initially the open images in PixInsight. With the Browse button you can add a file to the list.

Target images

The script can use the active image in PixInsight as target image or it can use a list of images. You can add files to the list using the button Add files or you can add open windows using the button Add windows. The button Remove images removes the selected images from the list. The button Clear list removes all the images.



This option determines the quality of the output:

  • Fast : This option calculates the alignment transformation for a few control points and then interpolates the transformation for the rest of values. The interpolations is done using DynamicAligment. The quality of the transformation is usually good enough for some uses but it is not guaranteed that all the pixels are correct.
  • High quality : This option calculates the alignment transformation for all the pixels in the image. The quality of the result is the best possible but the process can be quite slow, up to several minutes for each image.

Pixel interpolation

This option determines the algorithm for pixel interpolation when the High quality option is used. The available values are the same used in StarAlignment.

Clamping threshold

This parameter is explained in the documentation of StarAlignment.

Output images

Output directory

Path of the directory where the aligned images will be written. If it is empty, the images will be written at the same directories as the source images.

This parameter is not used when aligning windows since in this case the images are not written to the disk.

Output file suffix

This suffix will be appended to the filename when saving each image.

Overwrite existing files

If this option is not checked the alignment of an image fails when the output file already exists.

On error

This parameter determines what to do when there are errors during the process. The options are Continue, Abort and Ask user.




[1] E. W. Greisen, M. R. Calabretta (2002) Representations of World Coordinates in FITS, Astronomy & Astrophysics, 395, 1061-1075

[2] M. R. Calabretta, E. W. Greisen (2002) Representations of Celestial Coordinates in FITS, Astronomy & Astrophysics, 395, 1077-1122

[3] Wikipedia contributors, Gnomonic projection, Wikipedia, The Free Encyclopedia

Related Tools

StarAlignment, DynamicAlignment, GradientMergeMosaic

Related Scripts

ImageSolver, ManualImageSolver