00001 /* 00002 * Copyright (C) 2007 Bernd Machenschalk, Jolien Creighton, Reinhard Prix 00003 * 00004 * This program is free software; you can redistribute it and/or modify 00005 * it under the terms of the GNU General Public License as published by 00006 * the Free Software Foundation; either version 2 of the License, or 00007 * (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with with program; see the file COPYING. If not, write to the 00016 * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, 00017 * MA 02111-1307 USA 00018 */ 00019 00020 /************************* <lalVerbatim file="CelestialCoordinatesCV"> 00021 Author: Creighton, T. D. 00022 $Id: CelestialCoordinatesLaldoc.c,v 1.4 2007/06/08 14:41:47 bema Exp $ 00023 **************************************************** </lalVerbatim> */ 00024 00025 /********************************************************** <lalLaTeX> 00026 00027 \subsection{Module \texttt{CelestialCoordinates.c}} 00028 \label{ss:CelestialCoordinates.c} 00029 00030 Converts among Galactic, ecliptic, and equatorial coordinates. 00031 00032 \subsubsection*{Prototypes} 00033 \vspace{0.1in} 00034 \input{CelestialCoordinatesCP} 00035 \idx{LALGalacticToEquatorial()} 00036 \idx{LALEquatorialToGalactic()} 00037 \idx{LALEclipticToEquatorial()} 00038 \idx{LALEquatorialToEcliptic()} 00039 00040 \subsubsection*{Description} 00041 00042 These functions perform the specified coordinate transformation on the 00043 contents of \verb@*input@ and store the result in \verb@*output@. The 00044 two pointers may point to the same object, in which case the 00045 conversion is done in place. The functions will also check 00046 \verb@input->system@ and set \verb@output->system@ as appropriate. 00047 00048 These routines are collected together because they involve fixed, 00049 absolute coordinate systems, so the transformations require no 00050 additional parameters such as the time or site of observation. We 00051 also note that there are no direct conversions between Galactic and 00052 ecliptic coordinates. At the risk of additional computational 00053 overhead, it is simple to use the equatorial coordinate system as an 00054 intermediate step. 00055 00056 \subsubsection*{Algorithm} 00057 00058 These routines follow the spherical angle relations on p.~13 00059 of~\cite{Lang_K:1999}. Note that the actual formulae for Galactic 00060 longitude and right ascension in this reference are wrong; we give 00061 corrected formulae below derived from the sine and cosine equations. 00062 (The Galactic to equatorial transformations can also be found in 00063 Sec.~12.3 of~\cite{GRASP_1.9.8:2000}.) All positions are assumed to 00064 be in the J2000 epoch. 00065 00066 \paragraph{Galactic coordinates:} The following formulae relate 00067 Galactic latitude $b$ and longitude $l$ to declination $\delta$ and 00068 right ascension $\alpha$: 00069 \begin{eqnarray} 00070 \label{eq:b-galactic} 00071 b & = & \arcsin[\cos\delta\cos\delta_\mathrm{NGP} 00072 \cos(\alpha-\alpha_\mathrm{NGP}) + 00073 \sin\delta\sin\delta_\mathrm{NGP}] \;,\\ 00074 l & = & \arctan\!2[\sin\delta\cos\delta_\mathrm{NGP} - 00075 \cos\delta\cos(\alpha-\alpha_\mathrm{NGP}) 00076 \sin\delta_\mathrm{NGP}, 00077 \cos\delta\sin(\alpha-\alpha_\mathrm{NGP})] \nonumber\\ 00078 \label{eq:l-galactic} 00079 & & \quad + \; l_\mathrm{ascend} \;, 00080 \end{eqnarray} 00081 where $\arctan\!2(y,x)$ can be thought of as the argument of the 00082 complex number $x+iy$; unlike $\arctan(y/x)$, it ranges over the full 00083 range $[0,2\pi)$ instead of just half of it. The inverse 00084 transformations are: 00085 \begin{eqnarray} 00086 \label{eq:delta-galactic} 00087 \delta & = & \arcsin[\cos b\cos\delta_\mathrm{NGP}\sin(l-l_\mathrm{ascend}) + 00088 \sin b\sin\delta_\mathrm{NGP}] \;,\\ 00089 \alpha & = & \arctan\!2[\cos b\cos(l-l_\mathrm{ascend}), 00090 \sin b\cos\delta_\mathrm{NGP} - 00091 \cos b\sin(l-l_\mathrm{ascend})\sin\delta_\mathrm{NGP}] 00092 \nonumber\\ 00093 \label{eq:alpha-galactic} 00094 & & \quad + \; \alpha_\mathrm{NGP} \;. 00095 \end{eqnarray} 00096 In these equations we have defined the orientation of the Galaxy with 00097 the following parameters (which should eventually be placed in 00098 \verb@LALConstants.h@): 00099 $$ 00100 \begin{array}{r@{\quad=\quad}l@{\quad=\quad}l} 00101 \alpha_\mathrm{NGP} & 192.8594813^\circ & 00102 \mbox{the right ascension (epoch J2000) of the north Galactic pole} \\ 00103 \delta_\mathrm{NGP} & 27.1282511^\circ & 00104 \mbox{the declination (epoch J2000) of the north Galactic pole} \\ 00105 l_\mathrm{ascend} & 33^\circ & 00106 \mbox{the longitude of the ascending node of the Galactic plane} 00107 \end{array} 00108 $$ 00109 The ascending node of the Galactic plane is defined as the direction 00110 along the intersection of the Galactic and equatorial planes where 00111 rotation in the positive sense about the Galactic $z$ axis carries a 00112 point from the southern to northern equatorial hemisphere. That is, 00113 if \textbf{\textit{u}} points in the direction $\delta=90^\circ$ 00114 (celestial north), and \textbf{\textit{v}} points in the direction 00115 $b=90^\circ$ (Galactic north), then 00116 \textbf{\textit{u}}$\times$\textbf{\textit{v}} points along the 00117 ascending node. 00118 00119 \paragraph{Ecliptic coordinates:} The following formulae relate 00120 Ecliptic latitude $\beta$ and longitude $\lambda$ to declination 00121 $\delta$ and right ascension $\alpha$: 00122 \begin{eqnarray} 00123 \label{eq:beta-ecliptic} 00124 \beta & = & \arcsin(\sin\delta\cos\epsilon - 00125 \cos\delta\sin\alpha\sin\epsilon) \;, \\ 00126 \label{eq:l-ecliptic} 00127 \lambda & = & \arctan\!2(\cos\delta\sin\alpha\cos\epsilon + 00128 \sin\delta\sin\epsilon, \cos\delta\cos\alpha) \;. 00129 \end{eqnarray} 00130 The inverse transformations are: 00131 \begin{eqnarray} 00132 \label{eq:delta-ecliptic} 00133 \delta & = & \arcsin(\cos\beta\sin\lambda\sin\epsilon + 00134 \sin\beta\cos\epsilon) \;, \\ 00135 \label{eq:alpha-ecliptic} 00136 \alpha & = & \arctan\!2(\cos\beta\sin\lambda\cos\epsilon - 00137 \sin\beta\sin\epsilon, \cos\beta\cos\lambda) \;. 00138 \end{eqnarray} 00139 Here $\epsilon$ is the obliquity (inclination) of the ecliptic plane, 00140 which varies over time; at epoch J200 it has a mean value of: 00141 $$ 00142 \epsilon = 23.4392911^\circ \; . 00143 $$ 00144 00145 \subsubsection*{Uses} 00146 00147 \subsubsection*{Notes} 00148 00149 \vfill{\footnotesize\input{CelestialCoordinatesCV}} 00150 00151 ******************************************************* </lalLaTeX> */ 00152 00153 /* <lalVerbatim file="CelestialCoordinatesCP"> 00154 void 00155 LALGalacticToEquatorial( LALStatus *stat, 00156 SkyPosition *output, 00157 SkyPosition *input ) 00158 { </lalVerbatim> */ 00159 00160 /* <lalVerbatim file="CelestialCoordinatesCP"> 00161 void 00162 LALEquatorialToGalactic( LALStatus *stat, 00163 SkyPosition *output, 00164 SkyPosition *input ) 00165 { </lalVerbatim> */ 00166 00167 /* <lalVerbatim file="CelestialCoordinatesCP"> 00168 void 00169 LALEclipticToEquatorial( LALStatus *stat, 00170 SkyPosition *output, 00171 SkyPosition *input ) 00172 { </lalVerbatim> */ 00173 00174 /* <lalVerbatim file="CelestialCoordinatesCP"> 00175 void 00176 LALEquatorialToEcliptic( LALStatus *stat, 00177 SkyPosition *output, 00178 SkyPosition *input ) 00179 { </lalVerbatim> */ 00180 00181 #include <stddef.h> /* just so the contents aren't empty... */ 00182 00183 #include <lal/LALRCSID.h> 00184 NRCSID (CELESTIALCOORDINATESLALDOCC,"$Id: CelestialCoordinatesLaldoc.c,v 1.4 2007/06/08 14:41:47 bema Exp $");
1.5.2