Stereographic projection

Up to the release jul23, the GILDAS implementation was:

$\displaystyle z$ $\displaystyle =$ $\displaystyle \sin\delta\cos\delta_0 - \cos\delta\sin\delta_0\cos(\alpha-\alpha_0)$ (3)
$\displaystyle \theta$ $\displaystyle =$ $\displaystyle \cos^{-1} ( (\sin\delta - z \cos\delta_0)/\sin\delta_0 )$ (4)
$\displaystyle r$ $\displaystyle =$ $\displaystyle \tan \frac{\theta}{2}$ (5)
$\displaystyle x$ $\displaystyle =$ $\displaystyle r \sin p$ (6)
$\displaystyle y$ $\displaystyle =$ $\displaystyle r \cos p$ (7)

where $(\alpha ,\delta )$ are the celestial coordinates and $(x,y)$ the projection plane coordinates. $z$ is an intermediate quantity. $r$ is the distance from the reference point in the projection plane, and $p$ the inclination angle (not detailed here). After a few computations one can show that the $\theta$ angle is compatible with the AIPS definition (AIPS memo 46 Eq. 3):

$\displaystyle \cos\theta = \sin\delta\sin\delta_0 + \cos\delta\cos\delta_0\cos\Delta\alpha$ (8)

But, on the other hand, the coordinate modulus in the AIPS convention is (AIPS memo 46 section 2.1.2):

$\displaystyle r_\mathrm{AIPS} = 2\frac{\sin\theta}{1+\cos\theta}$ (9)

which can be written as

$\displaystyle r_\mathrm{AIPS} = 2 \tan\frac{\theta}{2}$ (10)

thanks to traditional trigonometric identities 6, i.e. twice the $r$ modulus used in GILDAS. In other words, the spatial scaling in the GILDAS and AIPS conventions differ by a factor 2. Of these two definitions, the GILDAS convention was the unsatisfying one because angles from the reference point are projected as twice less distance on the projection plane ( $\tan (\theta/2) \simeq \theta/2$ for small angles, i.e. $r
\simeq \theta/2$ for the GILDAS definition, while one would prefer $r
\simeq \theta$ for correct distance measurement in the projected plane). This has been considered as a bug in the implementation and this was fixed with the appropriate factor in the aug23 GILDAS release. Doing so, the stereographic projection implementation in GILDAS is now fully compatible with the AIPS one, and thus to the CG02 one.