IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 30, 2004, 8:35:31 PM (22 years ago)
Author:
Paul Price
Message:

Added celestial coordinate conversions and projections.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/pslib/psLibADD.tex

    r316 r318  
    337337%
    338338\[ T_{ij} = M_{ji} \]
    339 where $M_{ji}$ is the matrix to be transposed.
     339where $M_{ij}$ is the matrix to be transposed.
    340340
    341341\subsubsection{Convert a matrix to a vector}
     
    482482\subsection{(Fast) Fourier Transforms}
    483483
    484 (Fast) Fourier Transforms (FFTs) shall be implemented using the {\em
    485 Fastest Fourier Transform in the West} (FFTW) library
    486 (\href{www.fftw.org}).
     484(Fast) Fourier Transforms (FFTs) shall be implemented using the
     485\href{www.fftw.org}{{\em Fastest Fourier Transform in the West} (FFTW)
     486library}.
    487487
    488488\subsubsection{FFTW Plans}
     
    508508
    509509\begin{tabular}{ll}
    510   PSLib function           & Major FFTW call \\ \hline
    511 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    512   psFFTForward()           & fftw_plan_dft_r2c_2d()
    513   psFFTReverse()           & fftw_plan_dft_c2r_2d()
     510  PSLib function        & Major FFTW call \\ \hline
     511%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     512  \code{psFFTForward()} & \code{fftw_plan_dft_r2c_2d()} \\
     513  \code{psFFTReverse()} & \code{fftw_plan_dft_c2r_2d()} \\
    514514\end{tabular}
    515515
     
    517517which will allow FFTW to default to a short planning time if the
    518518wisdom has not been loaded.  Transforms should be performed out of
    519 place to avoid the need to pad the input array.
     519place to avoid the need to pad the input array to hold the output.
    520520
    521521\subsubsection{More Complicated Functions}
    522522
    523523The \code{psFFTFilter} and \code{psFFTFilterComplex} functions provide
    524 a means to apply a filter (purely real and imaginary multipliers,
     524the means to apply a filter (purely real and imaginary multipliers,
    525525respectively) to the data in the Fourier plane.  If the filter
    526526function specified for \code{psFFTFilter} returns a real value, $r$,
    527527then the corresponding value in the Fourier plane should be multiplied
    528528by $r$.  If the real and imaginary filter functions specified for
    529 \code{psFFTFilterComplex} returns the values $r$ and $s$,
    530 respectively, then the corresponding value in the Fourier plane should be
    531 multiplied by the complex number $(r + si)$.
     529\code{psFFTFilterComplex} return the values $r$ and $s$, respectively,
     530then the corresponding value in the Fourier plane should be multiplied
     531by the complex number $r + si$.
    532532
    533533\code{psFFTCrossCorrelate()} and \code{psFFTConvolve()} both involve
    534534multiplication of two Fourier transforms.  In the former, the first
    535535Fourier transform is multiplied by the complex conjugate of the second
    536 Fourier transform to yield the Fourier transform of the cross-correlation.
    537 In the latter, the two Fourier transforms are multiplied directly to yield
    538 the Fourier transform of the convolution.
     536Fourier transform to yield the Fourier transform of the
     537cross-correlation (NR 13.2).  In the latter, the two Fourier
     538transforms are multiplied directly to yield the Fourier transform of
     539the convolution (NR 13.1).
    539540
    540541If the elements of the discrete Fourier transform are $C_k$, then the
    541 the elements of the power spectrum are defined (NR 13.4):
    542 \begin{eqnarray}
    543 P_0     & = & \| C_0 \|^2 / N^2 \\
    544 P_j     & = & \left( \| C_j \|^2 + \| C_{N-j} \|^2 \right)/ N^2 & j = 1, 2, \ldots, (N/2 - 1) \\
    545 P_{N/2} & = & \| C_{N/2} \|^2 / N^2 \\
    546 \end{eqnarray}
     542the elements of the power spectrum are (NR 13.4):
     543\begin{eqnarray}
     544P_0     & = & \left| C_0 \right|^2 / N^2 \\
     545P_j     & = & \left( \left| C_j \right|^2 + \left| C_{N-j} \right|^2 \right)/ N^2 \\
     546P_{N/2} & = & \left| C_{N/2} \right|^2 / N^2 \\
     547\end{eqnarray}
     548where $j = 1, 2, \ldots, (N/2 - 1)$.
    547549
    548550Note that we leave the issue of ``windowing'' the data up to the
     
    550552
    551553\subsection{Astronomy Utilities}
     554
     555Most of the astronomy utilities will be implemented through wrapping
     556the
     557\href{http://star-www.rl.ac.uk/star/docs/sun67.htx/sun67.html}{SLALIB
     558Positional Astronomy Library}.
     559
     560\subsubsection{Celestial Coordinate Conversions}
     561
     562These will be implemented using the corresponding SLALIB functions:
     563
     564\begin{tabular}{ll}
     565  PSLib function             & SLALIB function \\ \hline
     566%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     567  \code{psCoordinatesItoE()} & \code{sla_EQECL} \\
     568  \code{psCoordinatesEtoI()} & \code{sla_ECLEQ} \\
     569  \code{psCoordinatesItoG()} & \code{sla_EQGAL} \\
     570  \code{psCoordinatesGtoI()} & \code{sla_GALEQ} \\
     571\end{tabular}
     572
     573\subsubsection{Projections}
     574
     575The following information is from
     576\href{http://www.cv.nrao.edu/fits/documents/wcs/wcs.all.ps}{Greisen \&
     577Calabretta (1995, ADASS, 4, 233)}.
     578
     579Let the latitude be $\phi$ and the longitude $\theta$.  The domains of
     580these are $-\pi < \phi \le \pi$ and $-\pi/2 \le \theta \le \pi/2$.
     581
     582For zenithal projections (e.g.\ Gnomonic and Orthographic) the
     583following hold:
     584
     585\begin{eqnarray}
     586x & = & R \sin \phi \\
     587y & = & -R \cos \phi
     588\end{eqnarray}
     589
     590and
     591
     592\begin{eqnarray}
     593R & = & \sqrt{x^2 + y^2} \\
     594\phi & = & {\rm arg} (-y,x)
     595\end{eqnarray}
     596
     597\subsubsubsection{Gnomonic}
     598
     599The Gnomonic projection (``TAN'') is a zenithal projection.
     600
     601\begin{eqnarray}
     602R & = & \cot \theta 180^\circ/\pi \\
     603\theta & = & \arctan (180^\circ/(\pi R))
     604\end{eqnarray}
     605
     606\subsubsubsection{Orthographic}
     607
     608The Orthographic projection (``SIN'') is a zenithal projection.
     609
     610\begin{eqnarray}
     611R & = & \cos \theta 180^\circ/\pi \\
     612\theta & = & \arccos (\pi R / 180^\circ)
     613\end{eqnarray}
     614
     615\subsubsubsection{Cartesian}
     616
     617The Cartesian projection (``CAR'') is a very simple cylindrical projection.
     618
     619\begin{eqnarray}
     620x & = & \phi \\
     621y & = & \theta
     622\end{eqnarray}
     623
     624\subsubsubsection{Mercator}
     625
     626The Mercator projection (``MER'') is a cylindrical projection.
     627
     628\begin{eqnarray}
     629x & = & \phi \\
     630y & = & \ln \left( \tan (45^\circ + \theta/2) \right) 180^\circ/\pi \\
     631{\rm and}\hspace{1cm} \theta & = & 2 \arctan \left( e^{y\pi/180^\circ} \right) - 90^\circ
     632\end{eqnarray}
     633
     634\subsubsubsection{Hammer-Aitoff}
     635
     636The Hammer-Aitoff projection is a general projection, and is defined:
     637
     638\begin{eqnarray}
     639x & = & 2 \alpha \cos \theta \sin (\phi/2) \\
     640y & = & \alpha \sin \theta \\
     641{\rm where}\hspace{1cm} \alpha^{-1} & \equiv & (180^\circ/\pi) \sqrt{\left(1 + \cos \theta \cos (\phi/2) \right) / 2}
     642\end{eqnarray}
     643
     644And in reverse:
     645
     646\begin{eqnarray}
     647\phi & = & 2 {\rm arg} (2z^2 - 1, xz \pi/360^\circ) \\
     648\theta & = & \arcsin (yz\pi/180^\circ) \\
     649{\rm where}\hspace{1cm} z & \equiv & \sqrt{1 - (x\pi/720^\circ)^2 - (y\pi/360^\circ)^2}
     650\end{eqnarray}
     651
     652
     653%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     654%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     655%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     656
    552657
    553658\section{Modules}
Note: See TracChangeset for help on using the changeset viewer.