Skip to content

SolveResult

SolveResult

Result of a successful plate-solve.

Returned by SolverDatabase.solve_from_centroids on a successful match. Contains the camera attitude, matched stars, and error statistics. Supports pickle serialization.

rotation_matrix_icrs_to_camera property

3x3 rotation matrix from ICRS to camera frame.

quaternion property

Attitude quaternion as a 4-element [w, x, y, z] array.

Convention. Hamilton, scalar first: q = w + x·i + y·j + z·k with w² + x² + y² + z² = 1. This matches scipy.spatial. transform.Rotation.as_quat(scalar_first=True) and is the usual convention in aerospace / attitude literature. It does not match scipy's default (scalar-last) ordering.

Sense. Rotates a vector from the ICRS frame into the camera frame: camera_vec = q ⊗ icrs_vec ⊗ q*. Equivalently, rotation_matrix_icrs_to_camera @ icrs_vec == camera_vec.

Suitable for feeding back as attitude_hint on the next frame's solve_from_centroids call (tracking mode).

ra_deg property

Right ascension of the boresight in degrees [0, 360).

dec_deg property

Declination of the boresight in degrees [-90, 90].

roll_deg property

Roll angle: position angle of camera +Y measured East of North, in degrees.

fov_deg property

Solved horizontal field of view in degrees.

num_matches property

Number of matched star pairs.

rmse_arcsec property

Root mean square error of matched stars in arcseconds.

p90e_arcsec property

90th percentile error in arcseconds.

max_err_arcsec property

Maximum match error in arcseconds.

probability property

False-positive probability (lower is better).

solve_time_ms property

Time taken to solve in milliseconds.

matched_centroids property

Indices of matched centroids in the input array.

matched_catalog_ids property

Catalog IDs of matched stars (negative IDs = Hipparcos gap-fill stars).

status property

Always 'match_found' when a result is returned.

parity_flip property

Whether the image x-axis was flipped to achieve a proper rotation.

When True, the rotation matrix assumes negated x-coordinates. Pixel-to-sky and sky-to-pixel conversions must account for this.

distortion property

The distortion model used during solving, if any.

Returns a RadialDistortion or PolynomialDistortion instance, or None if no distortion was applied.

cd_matrix property

WCS CD matrix as a 2x2 numpy array (tangent-plane radians per pixel).

Maps pixel offsets from CRPIX to gnomonic tangent-plane coordinates at CRVAL.

theta_deg property

Fitted rotation angle in degrees (camera roll in tangent plane).

The angle from the tangent-plane ξ (East) axis to the camera +X axis, measured counter-clockwise. When parity_flip is True, "camera +X" means the x-negated (mirror-corrected) axis — the same frame the quaternion rotates into.

crval_ra_deg property

WCS reference point RA in degrees.

The tangent point of the gnomonic (TAN) projection, close to the boresight.

crval_dec_deg property

WCS reference point Dec in degrees.

crpix property

Optical center offset from the geometric image center, in pixels [x, y].

__bool__()

Always True — lets if result: distinguish success from a (falsy) SolveFailure.

pixel_to_world(x, y)

pixel_to_world(x: float, y: float) -> tuple[float, float]
pixel_to_world(x: npt.NDArray[np.float64], y: npt.NDArray[np.float64]) -> tuple[npt.NDArray[np.float64], npt.NDArray[np.float64]]

Convert centered pixel coordinates to world coordinates (RA, Dec in degrees).

Pixel coordinates use the same convention as solver centroids: origin at the image center, +X right, +Y down.

Parameters:

Name Type Description Default
x Union[float, NDArray[float64]]

X pixel coordinate(s). Scalar or 1D numpy array.

required
y Union[float, NDArray[float64]]

Y pixel coordinate(s). Scalar or 1D numpy array.

required

Returns:

Type Description
(ra_deg, dec_deg)

Tuple of RA and Dec in degrees. Scalars if input is scalar, numpy arrays if input is array. Array elements are NaN where the transform is undefined. Returns None for scalar input if the point is degenerate.

world_to_pixel(ra_deg, dec_deg)

world_to_pixel(ra_deg: float, dec_deg: float) -> Optional[tuple[float, float]]
world_to_pixel(ra_deg: npt.NDArray[np.float64], dec_deg: npt.NDArray[np.float64]) -> tuple[npt.NDArray[np.float64], npt.NDArray[np.float64]]

Convert world coordinates (RA, Dec in degrees) to centered pixel coordinates.

Returns pixel coordinates in the same convention as solver centroids: origin at the image center, +X right, +Y down.

Parameters:

Name Type Description Default
ra_deg Union[float, NDArray[float64]]

Right ascension in degrees. Scalar or 1D numpy array.

required
dec_deg Union[float, NDArray[float64]]

Declination in degrees. Scalar or 1D numpy array.

required

Returns:

Type Description
(x, y)

Tuple of pixel coordinates. Scalars if input is scalar, numpy arrays if input is array. Array elements are NaN for points behind the camera. Returns None for scalar input if the point is behind the camera.