TECHNOLOGY

Astropy WCS pixel origin is part of the coordinate transformation

In this article
THE QUICK TAKE

The WCS API documents origin as the image-corner coordinate under FITS/Fortran versus NumPy/C conventions. Choosing it is part of the transformation request, not an optional correction to apply later by eye. Coordinate axis ordering and the WCS header also affect meaning. A pair of inverse operations using the same wrong origin can conceal a systematic mismatch with the actual image index source. Independent reference correspondence is therefore necessary alongside round-trip numerical checks.

A pixel coordinate can use a different origin convention from the astronomical world-coordinate transformation receiving it. Astropy’s low-level WCS interface makes the origin explicit. A scientific vision model can therefore receive systematically shifted sky labels even when forward and inverse calculations appear numerically consistent under the same mistaken convention.

The scientific interface

The WCS API documents origin as the image-corner coordinate under FITS/Fortran versus NumPy/C conventions. Choosing it is part of the transformation request, not an optional correction to apply later by eye. Coordinate axis ordering and the WCS header also affect meaning. A pair of inverse operations using the same wrong origin can conceal a systematic mismatch with the actual image index source. Independent reference correspondence is therefore necessary alongside round-trip numerical checks.

Implementation details

Record the pixel source convention, selected WCS interface, origin and axis mapping with generated labels. Convert between conventions once in a named adapter rather than scattering compensating offsets through preprocessing. Validate known reference pixels against independently specified world coordinates. Keep crop offsets and image transformations separate from the origin convention so they cannot accidentally cancel in one fixture and fail in another. Preserve the relevant header with the image artifact; a successful transformation using an unrelated WCS is not a validated astronomical annotation.

A constructed validation case

Construct a small controlled WCS and independently reviewed pixel-to-world reference points, including a corner and interior locations. Compare intended origin handling with a deliberately mismatched origin, then perform a round trip to demonstrate why that check alone is insufficient. Add a crop transformation with its own explicit offset. Acceptance requires correct external correspondence and preserved conventions, not merely recovery of the starting numbers through inverse functions. Keep exact headers, source indexes and expected positions so future image-model preparation can be checked reproducibly.

Numerical and data limits

Correct origin handling does not establish astrometric calibration or source-detection accuracy. Those require observational validation. It establishes the coordinate contract between image preparation and world labels, preventing an indexing convention from masquerading as systematic bias in a scientific AI model.

Primary references

Astropy world coordinate systems; Astropy WCS pixel origin API.

This is a proposed scientific-interface validation, not an executed Retrivium benchmark. Preserve the implementation version and unresolved outcomes; interface documentation does not establish the accuracy or performance of a scientific model.

OpenEXR crop windows: map a local pixel array back to the full render canvas; A GPU inference benchmark you can trust.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles