The image-solver Command
Reference for the image-solver binary. Build it with the cli
feature:
cargo install --path celestial-solver --features cli
Usage
image-solver [OPTIONS] --image <IMAGE> --catalog <CATALOG>
| Flag | Meaning |
|---|---|
-i, --image PATH | The image to solve, FITS or XISF. Required. |
-c, --catalog PATH | The catalog file. Required. See The Star Catalog. |
-o, --output PATH | Write a copy of the image with the solution in its header. The extension picks the format: .fits, .fit, .fts or .xisf. |
--focal-length MM | Use this focal length instead of the FOCALLEN header. |
--pixel-size UM | Use this pixel size instead of the XPIXSZ header. |
--max-stars N | The most image stars to build quads from. Default 100. |
--debug DIR | Write detections.png and solve.png to DIR, creating it if needed. |
--verbose | Log each stage of the solve to standard error. |
-h, --help | Print the flags. |
The image must carry a position hint, an observation time and a plate scale, or the flags above must supply the plate scale. Hints and Image Metadata lists the header keywords read for each.
An --output path with another extension is rejected before the solve
starts. The output directory is created if it doesn’t exist.
Output streams and exit status
The solution report goes to standard output. Timings, --verbose logs,
wrote PATH after --output, and errors go to standard error.
The exit status is 0 when the image solved and 1 when it didn’t. A failure
prints one line that starts with Error:. When Solving
Fails explains each message.
RUST_LOG overrides the log level, for example RUST_LOG=info for the
stage timings without the debug lines.
The report
The report for the M106 frame is on Solve Your First Image. Its lines, in order:
| Line | Meaning |
|---|---|
| Creation time | When the report was made, UTC. |
| Creation software | The solver version. |
| Reference catalog | The catalog library version. |
| Linear transformation matrix | The linear part of the solution: tangent-plane offsets in degrees from report pixel coordinates. The third column is the offset of report pixel (0, 0). |
| Projection | Gnomonic (TAN-SIP) with distortion terms, Gnomonic (TAN) without. |
| Projection origin | The reference pixel, in report pixel coordinates, and its sky position. |
| Resolution | Plate scale in arcseconds per pixel. “Linear approximation” marks a solution with distortion terms, where the scale varies across the field. |
| Rotation | Angle from image up to north, in degrees, positive clockwise. (flipped) marks a mirrored image. |
| Reference system | Always ICRS. |
| Observation start time | The time the solve used, from MJD-OBS or DATE-OBS. |
| Geodetic coordinates | The observing site, when the header gives one. |
| Focal distance | The focal length the fitted scale implies for the header’s pixel size. Present when the pixel size is known. |
| Pixel size | The pixel size used, in microns. |
| Field of view | Width x height of the frame on the sky. |
| Image dimensions | Width x height in pixels. |
| Image center, Image bounds | Sky positions of the center and the four outer corners. ex and ey are the mean residual, in pixels, of the five fitted stars nearest that point. |
| SIP distortion order | The order of the distortion polynomials, followed by their coefficients. Present only when distortion terms were fitted. |
| Control points | The number of stars in the final fit. |
| Linear RMS | The RMS residual of the linear fit alone. |
| SIP RMS | The RMS residual with the distortion terms. |
| Weighted SIP RMS | The same, with each star weighted by the precision of its centroid. |
| Improvement | How much the distortion terms reduced the RMS. |
Without distortion terms, the last four lines are replaced by
RMS error and Weighted RMS.
Pixel coordinates
The report, the FITS header and the library put the first pixel at different coordinates:
| Where | Center of the first pixel |
|---|---|
| The report | (0.5, 0.5): the outer corner of the first pixel is (0, 0) |
The FITS header (CRPIX1, CRPIX2) | (1, 1) |
SolveResult::pixel_to_sky and sky_to_pixel | (0, 0) |
The M106 report puts the projection origin at (1164.5, 880.5). The same
point is CRPIX (1165, 881) in the FITS header and (1164, 880) in the
library.
What --output writes
The output is a copy of the input with its old WCS keywords removed and the new solution added:
CTYPE1/CTYPE2(RA---TAN-SIPandDEC--TAN-SIPwith distortion terms,RA---TANandDEC--TANwithout),CUNIT1/CUNIT2,CRPIX1/CRPIX2,CRVAL1/CRVAL2, theCD1_1toCD2_2matrix andLATPOLE.- With distortion terms,
A_ORDER,B_ORDERand theA_p_qandB_p_qcoefficients, plus the inverseAP_ORDER,BP_ORDER,AP_p_qandBP_p_qcoefficients for mapping sky to pixel. RADESYS = 'ICRS'.
Other keywords, including EQUINOX and EPOCH, are kept. An XISF output
also gets the solution as PCL:AstrometricSolution properties, with a
spline fitted through the matched stars, when there are at least 5 of
them.
Debug images
--debug DIR writes two PNG files, with the image stretched so faint
stars show:
detections.pngcircles every detected star: green when it was matched to a catalog star, amber when it wasn’t.solve.pngmarks each matched catalog star with a cyan cross, and draws a magenta line from the detected star along its residual, stretched 20 times. The residuals are those of the linear fit.