LAL  7.2.0.1-a5e7375
Module CelestialCoordinates.c

## Detailed Description

Converts among Galactic, ecliptic, and equatorial coordinates.

These functions perform the specified coordinate transformation on the contents of input and store the result in *output. The two pointers may point to the same object, in which case the conversion is done in place. The functions will also check input->system and set output->system as appropriate.

These routines are collected together because they involve fixed, absolute coordinate systems, so the transformations require no additional parameters such as the time or site of observation. We also note that there are no direct conversions between Galactic and ecliptic coordinates. At the risk of additional computational overhead, it is simple to use the equatorial coordinate system as an intermediate step.

### Description

These functions perform the specified coordinate transformation on the contents of input and store the result in output. The two pointers may point to the same object, in which case the conversion is done in place. The functions will also check input->system and set output->system as appropriate.

These routines are collected together because they involve fixed, absolute coordinate systems, so the transformations require no additional parameters such as the time or site of observation. We also note that there are no direct conversions between Galactic and ecliptic coordinates. At the risk of additional computational overhead, it is simple to use the equatorial coordinate system as an intermediate step.

### Algorithm

These routines follow the spherical angle relations on p. 13 of [17] . Note that the actual formulae for Galactic longitude and right ascension in this reference are wrong; we give corrected formulae below derived from the sine and cosine equations. (The Galactic to equatorial transformations can also be found in Sec. 12.3 of [2] . All positions are assumed to be in the J2000 epoch.

Galactic coordinates:
The following formulae relate Galactic latitude $$b$$ and longitude $$l$$ to declination $$\delta$$ and right ascension $$\alpha$$:

\begin{eqnarray} b & = & \arcsin[\cos\delta\cos\delta_\mathrm{NGP} \cos(\alpha-\alpha_\mathrm{NGP}) + \sin\delta\sin\delta_\mathrm{NGP}] \;,\\ l & = & \arctan\!2[\sin\delta\cos\delta_\mathrm{NGP} - \cos\delta\cos(\alpha-\alpha_\mathrm{NGP}) \sin\delta_\mathrm{NGP}, \cos\delta\sin(\alpha-\alpha_\mathrm{NGP})]\\ & & \quad + \; l_\mathrm{ascend} \;, \end{eqnarray}

where $$\arctan\!2(y,x)$$ can be thought of as the argument of the complex number $$x+iy$$; unlike $$\arctan(y/x)$$, it ranges over the full range $$[0,2\pi)$$ instead of just half of it. The inverse transformations are:

\begin{eqnarray} \delta & = & \arcsin[\cos b\cos\delta_\mathrm{NGP}\sin(l-l_\mathrm{ascend}) + \sin b\sin\delta_\mathrm{NGP}] \;,\\ \alpha & = & \arctan\!2[\cos b\cos(l-l_\mathrm{ascend}), \sin b\cos\delta_\mathrm{NGP} - \cos b\sin(l-l_\mathrm{ascend})\sin\delta_\mathrm{NGP}] \\ & & \quad + \; \alpha_\mathrm{NGP} \;. \end{eqnarray}

In these equations we have defined the orientation of the Galaxy with the following parameters (which should eventually be placed in LALConstants.h:

$\begin{array}{r@{\quad=\quad}l@{\quad=\quad}l} \alpha_\mathrm{NGP} & 192.8594813^\circ & \mbox{the right ascension (epoch J2000) of the north Galactic pole} \\ \delta_\mathrm{NGP} & 27.1282511^\circ & \mbox{the declination (epoch J2000) of the north Galactic pole} \\ l_\mathrm{ascend} & 33^\circ & \mbox{the longitude of the ascending node of the Galactic plane} \end{array}$

The ascending node of the Galactic plane is defined as the direction along the intersection of the Galactic and equatorial planes where rotation in the positive sense about the Galactic $$z$$ axis carries a point from the southern to northern equatorial hemisphere. That is, if $$\mathbf{u}$$ points in the direction $$\delta=90^\circ$$ (celestial north), and $$\mathbf{v}$$ points in the direction $$b=90^\circ$$ (Galactic north), then $$\mathbf{u} \times \mathbf{v}$$ points along the ascending node.
Ecliptic coordinates:
The following formulae relate Ecliptic latitude $$\beta$$ and longitude $$\lambda$$ to declination $$\delta$$ and right ascension $$\alpha$$:

\begin{eqnarray} \beta & = & \arcsin(\sin\delta\cos\epsilon - \cos\delta\sin\alpha\sin\epsilon) \;, \\ \lambda & = & \arctan\!2(\cos\delta\sin\alpha\cos\epsilon + \sin\delta\sin\epsilon, \cos\delta\cos\alpha) \;. \end{eqnarray}

The inverse transformations are:

\begin{eqnarray} \delta & = & \arcsin(\cos\beta\sin\lambda\sin\epsilon + \sin\beta\cos\epsilon) \;, \\ \alpha & = & \arctan\!2(\cos\beta\sin\lambda\cos\epsilon - \sin\beta\sin\epsilon, \cos\beta\cos\lambda) \;. \end{eqnarray}

Here $$\epsilon$$ is the obliquity (inclination) of the ecliptic plane, which varies over time; at epoch J200 it has a mean value of:

$\epsilon = 23.4392911^\circ \; .$

## Prototypes

void LALGalacticToEquatorial (LALStatus *stat, SkyPosition *output, SkyPosition *input)

void LALEquatorialToGalactic (LALStatus *stat, SkyPosition *output, SkyPosition *input)

void LALEclipticToEquatorial (LALStatus *stat, SkyPosition *output, SkyPosition *input)

void LALEquatorialToEcliptic (LALStatus *stat, SkyPosition *output, SkyPosition *input)

## ◆ LALGalacticToEquatorial()

 void LALGalacticToEquatorial ( LALStatus * stat, SkyPosition * output, SkyPosition * input )
See also
See documentation in Module CelestialCoordinates.c

Definition at line 149 of file CelestialCoordinates.c.

## ◆ LALEquatorialToGalactic()

 void LALEquatorialToGalactic ( LALStatus * stat, SkyPosition * output, SkyPosition * input )
See also
See documentation in Module CelestialCoordinates.c

Definition at line 197 of file CelestialCoordinates.c.

## ◆ LALEclipticToEquatorial()

 void LALEclipticToEquatorial ( LALStatus * stat, SkyPosition * output, SkyPosition * input )
See also
See documentation in Module CelestialCoordinates.c

Definition at line 245 of file CelestialCoordinates.c.

## ◆ LALEquatorialToEcliptic()

 void LALEquatorialToEcliptic ( LALStatus * stat, SkyPosition * output, SkyPosition * input )
See also
See documentation in Module CelestialCoordinates.c

Definition at line 290 of file CelestialCoordinates.c.