Fortran implementation

The stereographic projection is implemented in the file kernel/lib/gwcs/projec.f90, in the p_stereo case of the subroutines abs_to_rel_1dn8 (celestial to projection plane coordinates) and rel_to_abs_1dn8 (projection plane to celestial coordinates). These subroutines work on arrays of coordinates; the other variants of the generic abs_to_rel and rel_to_abs interfaces (scalars, 4-byte sizes) call them. The projection description (center, angle, type, poles positions) is set by the subroutine gwcs_projec.

The implementation does not compute the formulae above literally: it is written in order to remain accurate at the double precision level everywhere on the sphere, including close to the reference point, to its antipode, and to the celestial poles. Note that in the code, the angular distance $\theta$ is named r.



Subsections