Index: /trunk/doc/pslib/psLibADD.tex
===================================================================
--- /trunk/doc/pslib/psLibADD.tex	(revision 317)
+++ /trunk/doc/pslib/psLibADD.tex	(revision 318)
@@ -337,5 +337,5 @@
 %
 \[ T_{ij} = M_{ji} \]
-where $M_{ji}$ is the matrix to be transposed.
+where $M_{ij}$ is the matrix to be transposed.
 
 \subsubsection{Convert a matrix to a vector}
@@ -482,7 +482,7 @@
 \subsection{(Fast) Fourier Transforms}
 
-(Fast) Fourier Transforms (FFTs) shall be implemented using the {\em
-Fastest Fourier Transform in the West} (FFTW) library
-(\href{www.fftw.org}).
+(Fast) Fourier Transforms (FFTs) shall be implemented using the
+\href{www.fftw.org}{{\em Fastest Fourier Transform in the West} (FFTW)
+library}.
 
 \subsubsection{FFTW Plans}
@@ -508,8 +508,8 @@
 
 \begin{tabular}{ll}
-  PSLib function           & Major FFTW call \\ \hline
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-  psFFTForward()           & fftw_plan_dft_r2c_2d()
-  psFFTReverse()           & fftw_plan_dft_c2r_2d()
+  PSLib function        & Major FFTW call \\ \hline
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+  \code{psFFTForward()} & \code{fftw_plan_dft_r2c_2d()} \\
+  \code{psFFTReverse()} & \code{fftw_plan_dft_c2r_2d()} \\
 \end{tabular}
 
@@ -517,32 +517,34 @@
 which will allow FFTW to default to a short planning time if the
 wisdom has not been loaded.  Transforms should be performed out of
-place to avoid the need to pad the input array.
+place to avoid the need to pad the input array to hold the output.
 
 \subsubsection{More Complicated Functions}
 
 The \code{psFFTFilter} and \code{psFFTFilterComplex} functions provide
-a means to apply a filter (purely real and imaginary multipliers,
+the means to apply a filter (purely real and imaginary multipliers,
 respectively) to the data in the Fourier plane.  If the filter
 function specified for \code{psFFTFilter} returns a real value, $r$,
 then the corresponding value in the Fourier plane should be multiplied
 by $r$.  If the real and imaginary filter functions specified for
-\code{psFFTFilterComplex} returns the values $r$ and $s$,
-respectively, then the corresponding value in the Fourier plane should be
-multiplied by the complex number $(r + si)$.
+\code{psFFTFilterComplex} return the values $r$ and $s$, respectively,
+then the corresponding value in the Fourier plane should be multiplied
+by the complex number $r + si$.
 
 \code{psFFTCrossCorrelate()} and \code{psFFTConvolve()} both involve
 multiplication of two Fourier transforms.  In the former, the first
 Fourier transform is multiplied by the complex conjugate of the second
-Fourier transform to yield the Fourier transform of the cross-correlation.
-In the latter, the two Fourier transforms are multiplied directly to yield
-the Fourier transform of the convolution.
+Fourier transform to yield the Fourier transform of the
+cross-correlation (NR 13.2).  In the latter, the two Fourier
+transforms are multiplied directly to yield the Fourier transform of
+the convolution (NR 13.1).
 
 If the elements of the discrete Fourier transform are $C_k$, then the
-the elements of the power spectrum are defined (NR 13.4):
-\begin{eqnarray}
-P_0     & = & \| C_0 \|^2 / N^2 \\
-P_j     & = & \left( \| C_j \|^2 + \| C_{N-j} \|^2 \right)/ N^2 & j = 1, 2, \ldots, (N/2 - 1) \\
-P_{N/2} & = & \| C_{N/2} \|^2 / N^2 \\
-\end{eqnarray}
+the elements of the power spectrum are (NR 13.4):
+\begin{eqnarray}
+P_0     & = & \left| C_0 \right|^2 / N^2 \\
+P_j     & = & \left( \left| C_j \right|^2 + \left| C_{N-j} \right|^2 \right)/ N^2 \\
+P_{N/2} & = & \left| C_{N/2} \right|^2 / N^2 \\
+\end{eqnarray}
+where $j = 1, 2, \ldots, (N/2 - 1)$.
 
 Note that we leave the issue of ``windowing'' the data up to the
@@ -550,4 +552,107 @@
 
 \subsection{Astronomy Utilities}
+
+Most of the astronomy utilities will be implemented through wrapping
+the
+\href{http://star-www.rl.ac.uk/star/docs/sun67.htx/sun67.html}{SLALIB
+Positional Astronomy Library}.
+
+\subsubsection{Celestial Coordinate Conversions}
+
+These will be implemented using the corresponding SLALIB functions:
+
+\begin{tabular}{ll}
+  PSLib function             & SLALIB function \\ \hline
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+  \code{psCoordinatesItoE()} & \code{sla_EQECL} \\
+  \code{psCoordinatesEtoI()} & \code{sla_ECLEQ} \\
+  \code{psCoordinatesItoG()} & \code{sla_EQGAL} \\
+  \code{psCoordinatesGtoI()} & \code{sla_GALEQ} \\
+\end{tabular}
+
+\subsubsection{Projections}
+
+The following information is from
+\href{http://www.cv.nrao.edu/fits/documents/wcs/wcs.all.ps}{Greisen \&
+Calabretta (1995, ADASS, 4, 233)}.
+
+Let the latitude be $\phi$ and the longitude $\theta$.  The domains of
+these are $-\pi < \phi \le \pi$ and $-\pi/2 \le \theta \le \pi/2$.
+
+For zenithal projections (e.g.\ Gnomonic and Orthographic) the
+following hold:
+
+\begin{eqnarray}
+x & = & R \sin \phi \\
+y & = & -R \cos \phi
+\end{eqnarray}
+
+and
+
+\begin{eqnarray}
+R & = & \sqrt{x^2 + y^2} \\
+\phi & = & {\rm arg} (-y,x)
+\end{eqnarray}
+
+\subsubsubsection{Gnomonic}
+
+The Gnomonic projection (``TAN'') is a zenithal projection.
+
+\begin{eqnarray}
+R & = & \cot \theta 180^\circ/\pi \\
+\theta & = & \arctan (180^\circ/(\pi R))
+\end{eqnarray}
+
+\subsubsubsection{Orthographic}
+
+The Orthographic projection (``SIN'') is a zenithal projection.
+
+\begin{eqnarray}
+R & = & \cos \theta 180^\circ/\pi \\
+\theta & = & \arccos (\pi R / 180^\circ)
+\end{eqnarray}
+
+\subsubsubsection{Cartesian}
+
+The Cartesian projection (``CAR'') is a very simple cylindrical projection.
+
+\begin{eqnarray}
+x & = & \phi \\
+y & = & \theta
+\end{eqnarray}
+
+\subsubsubsection{Mercator}
+
+The Mercator projection (``MER'') is a cylindrical projection.
+
+\begin{eqnarray}
+x & = & \phi \\
+y & = & \ln \left( \tan (45^\circ + \theta/2) \right) 180^\circ/\pi \\
+{\rm and}\hspace{1cm} \theta & = & 2 \arctan \left( e^{y\pi/180^\circ} \right) - 90^\circ
+\end{eqnarray}
+
+\subsubsubsection{Hammer-Aitoff}
+
+The Hammer-Aitoff projection is a general projection, and is defined:
+
+\begin{eqnarray}
+x & = & 2 \alpha \cos \theta \sin (\phi/2) \\
+y & = & \alpha \sin \theta \\
+{\rm where}\hspace{1cm} \alpha^{-1} & \equiv & (180^\circ/\pi) \sqrt{\left(1 + \cos \theta \cos (\phi/2) \right) / 2}
+\end{eqnarray}
+
+And in reverse:
+
+\begin{eqnarray}
+\phi & = & 2 {\rm arg} (2z^2 - 1, xz \pi/360^\circ) \\
+\theta & = & \arcsin (yz\pi/180^\circ) \\
+{\rm where}\hspace{1cm} z & \equiv & \sqrt{1 - (x\pi/720^\circ)^2 - (y\pi/360^\circ)^2}
+\end{eqnarray}
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
 
 \section{Modules}
