Script for solving the coordinates of an astronomical image using control points defined by the user. [more]
Keywords: coordinates, annotation
[hide]
[hide]
The objective of ManualImageSolver is to solve the coordinates of images that ImageSolver can not solve. The script ImageSolver is able to find the coordinates of an astronomical image without more user interaction than a few starting parameters (approximate image center and resolution). The coordinates solution is stored in the image in keywords using the WCS convention [1] [2].
ImageSolver works well with clean images of medium/high resolution. However images with too much noise or a wide field are much harder to solve and sometimes ImageSolver can not do it.
ManualImageSolver is able to find the coordinates of astronomical images that can not be solved by ImageSolver. This script uses a group of control points defined by the user that match points in the image that is being solved (Target image) with the corresponding point in an image with known coordinates (Reference image). Given enough control points the script can determine the coordinates of the image with quite good precision. This script can support images with strong distortions.
[hide]
This script is used in three steps:
ManualImageSolver requires a reference image that covers completely the target image. This image should be of good quality, it must have enough stars in the entire area of the target image and it must have a high quality coordinates solution. Although a real image can be used, the best results are achieved using a synthetic image generated using CatalogStarGenerator. CatalogStarGenerator can easily generate a good quality image of any part of the sky.
These are a few suggestions for generating the reference image:
The control points are pairs of points in the reference and target images that correspond to the same coordinates, usually the same star. The control points can be defined using the process DynamicAlignment. After opening the reference and target images in PixInsight you have to launch the process DynamicAlignment. The reference image must be selected as "Source" (first) and the target image as the "Target" (second). The process of selecting the control points is this:
Identifying the same star in both images is perhaps the hardest part of the process. Fortunately, after two or three control points have been set DynamicAlignment can predict the approximate position of the control points in the target image. Because of this, only the two first points are really difficult to match in both images. After them, the rest of points can be matched using the prediction of DynamicAlignment and some common sense.
After selecting enough control points you have to save the DynamicAlignment process to a process icon. This is done dragging the triangle at the lower left corner of the interface window to the workspace.
These are a few suggestions for selecting the control points:
As the final step you have to run the script ManualImageSolver. This script analyzes the control points and the reference image and calculates a solution for the coordinates of the target window.
ManualImageSolver works on the active window in PixInsight. When you run the script it shows its configuration dialog:
Control points icon
This parameter shows a list of the DynamicAlignment icons available in the workspace. You have to select the icon that contains the control points that you want to use for solving the image. This icon can be created using the process explained in the section Control points.
Reference image
This parameter shows a list of all the images open in PixInsight that have coordinates defined. You should select the image that was used for creating the control points icon or one with exactly the same geometry and coordinates.
When this option is selected the script generates an image which shows the residuals of the solution. The image shows as green crosses the predicted position of the control points using the calculated solution. Red lines from each control point join the predicted position to the actual position marked by the user.
This image can be used to analyze the errors of the solution. In a good solution all the red lines should be very short (in a perfect solution the lines should have degenerated to points). When there is a control point with misplaced position its red arrow is much longer than the rest of control points.
This parameter activates the distortion correction using surface splines. This option should be selected when the image deviates from an ideal projected image. This usually happens in images taken with focal lengths shorter than 400mm.
When this option is active the script stores the solution in the properties of the image using a non-standard format. In order to be able to use the solution in other applications, the script also computes a lineal solution (without distortion correction) and stores it in the keywords of the image in the WCS format.
The options Show distortion map and Generate residuals image can help to evaluate the quality of the distortion correction.
When this option is activated the script creates a new window with a representation of the distortions in the image. The new image contains a grid with arrows at the center of each cell. The arrows point to the point where the center of the cells would be located if the image didn't have optical aberrations.
This option is only enabled when the distortion correction is active.
The script generates a CSV archive with a distortion model that consists in a list of points and their displacement relative to an ideal image with no geometrical optical aberrations. The points used in the model are the control points, so the control points should cover the whole image for best results. The distortion model is compatible with StarAlignment and ImageSolver.
This option is only enabled when the distortion correction is active.
When the script finishes successfully, stores the coordinates in the image and the console shows the values of this solution.
The quality of the solution can be checked analyzing the value of the RMS error reported in the console, analyzing the residuals image and using AnnotationScript for drawing a grid and the position of the stars on the target image.
[hide]
Since the process of defining the control points for ManualImageSolver is quite slow and tedious, the user usually will not want to define more than 30-40 control points. Although this number is enough for calculating a good solution for most images, the quality of the solution is not comparable to the solutions calculated by ImageSolver which can use several hundreds of samples.
The solutions calculated by ManualImageSolver can be optimized using ImageSolver. Although ImageSolver can not solve some images starting from scratch, when these images are already solved, ImageSolver can be used for further improving the solution.
After solving the image using ManualImageSolver you can run ImageSolver selecting the option "Only apply optimization" which is available at the "Image parameters" section. It is important to activate the distortion correction and set good values in the catalog filter in order to extract enough (but not too many) stars.
The possibility of optimizing the solutions using ImageSolver allows to use ManualImageSolver to get an approximate solution using only a few control points and then get a precise solution using ImageSolver.
The process of solving images using ManualImageSolver is quite tedious because the user has to define the control points one by one. When you want to solve many images, this get old fast. This section assumes that the images have geometric distortions since ManualImageSolver is usually not necessary for undistorted images.
There are several strategies than can be used for accelerating this process. The next sections explain them, from the fastest/easiest to the slowest.
Both ImageSolver and ManualImageSolver can generate distortion models for solved images. The distortion models can be used in ImageSolver for assisting in the process of matching the stars of the image against a catalog. This allows ImageSolver to solve images that it would not be able to solve without a distortion model.
You can use in an image the distortion model generated from another when both have been taken with the same equipment and parameters: same camera, lenses/telescope, focal length and aperture.
When you need to manually solve many images taken with the same optical system, you can use distortion models to speed up the process.
First you have to create the distortion model. The documentation of ImageSolver has a section describing how to generate a distortion model.
When you have a good distortion model, the images can be solved using the following procedure:
There are a few tests that can be done for checking if the solution is correct:
If an image can not be solved using this method you can use the second method.
This method is very similar to the previous one but it needs more work. It requires to get a distortion model the same way as explained in the previous section.
For each image you have to do this:
If the solver finishes without errors you can check the quality of the solution the same way as the previous method (distortion map, residuals image, annotation).
If this method can not still solve any of the images you have to use the next method on them.
This method consists in calculating a medium precision solution using ManualImageSolver and then optimizing the solution with ImageSolver:
Even if ImageSolver still could not solve the image, the first step (ManualImageSolver) has already calculated a solution good enough for most purposes. In this extreme case you could add more control points to ManualImageSolver for improving the solution.
[hide]
The algorithm of ManualImageSolver is this:
[hide]
ManualImageSolver has the following limitations:
[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
Copyright © 2013-15, Andrés del Pozo