Block
Registration
- What it does
- It finds the stars of every frame and works out how each frame must be moved, turned and slightly bent to lie exactly on a chosen reference frame; on the way it measures the sharpness and the clarity of every frame.
- What it shows
- In Inspect, a chart of the star size and the transparency of every frame over the night, with the reference frame, the frames aligned, the alignment error and the drift; in the Report, the star size and the drift of the field.
- What can be set
- Usually nothing: the defaults suit most nights. Lower the Detection threshold (to 5) for very short or faint frames with few stars, and Min pairs for very sparse fields.
The Registration block finds the stars of every calibrated frame, picks one frame as the reference and fits for each other frame a cubic polynomial of 10 terms that maps its sensor pixels onto the reference. The same pass measures, for each frame, the size and roundness of its stars, its noise and its transparency; the Selection and Stacking blocks use these measures. Frames that cannot be matched with enough stars are left out, each with the reason.
- Calibration
- Registration
- Selection
- Stacking
- Astrometry
1What goes in, what comes out
The block receives the calibrated frames of the session, still in the sensor’s mosaic. It does not resample them. It writes, for every frame, the coefficients of its polynomial, the number of star pairs matched with the reference and the residual of the fit, together with the measures of section 3. The Stacking block drops the raw pixels through these polynomials.
It also draws a chart of the transparency and the star size of every frame over the night, and reports the reference frame, the number of frames aligned, the median residual in pixels and the drift of the field over the night.
2Detecting the stars
Each frame is reduced to 2 × 2 super-pixels. The background is estimated on boxes of 64 super-pixels and subtracted. Stars are the sources standing above the Detection threshold (8 sigma by default) over at least 4 pixels, deblended, left out if the extraction flags them or if they cover 200 pixels or more. The brightest 2500 are kept. For a sensor with an X-Trans mosaic, the colours are levelled first, since its cells hold unequal mixes of colours.
Each star gets a position refined with a weighted centroid, a half-flux radius, and its flux in four circular apertures of 3, 5, 8 and 12 super-pixels in radius, each with a background ring. The positions are written in sensor coordinates.
The detection runs in parallel, one frame per task. The catalogues done are saved every 50 frames and at least every 15 s, so that a stop or a crash keeps them and the next run goes on from them.
3What is measured on each frame
| Measure | How | Used by |
|---|---|---|
| Star size (FWHM), coarse | Four times the median half-flux radius, in super-pixels, of the 300 brightest stars, taken as Gaussian, in sensor pixels. | The reference frame; the sharpness in the weight. |
| Star size (FWHM), Moffat | An elliptical Moffat profile is fitted to up to 150 isolated, unsaturated stars on the green samples at native resolution. A star is kept if its roundness is at least 0.5, its beta at least 1.5 and its residual at most 0.2 of its amplitude. The frame’s value is the median of the geometric mean of the two axes. Not measured (no value) under 10 stars. | The drizzle scale rule; the star-size filter of the Selection block. |
| Roundness | Minor axis over major axis of the Moffat fit (1 is round), median of the stars. Also measured coarsely on the detections. | The roundness filter of the Selection block. |
| Noise | Adjacent super-pixels differ by their noise alone, since the sky and the objects larger than a few pixels cancel. The noise is 1.4826 times the median absolute deviation of these differences, divided by √2. | The weight of the frame. |
| Transparency | Median of the flux ratio, frame over reference, of the stars matched within 1.5 px through the polynomial, in a fixed aperture. At least 10 stars are needed. | The weight; the transparency filter. |
| Pairs and residual | The number of stars matched with the reference, and the root mean square of their remaining distance, in pixels. | Keeping or leaving out the frame. |
The aperture of the transparency is the smallest of the four, at least three half-flux radii of the larger stars (90th percentile over the night). It then holds nearly all the light of a star whatever the seeing. A flux counted only above the detection threshold follows the seeing: on one test set, a frame with stars of 5.3 px read 0.78 for 0.91 and its weight was cut.
Figure 1 shows both sizes for every frame of one night: the stars shrink as the night goes on, and the coarse size, 1.4 times the Moffat one at the start of the night and 2.3 times at the end, follows the change only in part.
4The reference frame
The reference is the sharpest frame of the middle of the night: among the frames that hold at least the median number of stars, those between 30 % and 70 % of the session in time order are kept, and the one with the smallest coarse star size wins. If no frame of the middle qualifies, the whole set of frames with enough stars is used.
A frame of another field in the folder would align almost none of the others. If the reference aligns fewer than half of the frames, the next sharpest frames are tried in turn, up to five, and the one that aligns the most is kept. A frame already aligned by a reference tried is not tried again. A session aligned on its first reference never pays for this. When another reference is used, the log says so.
5Matching and the polynomial
The usual case is a drift of the field. The shift between a frame and the reference is found by voting on the differences between the positions of their stars, in bins of 2 px within 400 px, first with the 150 brightest stars, then with 400 and with 1000, because on a dense field the brightest detections change from one frame to the next. A peak counts only if it stands 8 Poisson sigmas over the chance pairs. If none does, the vote is made over half the frame. The shift is refined on nearest neighbours.
From this first guess the fit runs in 7 passes. The first three are an affine map, from the starting tolerance (4 px), which extends the matches from where the guess is right to the whole field. The next four fit the cubic polynomial, the matching tolerance shrinking with the residuals, to four times their robust spread and not below 0.8 px. At least 30 matched stars are needed. The affine pass comes first because a cubic fitted on a guess that is right only near the centre locked on a third of the stars, 6 px off at the edges, for a rotation of 0.7 degree with a 0.2 % change of scale.
A polynomial of order 3, rather than a rotation and a shift, absorbs field rotation, refraction and optical distortion down to a fraction of a pixel.
6Frames that do not match at first
When the shift matches fewer than 30 % of the stars, the block tries other ways, in this order.
- A field rotation, as an alt-azimuth mount makes it: a vote on the position differences for each trial angle, from -45 to 45 degrees in steps of 0.5. The rotated fit is kept if it matches more stars with a small residual.
- A 180° rotation, from a meridian flip or a camera put back the other way round. The angle of the last frame found rotated is tried first for the next ones, since a series shares it.
- Any angle, as when a camera was turned in its adapter between two nights (82 degrees on one test set). The triangles of each star and its nearest neighbours are matched by their shape, which a rotation, a shift or a change of scale does not alter.[2][3][4] Every transform the triangles propose is scored on the stars it brings within 2 px of a reference star, and the best one starts the fit. The triangles come from the 50 brightest stars, then from 150 and 300 while no fit stands. The frame is accepted on the same share of matched stars and the same residual as a 180° rotation.
- Phase correlation, when the stars give no clear vote (a dense field): the shift is read from the images themselves, reduced four times, with the sky taken off, the brightest stars clipped and a Hann window; it is accepted when the peak is at least 0.1. The polynomial is then fitted as before.[5]
- A sparse field, when the median frame holds fewer than 100 stars: the triangle matching alone, with a similarity (rotation, scale, shift: four unknowns, since a polynomial would follow the noise of so few stars) fitted by least squares.[6] It must match at least Min pairs stars, with a residual under 1 px and a scale within 5 % of 1. The log says how many frames were aligned this way.
A frame matched on fewer star pairs than Min pairs is left out. So is a frame whose residual is far above the others: more than 8 times the median, and at least 2.5 px, which marks a wrong match and not a softer frame. The log gives, for up to 30 frames left out, the reason: no stars (a dark or a covered frame), too few stars to match, too few star pairs with the reference, or a residual too large.
7Several sessions
When a project holds several sessions, each is calibrated with its own master frames. A joining step then puts their calibrated frames, one session after the other, into one set on a single intensity scale (the lowest of the sessions), and the Registration block reads this set as it reads one session. All the frames, from all the sessions, are therefore aligned on one reference frame and stacked together.
The sessions must share the sensor: the same width, height and mosaic, or the join stops with an error. The saturation level of the joined set is, at each pixel, the lowest of the sessions’. The sessions’ own results stay as they are. The join needs at least two sessions.
8Settings
| Setting | Value | Range | What it does |
|---|---|---|---|
| Detection threshold | 8 σ | 3 – 50 | Minimum significance of the stars used for alignment. Lower it (5) for very short or very faint frames with few stars; raise it in dense Milky Way fields to keep only clean stars. |
| Stars per frame | 2500 | 100 – 20,000 | Brightest stars kept per frame for matching and for the polynomial. |
| Min pairs | 10 | 3 – 200 | Fewest star pairs a frame must match with the reference to be kept. Lower it for very sparse fields; raise it to be stricter. |
| Align frames | on | on, off | Off when the block is cut: the frames are taken as already aligned and each stays where it is. The stars are still measured, to weigh and select the frames. |
| Parallel workers | automatic | 1 – 64 | CPU processes used to detect stars. The automatic value is the number of cores minus two, at most 12. |
With Align frames off, each frame gets the identity map. Its residual and transparency are still computed, with its stars matched to the reference’s within 3 px, and the transparency is set to 1 when fewer than 5 stars match.
9Limits, and what was tried
- Too few stars stops the block. If the median frame holds fewer stars than Min pairs, the block stops and advises lowering the detection threshold or checking the focus and the exposure.
- Sparse fields get a similarity, not a polynomial. With few stars, a rotation, a scale and a shift are all the data support; the distortion terms are zero. The search for a rotation does not include a mirror image.
- A rotation is searched only when the shift fails. A frame within 45 degrees of the reference that the shift or the rotation search aligns, or leaves out, is not given to the any-angle search, so that its fate does not change.
- Chance pairs in a dense field. On one test set of 1800 stars a frame, 330 chance pairs at 6.5 px beat 138 true ones at 0.3 px. The rotated fit is therefore kept only if it matches more stars with a small residual, and the residual check of section 6 was added.
- Moffat measures can be missing. With fewer than 10 isolated, unsaturated stars in a frame, its Moffat star size has no value; the filters then do not judge that frame on it.
References
- Moffat, A. F. J. 1969, A Theoretical Investigation of Focal Stellar Images in the Photographic Emulsion and Application to Photographic Photometry, A&A 3, 455. ADS 1969A&A.....3..455M
- Valdes, F. et al. 1995, FOCAS Automatic Catalog Matching Algorithms, PASP 107, 1119. doi:10.1086/133667
- Groth, E. J. 1986, A pattern-matching algorithm for two-dimensional coordinate lists, AJ 91, 1244. doi:10.1086/114099
- Beroiz, M., Cabral, J. B. & Sanchez, B. 2020, Astroalign: A Python module for astronomical image registration, Astronomy and Computing 32, 100384. arXiv:1909.02946
- Kuglin, C. D. & Hines, D. C. 1975, The phase correlation image alignment method, IEEE Conference on Cybernetics and Society.
- Umeyama, S. 1991, Least-squares estimation of transformation parameters between two point patterns, IEEE Transactions on Pattern Analysis and Machine Intelligence 13, 376. doi:10.1109/34.88573