StarAberrationDiagnostics

PixInsight update repository for the StarAberrationDiagnostics script.

This page is informational. For PixInsight, use the repository URL shown below.

Repository URL for PixInsight

https://tricx.de/pi-scripts/StarAberrationDiagnostics/

Installation in PixInsight

  1. Resources > Updates > Manage Repositories
  2. Add repository: https://tricx.de/pi-scripts/StarAberrationDiagnostics/
  3. Run Check for Updates
  4. Run via Script > Tricx > StarAberrationDiagnostics

What it does

Diagnoses the optical system from the shapes of the stars across the field:

Screenshot

StarAberrationDiagnostics dialog with the vector map preview

Handbook: how the diagnostics work

The chapters below explain every computation of the script: what each error does to the stars, and how the script captures it mathematically. They build on each other, but each can be read on its own.

  1. Stars as a probe of the optics
  2. Finding and measuring the stars
  3. Describing the shape of a star
  4. Tracking and guiding errors
  5. The vector map, streamlines and heatmap
  6. Focus, sensor tilt and field curvature
  7. Radial and tangential patterns: corrector spacing
  8. Coma and collimation
  9. The assessment and the order of corrections
  10. Series: before and after the meridian flip
  11. Plate-solve distortion (SIP)
  12. The AI review
  13. Limits and good practice

1.Stars as a probe of the optics

A star is so far away that it is, for all practical purposes, a point. Everything that turns this point into a small disk, an oval or a little comet on the sensor is done on the way: by the atmosphere, the mount, the telescope, a corrector, the camera. The picture a point source makes is called the point spread function (PSF). Because every star in the frame passes through a different part of the optical system, the stars together form a map of how well the optics work at every position of the field.

The script reads this map. For every star it measures four things:

No single star tells much: seeing, noise and neighboring stars disturb each measurement. The strength of the method lies in the pattern over hundreds of stars. A focusing error, a tilted sensor, a wrong corrector distance, a decollimated mirror and a tracking error each leave a pattern of their own, and the chapters below explain which one - and how the script tells them apart.

position across the star (px)brightnessbackground Bpeak: B + Aamplitude AFWHM = 2.3548 σhalf of A
Figure 1 - A cut through a star: the brightness per pixel (bars) and the fitted model (curve). The FWHM is the width at half the height above the background.

2.Finding and measuring the stars

Debayering raw color frames

A color camera records a Bayer mosaic: each pixel sees only red, green or blue. An unprocessed mosaic cannot be measured directly - the color pattern would look like structure in every star. The usual debayer methods fill in the missing colors by interpolation, which softens every star a little and in a direction-dependent way. That would falsify exactly what the script measures.

The script therefore uses the SuperPixel method: each 2×2 block (one red, two green, one blue pixel) becomes one color pixel, without any interpolation. The image has half the resolution, and every length converted to micrometers uses the effective pixel pitch of twice the physical pitch.

RGRGGBGBRGRGGBGBSuperPixelno interpolationone RGB pixel per 2×2 block:half resolution, effective pitch 2p
Figure 2 - SuperPixel debayering: each 2×2 block of the mosaic becomes one pixel.

Detection

PixInsight's StarDetector finds the candidates. If the option Max. stars is set, only the brightest ones are kept (sorted by flux) - they give the most reliable fits, and the fit is the slow part.

The PSF fit

For every candidate, PixInsight's DynamicPSF fits an elliptical model to the pixels inside a search box (the search radius). Two models are available. In the coordinates u, v along the axes of the ellipse (rotated by the angle θ) they read:

Gaussian:   I(u, v) = B + A · exp( −u²/(2σx²) − v²/(2σy²) )
Moffat:     I(u, v) = B + A / ( 1 + u²/αx² + v²/αy² )β
B background, A amplitude, σ or α the width along each axis, β the steepness of the Moffat wings

The Moffat profile has broader wings than the Gaussian and describes real stars (seeing, diffraction) often better; the Gaussian is faster. From the widths the script computes the FWHM along each axis:

Gaussian:   FWHM = 2 √(2 ln 2) · σ ≈ 2.3548 · σ
Moffat:     FWHM = 2 α · √(21/β − 1)

Using the Gaussian factor for a Moffat fit would be a serious mistake: depending on β it would inflate the FWHM by a factor of 1.5 to 2.7 and more.

Quality control

3.Describing the shape of a star

The fitted ellipse has a major half axis a (the larger FWHM) and a minor half axis b, and its major axis points in a direction. Three numbers describe how elongated it is - they carry the same information but behave differently in calculations:

eccentricity   e = √(1 − b²/a²)
ellipticity     ε = 1 − b/a = 1 − √(1 − e²)
distortion      χ = (a² − b²)/(a² + b²) = e²/(2 − e²)
and back: e = √(2χ/(1 + χ))
b/a = 1.0e = 0.00ε = 0.00χ = 0.00b/a = 0.9e = 0.44ε = 0.10χ = 0.10b/a = 0.7e = 0.71ε = 0.30χ = 0.34b/a = 0.5e = 0.87ε = 0.50χ = 0.60eccentricity e (map colors) · ellipticity ε (verdicts) · distortion χ (averaging)
Figure 3 - The three measures for the same stars. The eccentricity rises fast even for slightly oval stars, which makes it sensitive for the colors of the map; the ellipticity reads like a percentage (0.10 = the short axis is 10% shorter); the distortion adds up correctly.

The eccentricity colors the vector map. The ellipticity is used wherever a verdict is spoken, because it is easy to read. The distortion is used for averaging and subtracting: only its components add (approximately) linearly when two elongations combine, e.g. an elongation of the optics and one of the tracking.

Direction and the 180° problem

xyimagecoordinatesa (major half axis)b (minor)ψ0° = right, 90° = down (image coordinates)orientation is defined only modulo 180°
Figure 4 - The fitted ellipse in image coordinates: x to the right, y downward. The angle ψ of the major axis is counted from the x axis; 90° points down.

All directions in the script are given in image coordinates: x to the right, y downward, 0° = right, 90° = down. DynamicPSF measures its angle θ counterclockwise on the screen, so the direction of the major axis in image coordinates is ψ = −θ.

An ellipse looks the same when turned by 180°: its orientation is only defined modulo 180°. Averaging the angles directly therefore fails - two almost horizontal stars at 10° and 170° would average to a vertical 90°. The standard remedy, used everywhere in the script, is the double angle: each orientation becomes a vector with the angle 2ψ, the vectors are averaged, and the angle of the mean is halved again.

naive mean of the angles(10° + 170°) / 2 = 90° ✗double-angle mean20° and 340° → vector mean 0° → half: 0° ✓(cos 2ψ, sin 2ψ) are averaged, then halved
Figure 5 - Averaging orientations: naive (left) and with the double angle (right).
χ1 = χ · cos 2ψ,    χ2 = χ · sin 2ψ
mean orientation = ½ · atan2( Σ w·χ2, Σ w·χ1 )
(χ1, χ2) is the "shape vector" of a star; w an optional weight

4.Tracking and guiding errors

The error

If the mount does not follow the sky exactly - periodic error, poor guiding, wind, cable drag, a flexing guide scope - the whole image moves a little during the exposure. Every star is smeared by the same amount in the same direction, regardless of where it is in the field. This is the fingerprint that separates tracking from all optical errors, which vary across the field.

The measurement

The script takes the median of the shape vectors of all stars. The median ignores the minority of stars that are elongated by the optics near the edge and finds what almost all stars have in common:

m1 = median(χ1),   m2 = median(χ2)
χT = √(m1² + m2²),   direction = ½ · atan2(m2, m1)
χT is converted back into an ellipticity for the report

With the option Subtract it from all stars, this common part is removed from each star before all further analysis - by subtracting the vectors, which is exactly why the distortion χ is used:

χ′1 = χ1 − m1,   χ′2 = χ2 − m2
every star shares one elongationsubtraction in the (χ₁, χ₂) planeχ₁χ₂startracking (median)star − tracking =what the optics did
Figure 6 - Left: a tracking error elongates every star alike. Right: removing it is a vector subtraction in the plane of the shape vectors.

Only the shapes are corrected; the star sizes (FWHM) stay as measured. The tracking error would otherwise mask the optical patterns, above all the radial/tangential pattern of chapter 7.

Reading the value

Common ellipticityVerdict
below 0.03OK - tracking is clean
0.03 - 0.07Note
above 0.07Action: check guiding (RMS, calibration), balance, cable drag, wind, flexure

A direction that stays the same over several frames points to the mount; one that changes points to wind or random guiding errors. The series analysis compares both sides of a meridian flip, where the balance changes.

5.The vector map, streamlines and heatmap

The vector map draws every star as an ellipse at its position, its length and color given by the eccentricity (blue round to red elongated), its direction by ψ. Hundreds of small ellipses are hard to read, so two layers show the large-scale trend.

Streamlines

At any point of the image, the script computes a smoothed orientation from the stars around it: a Gaussian-weighted double-angle mean within a radius R (a percentage of the image diagonal). Nearly round stars have a poorly defined direction, so each star is weighted additionally by the square of its eccentricity:

w = exp( −d² / (2 (R/2)²) ) · e²,    for all stars at a distance d < R
orientation = ½ · atan2( Σ w · sin 2ψ, Σ w · cos 2ψ )

A streamline follows this field in small steps. Since an orientation has no arrowhead, the script chooses at every step the one of the two directions that continues the previous step - otherwise the line could turn back at random. Streamlines show at a glance whether the stars are aligned radially, concentrically or all in one direction.

Orientation heatmap

The heatmap (after the Seti Astro Suite) fits two smooth polynomial surfaces of a chosen degree over the whole image, one to sin 2θ and one to cos 2θ of all stars, with the coordinates normalized to ±1. Three rounds of 3σ clipping remove outliers. At every point the fitted angle θ = ½ · atan2(s, c) is shown as a hue of a color wheel. A plane (degree 1) can only show a steady gradient; degree 2 and more can follow the curved patterns of coma, but becomes more sensitive to noise near the edges where few stars constrain it.

6.Focus, sensor tilt and field curvature

The physics: blur from defocus

The telescope forms a cone of light that converges to a point in the focal plane. If the sensor sits a distance Δz in front of or behind that plane, it cuts the cone and records a small disk instead of a point. From the geometry of the cone (its opening is the aperture D over the focal length f, i.e. 1/N):

optics, aperture Dfocussensorblur dΔzfocal ratio N = f / Dd = Δz / N ⇔ Δz = N · d
Figure 7 - A sensor out of focus by Δz records a disk of diameter d = Δz/N.
d = Δz / N    ⇔    Δz = N · d,    N = f / D
a fast f/4 system reacts twice as strongly to the same Δz as an f/8 one

The star in focus is not a point either (seeing, diffraction, optics): it has a size FWHM0. Blurs of independent origin add approximately in quadrature, so the extra blur from defocus follows from the measured FWHM as

d = √( FWHM² − FWHM0² ) · p,    Δz = N · d
p = (effective) pixel pitch, converting pixels into micrometers

This is the bridge from a star size in pixels to a distance in micrometers - and it needs pixel pitch, focal length and aperture, which the script takes from the dialog or the FITS header (XPIXSZ, FOCALLEN, APTDIA or FOCRATIO).

The sign is lost. A disk looks the same whether the sensor is in front of or behind the focus. From one frame, Δz is only a magnitude - which way to turn a tilt screw has to be found by trying (see figure 11).

What the errors look like

sensor tiltfield curvaturefocal planesensorbehind focussharpin frontfocal surfaceflat sensorsharp center,soft edge
Figure 8 - Left: a tilted sensor is in focus along one line and out of focus toward both edges, in opposite directions. Right: a curved focal surface meets a flat sensor only in the center; the stars grow toward every edge alike.

Method 1: Siril-style quadrants

Following Siril's "Show tilt", the frame is divided into four quadrants plus an inner circle and an outer ring around the center (radii relative to the half diagonal R). Each area gets the 25%-trimmed mean of the star sizes (FWHMx+FWHMy)/2 - the lowest and highest quarter are discarded before averaging, which makes it robust against single bad fits.

m₁ TLm₂ TRm₃ BLm₄ BRinnerouter: r > 0.75 RR = half diagonaleach value: 25%-trimmed mean of the star FWHMs in that area
Figure 9 - The areas of the quadrant evaluation.
tilt = max(m1…m4) − min(m1…m4),   in % of their mean
off-axis aberration = mouter − minner

The 11×11 FWHM grid is the same idea at a finer scale: one trimmed mean per cell, noisier but with more detail. The tilt axis is derived from the quadrants. Each quadrant's excess over the center gets a sign, the gradient of a plane through the four values gives the direction of the steepest rise, and with the optics known, its angle:

eq = sign(Fq² − F0²) · √|Fq² − F0²|,   F0 = minner
gx = [(eTR + eBR) − (eTL + eBL)] / W,   gy = [(eBL + eBR) − (eTL + eTR)] / H
axis direction = atan2(gy, gx) (mod 180°),   tilt angle = atan( N · √(gx² + gy²) )

Per quadrant, the console also lists the defocus Δz = N · √(Fq² − F0²) · p and the angle atan(Δz / distance) to the quadrant center at a quarter of the width and height.

Method 2: the FWHM² surface

Quadrants mix tilt and curvature: a curved field makes all four quadrants soft, a tilt only two. The script therefore fits a smooth surface to the squared FWHM of every star, with X and Y the position relative to the center divided by the half diagonal:

FWHM² = c0 + c1·X + c2·Y + c3·(X² + Y²)
X (−1 … +1 of the half diagonal)FWHM²c₀ = FWHM² at the centerc₃·(X²+Y²): the same on all sides → curvature+ c₁·X + c₂·Y: one side higher → tilt
Figure 10 - A cut through the surface along X. The symmetric term c₃ is the curvature (dashed); the linear terms c₁, c₂ tilt the bowl to one side (solid), which is the sensor tilt.

The squares are fitted because blurs add in quadrature (see above): the symmetric term then measures the curvature, the linear terms the tilt, and the two no longer contaminate each other. The fit is a robust least squares fit: four rounds in which stars whose residual exceeds 3 σ (σ from the median absolute residual) are left out. From the coefficients:

FWHMcenter = √c0,   FWHMedge = √(c0 + c3)
G = √(c1² + c2²),   softer side toward atan2(c2, c1)
FWHMsoft side = √(c0 + G),   FWHMsharp side = √(c0 − G)
Δzedge = N · √G · p,   tilt angle = atan( Δzedge / (R · p) )
curvature sag = N · √|c3| · p
sharpest point = center − (c1, c2) / (2 c3) · R   (if c3 > 0)

A negative c3 means the edge is sharper than the center - the frame is out of focus or was focused on the edge. The script also flags a defocus suspicion when the median FWHM in the inner third (r < ⅓ R) is more than 5% larger than in the outer third (r > ⅔ R). As long as that is the case, tilt and spacing verdicts are unreliable, which is why focus comes first in the suggested order.

The 3D tilt plot

best focusvariant 1variant 2the same blur at both edges — the sign of Δz is unknown from one frame
Figure 11 - Two tilts in opposite directions produce the same blur. The 3D plot therefore draws both planes.

The pseudo-3D plot places the four quadrant values at their physical positions on the sensor (in mm) as signed Δz and fits a plane through the center. Because the sign of Δz is unknown (see the note above), it draws two mirror-image variants. Both are equally plausible; the tilt axis is the same for both.

Verdicts

ValueOKNoteAction
Tilt: (FWHMsoft − FWHMsharp) / their mean< 5%5 - 10%> 10%
Field curvature: (FWHMedge − FWHMcenter) / FWHMcenter≤ 15%15 - 30%> 30%
Focus: defocus suspicion or c3 < 0refocus first

7.Radial and tangential patterns: corrector spacing

The error

A coma corrector, field flattener or reducer is designed for one exact distance to the sensor (the back focus, e.g. 55 mm). At the wrong distance it corrects too little or too much, and the stars at the field edge become elongated - either radially, pointing toward the center like spokes, or tangentially, lying along circles around the center. In an uncorrected system (a bare Newtonian), radial elongation is simply its natural coma.

radial (eps_rad > 0)under-correctedtangential (eps_rad < 0)over-corrected / curvature
Figure 12 - Radial (left) and tangential (right) elongation at the field edge.

The measurement

For each star at the position angle φ (seen from the image center), the script measures how much of its elongation lies along the radius:

image centerradial direction φmajor axis ψeps_rad = ε · cos 2(ψ − φ)+ε: along the radius · −ε: across it · 0: at 45°
Figure 13 - The radial component of a star's ellipticity.
eps_rad = ε · cos 2(ψ − φ)
+ε for a star along the radius, −ε across it, 0 at 45° - tracking errors cancel out over a full ring

The stars are grouped into six rings (r/R = 0-⅙, ⅙-⅓, … 5/6-1). Per ring the console lists the number of stars, median FWHM, ellipticity, eps_rad, the radial flare direction asym_rad (chapter 8) and an alignment value between flare and elongation (+1: the flare lies along the elongation, i.e. coma shapes the star). The verdict uses the median eps_rad over the outer third (r > ⅔ R), with at least 10 stars:

eps_rad (outer third)PatternRule of thumb of the script
|eps_rad| ≤ 0.04noneOK
> +0.04 (action above 0.08)radialwith a corrector: under-corrected - increase the corrector-sensor distance in small steps (e.g. 0.5 mm); uncorrected system: normal coma
< −0.04 (action below −0.08)tangentialdecrease the distance - but defocus combined with field curvature looks the same, so check the focus first

The direction of the correction is a rule of thumb that holds for many correctors; the manual of your corrector has the final word. Change the distance in small steps and measure again.

8.Coma and collimation

The error

Coma turns stars into small comets: a bright core with a fan of light on one side. In a Newtonian it grows linearly with the distance from the optical axis and points away from it; a coma corrector removes it - or over-corrects it, when it sits at the wrong distance. The point where the coma vanishes marks the optical axis. If the mirrors are decollimated (or a corrector is decentered or tilted), this coma-free point moves away from the image center.

Why the fit cannot see it

Gaussian and Moffat are point-symmetric models: they fit an ellipse around the core and cannot tell on which side the fan sits. The script measures the asymmetry directly on the pixels instead, relative to the fitted center:

fit center (symmetric model)centroid offsetthird moment m₃ (weights the flare)Gaussian and Moffat arepoint-symmetric: they cannottell on which side the flare is.The pixels can:m₃ = Σ w·ρ²·ρ / Σ wρ = distance / σ
Figure 14 - A comatic star. The flux centroid lies off the fit center toward the flare; the third moment weights the outer light and shows it more clearly.
centroid offset = Σ w · d / Σ w
third moment   m3 = Σ w · ρ² · ρ / Σ w,   ρ = d / σ
d = pixel position relative to the fit center; ρ makes m3 independent of the star size

The coma field

Third-order coma is linear in the field position. Around the coma-free point P0, the asymmetry vector of a star at position P is therefore modeled as

m3(P) = k · (P − P0) / R
linear in (k, ox, oy):  m3,x = k·X + ox,  m3,y = k·Y + oy
P0 = center − (ox, oy) / k · R
under-corrected: k > 0over-corrected: k < 0arrows: flare direction · green ring: coma-free point P₀ · cross: image centerP₀ off center → decollimated (or decentered corrector)
Figure 15 - The coma field. With k > 0 the flares point away from P₀, with k < 0 toward it.

At least 30 stars with a valid asymmetry are needed. The fit is robust (3σ clipping, three rounds). Its uncertainty comes from a bootstrap: the fit is repeated 100 times on random resamples of the stars; the spread of k is its standard deviation, that of P0 a robust spread (MAD), because a few resamples with k ≈ 0 can throw P0 arbitrarily far. The coma counts as significant when |k| > 3 · spread(k). A cross-check fits the same model to the centroid offsets.

Collimation

The script suggests collimating when P0 lies more than 15% of the half diagonal off the center and more than twice its own uncertainty. One caution is built in: an uneven tracking drift adds a constant asymmetry and shifts P0 along the drift. If the offset lies within 20° of the tracking elongation, the suggestion says so - compare several frames before touching the collimation screws.

Coma streamlines

Unlike an orientation, m3 is a true vector with a direction. The coma streamlines follow its Gaussian-smoothed field (at least 8 stars in the radius) with arrowheads, and stop where the field becomes weaker than a set percentage of its strong part - so the coma-free zone does not fake a direction. Under-corrected coma looks like a source, over-corrected coma like a sink.

9.The assessment and the order of corrections

The Assessment tab turns the values of the previous chapters into findings, each judged as OK, Note or Action, with what was found and what to do. Where the direction of a correction depends on the optical system, the Optics type (unknown, uncorrected, with corrector) decides the wording.

The actions are sorted into the order in which they are best worked through, because the errors mask each other:

  1. Focus - a defocused frame falsifies the tilt and spacing verdicts.
  2. Tracking - a common elongation hides the radial/tangential pattern and shifts the coma-free point.
  3. Tilt - a one-sided blur, fixed in the camera connection.
  4. Collimation - moves the optical axis, around which everything else is measured.
  5. Spacing - the corrector distance, judged from the edge pattern.
  6. Coma - strength and sign of the coma field.
  7. Field curvature - what remains at the edge.
  8. Data - fewer than 150 stars make all verdicts uncertain.

All thresholds are starting points, not calibrated limits. Seeing, exposure time and the number of stars change what a single frame can tell.

10.Series: before and after the meridian flip

Why a flip helps

A German equatorial mount has to turn the telescope around when the target crosses the meridian. After this meridian flip, the tube is turned by 180° around its axis relative to gravity. Anything that sags or shifts under its own weight - a focuser drawtube, a camera on a long adapter, a primary mirror in its cell ("mirror flop"), a loose corrector - moves to the other side. Anything fixed in the optical train stays as it is.

before the flip (West)findercameragravityafter the flip (East)findercameragravitythe tube is turned by 180° around its axis: gravity now pulls on the optics from the other side
Figure 16 - Before and after the flip, gravity acts on the optical train from opposite sides.

Comparing frames of both sides therefore answers a question one frame cannot: is an error fixed, or mechanical? A tilt that turns with the side calls for tightening the focuser and the adapters - adjusting the tilt would only fit one side. A tilt that stays calls for the tilt adjustment.

Which side is a frame on?

  1. Manual - set in the list.
  2. PIERSIDE - written by N.I.N.A. and most ASCOM/INDI capture programs (West before the meridian, telescope pointing east; East after the flip).
  3. A camera angle that turns by 180° - e.g. ROTATOR as written by the ASIAIR from its plate solve (also POSANGLE, ANGLE, CROTA2). Frames within 45° of the first angle form one group, those within 45° of the opposite angle the other; the hour angles of their members name the groups.
  4. The hour angle - from the time, the target's right ascension α and the site longitude λ (east positive):
GMST = 280.46061837° + 360.98564736629° · d   (d = days since 2000-01-01 12:00 UT)
hour angle HA = GMST + λ − α
HA ≤ −0.05 h: West (the meridian is not reached yet) · HA ≥ +0.5 h: East · in between: unknown, the flip may come late

The comparison

Every frame is measured with the same settings. Per side and value the script takes the median and a robust spread σ = 1.4826 · MAD, which estimates the standard deviation without being fooled by single outliers. The standard error of a median is about 1.253 σ/√n. A value changes at the flip when both hold:

|medianEast − medianWest| > 3 · 1.253 · √( σW²/nW + σE²/nE )
and the difference exceeds a practical minimum
timemeasured valueflipmedian West ± spreadmedian Eastdifference ≫ 3 standard errors→ changes at the flip
Figure 17 - A value that jumps at the flip: the difference between the medians is large compared to the scatter within each side.
ValuePractical minimumA change at the flip means
FWHM center / edge5%refocusing, temperature or focuser slip
Tilt (as a vector: size and direction)3 pointssag or play in camera, focuser, adapter
Edge elongation eps_rad0.02play in corrector or drawtube, or a different focus
Tracking elongation0.02balance (east/west heavy), DEC backlash, cable drag
Coma k-corrector or spacing with play
Coma-free point (vector)10% of Rmirror flop, loose secondary or corrector
Plate-solve distortion (chapter 11)1 pxa part of the optics shifts - or a solver convention

With fewer than 3 frames on a side, there is no verdict. Vectors (tilt, coma-free point, distortion) are compared as vectors: their direction can turn while their length stays.

Drift over the night

Temperature and altitude change slowly, and the frames of one side follow each other in time - a drift can therefore look like a jump at the flip. The script subtracts each side's median and correlates what remains with the time. With at least 6 frames, a correlation |r| ≥ 0.6 and a total change above the practical minimum, the value is reported as drifting, with a warning where it may have faked a change at the flip. If the focuser position (FOCPOS) differs between the sides, the report notes that the frames were refocused.

11.Plate-solve distortion (SIP)

A plate solve finds where every pixel points in the sky. Real optics do not map the sky perfectly onto a flat grid; the SIP convention (Simple Imaging Polynomial) stores the deviation as polynomials in the pixel coordinates u, v relative to a reference pixel:

u′ = u + Σ Ap,q · up vq,   v′ = v + Σ Bp,q · up vq,   2 ≤ p + q ≤ order
no distortionquadratic terms (e.g. A₂,₀ > 0)x′ = x + A₂,₀u² + A₁,₁uv + A₀,₂v² (y likewise with B)
Figure 18 - Quadratic distortion terms bend the pixel grid.

This measures the positions of the stars - independent of their shapes, and a by-product of every solve. The series analysis reads the six quadratic terms (p + q = 2) from the header. They do not depend on the reference pixel, so they can be compared even when the rest of the solution is missing. The script expresses them as the shift of the four image corners in pixels, and compares these between the sides.

What it can and cannot tell

A reversal of sign at the flip can also come from the solver working in a frame that turns with the sky. To be sure, solve one frame per side with PixInsight's ImageSolver and compare. The terms are compared only when all solutions refer to images of the same size.

12.The AI review

On request, the script sends its results to Claude (Anthropic API) for a second opinion - after a Preview, after a series analysis, or both. What is sent:

No image data other than the optional vector map leaves the computer. The answer is forced into a fixed structure: an overall verdict, the order of corrections and, per finding, the measured values it rests on, what the stars look like, the derivation, the alternatives and why they fit less, what to do, how to check it in the next frame, and a confidence with its reason. Step by step explains every technical term for beginners; Short keeps each point to a sentence or two. Requests and answers can be saved as text files next to the frames.

The AI weighs the same numbers the rules use - it can explain and connect them, but it cannot see more than was measured. It needs an Anthropic API key; each request is billed to it.

13.Limits and good practice