ASTAP astrometric solving method (plate solving)  
Image  Star database  
1  Find background, noise and star level  
2  Find stars and their CCD x, y position (standard coordinates)  Extract a similar amount
of stars for the area of interest from the star database that matches
the star density of the image. Convert the α, δ equatorial positions into standard coordinates (CCD pixel x,y coordinates for optical projection) using the rigid method. 

3  Use the extracted stars to construct the smallest irregular tetrahedrons figures of four stars called quads. Calculate the six distances between the four stars in pixels and the mean x, y position of the four stars.  Use the extracted stars to construct the smallest irregular tetrahedrons figures of four stars called quads. Calculate the six distances between the four stars in pixels and the mean x, y position of the four stars.  
4  Sort the six distances on size for each quad. d_{1} is the longest and d_{6} the shortest.  Sort the six distances on size for each quad. d1 is the longest and d6 the shortest.  
5  Scale the six quad star distances as (d_{1}, d_{2}/d_{1},d_{3}/d_{1},d_{4}/d_{1},d_{5}/d_{1},d_{6}/d_{1}). These are the image hash codes  Scale the six quad star distances as (d_{1}, d_{2}/d_{1},d_{3}/d_{1},d_{4}/d_{1},d_{5}/d_{1},d_{6}/d_{1})) These are the database hash codes  
6  Find quad hash code matches where the five ratios d_{2}/d_{1} to d_{6}/d_{1} match within a small tolerance.  
7  For the matching quad hash codes, calculate the longest side ratios d1_{database}/d1_{image} in ["/pixels]. Calculate the median ratio. Compare the quads ratios with the median value and remove quads outside a small tolerance.  
8  From the remaining
matching quad hash codes, prepare the "A"
matrix/array containing the x,y center positions of the test image
quads in standard coordinates and the arrays X_{ref},
Y_{ref} containing the x, y center positions of the
reference image quads in standard coordinates. A: S_{x}: X_{ref}: [x_{1} y_{1} 1] [a] [X_{1}] [x_{2} y_{2} 1] * [b] = [X_{2}] [x_{3} y_{3} 1] [c] [X_{3}] [x_{4} y_{4} 1] [X_{4}] [._{.} ._{.} .] [._{.}] [x_{n} y_{n} 1] [X_{n}] A: S_{y}: Y_{ref}: [x_{1} y_{1} 1] [d] [Y_{1}] [x_{2} y_{2} 1] * [e] = [Y_{2}] [x_{3} y_{3} 1] [f] [Y_{3}] [x_{4} y_{4} 1] [Y_{4}] [._{.} ._{.} .] [._{.}] [x_{n} y_{n} 1] [Y_{n}] Find the solution matrices S_{x} and Sy of this overdetermined system of linear equations. The solutions S_{x} and S_{y} describe the six parameter plate solution X_{ref}:=a*x + b*y + c and Y_{ref}:=d*x + e*y +f. 

9  With
the solution and the equatorial center position of the reference image
the test image center equatorial position, α and δ can be
calculated. Make from the test image center small one pixel steps in x, y and use the differences in α, δ to calculate the image scale and orientation. This is the final solution. The solution vector (for position, scale, rotation) can be stored as the FITS keywords crval1, crval2, cd1_1,cd1_2,cd_2_1, cd2_2. 
Version: 20220926
© Han Kleijn, www.hnsky.org, 2018, 2022.
This work is licensed under a Creative Commons Attribution 4.0 International License. which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.