FITS formalism

The AIPS Memos 271 and 462 introduced a number of projections and the equations to convert between the 2D projection plane coordinates and 3D spherical celestial coordinates. The Calabretta & Greisen 2002 paper3 (hereafter CG02) extended the AIPS conventions and introduced a fully generic formalism to describe many kind of projections in the FITS file headers. Given the parameters reproduced in the table 1, the CG02 general idea, as described in their section 2, going from the projected plane to the celestial sphere consists in 3 major steps:

Definition:
the 2D projected plane is defined as a regular coordinate system with a reference point $(x_0,y_0)$ located at $(0,0)$ by design. Its extents might be finite or infinite depending on the projection kind.
Unprojection:
one converts from the $(x,y)$ projected coordinates to the unprojected native spherical coordinate: $(x,y)$ are converted to $(\phi ,\theta )$. Unprojection obviously depends on the projection kind and parameters. The native sphere is defined such as the reference point $(x_0,y_0)$ transforms to the sphere fiducial point $(\phi _0,\theta _0)$. This point is typically either on the Equator (coordinates $(0,0)$ for e.g. cylindrical projections) or located on a pole (coordinates $(0,\pm90^\circ)$ for e.g. zenithal projections); this is an intrinsic property of the projection kind.
Euler rotation:
then one rotates the native coordinates $(\phi ,\theta )$ to celestial coordinates $(\alpha ,\delta )$ by an Euler rotation of the native sphere. The Euler angles are defined thanks to $(\phi _0,\theta _0)$ matching $(\alpha_0,\delta_0)$, plus a possible inclination angle.


Table 1: CG02 coordinate definitions (from their Table 1).
$(x,y)$ Projection plane coordinates
$(\phi ,\theta )$ Native longitude and latitude
$(\alpha ,\delta )$ Celestial longitude and latitude
$(x_0,y_0)$ Projection plane coordinates of the fiducial point
$(\phi _0,\theta _0)$ Native longitude and latitude of the fiducial point
$(\alpha_0,\delta_0)$ Celestial longitude and latitude of the fiducial point (CRVALia)
$(\phi_p,\theta_p)$ Native longitude and latitude of the celestial pole (LONPOLEa)
$(\alpha_p,\delta_p)$ Celestial longitude and latitude of the native pole

Figure 1: Visual representation of the CG02 formalism. In all the plots, the grey region and the star marker are at the same position on sky. Top left: the grey region symbolizes a $20 \times 12$ square degrees in the $(x,y)$ 2D projected plane. Blue lines show the abscissa and ordinate origins. For simplicity the region is centered on the reference point, but it could be anywhere allowed in the plane. Top right: the same area is unprojected to $(\phi ,\theta )$ spherical coordinates on the 3D native sphere (the unprojection kind chosen for this example is not detailed here). The equator and zero reference meridian are shown in green. In this example, the fiducial point $(\phi _0,\theta _0)$ has coordinates $(0,0)$. Bottom left: the whole sky orientation is kept the same as before, but the coordinate system represented is now the 3D celestial sphere, with arbitrary reference point and inclination angle for the example. The equator and zero reference meridian are shown in red. Bottom right: Same as previous plot but the celestial sphere is rotated and displayed with its origin of coordinates in front. In this process, the coordinates have to be Euler-rotated from $(\phi ,\theta )$ to $(\alpha ,\delta )$ to be expressed in this new system.
\includegraphics[width=0.9\textwidth]{greg-projections-formalism}

The Figure 1 offers a visual representation of these transformations. The opposite conversion (from absolute celestial coordinates to projected plane offsets) is done by reverting these operations.