Changeset 318
- Timestamp:
- Mar 30, 2004, 8:35:31 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/doc/pslib/psLibADD.tex (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/pslib/psLibADD.tex
r316 r318 337 337 % 338 338 \[ T_{ij} = M_{ji} \] 339 where $M_{ ji}$ is the matrix to be transposed.339 where $M_{ij}$ is the matrix to be transposed. 340 340 341 341 \subsubsection{Convert a matrix to a vector} … … 482 482 \subsection{(Fast) Fourier Transforms} 483 483 484 (Fast) Fourier Transforms (FFTs) shall be implemented using the {\em485 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) 486 library}. 487 487 488 488 \subsubsection{FFTW Plans} … … 508 508 509 509 \begin{tabular}{ll} 510 PSLib function & Major FFTW call \\ \hline511 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%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()} \\ 514 514 \end{tabular} 515 515 … … 517 517 which will allow FFTW to default to a short planning time if the 518 518 wisdom has not been loaded. Transforms should be performed out of 519 place to avoid the need to pad the input array .519 place to avoid the need to pad the input array to hold the output. 520 520 521 521 \subsubsection{More Complicated Functions} 522 522 523 523 The \code{psFFTFilter} and \code{psFFTFilterComplex} functions provide 524 ameans to apply a filter (purely real and imaginary multipliers,524 the means to apply a filter (purely real and imaginary multipliers, 525 525 respectively) to the data in the Fourier plane. If the filter 526 526 function specified for \code{psFFTFilter} returns a real value, $r$, 527 527 then the corresponding value in the Fourier plane should be multiplied 528 528 by $r$. If the real and imaginary filter functions specified for 529 \code{psFFTFilterComplex} return s 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, 530 then the corresponding value in the Fourier plane should be multiplied 531 by the complex number $r + si$. 532 532 533 533 \code{psFFTCrossCorrelate()} and \code{psFFTConvolve()} both involve 534 534 multiplication of two Fourier transforms. In the former, the first 535 535 Fourier 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. 536 Fourier transform to yield the Fourier transform of the 537 cross-correlation (NR 13.2). In the latter, the two Fourier 538 transforms are multiplied directly to yield the Fourier transform of 539 the convolution (NR 13.1). 539 540 540 541 If 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} 542 the elements of the power spectrum are (NR 13.4): 543 \begin{eqnarray} 544 P_0 & = & \left| C_0 \right|^2 / N^2 \\ 545 P_j & = & \left( \left| C_j \right|^2 + \left| C_{N-j} \right|^2 \right)/ N^2 \\ 546 P_{N/2} & = & \left| C_{N/2} \right|^2 / N^2 \\ 547 \end{eqnarray} 548 where $j = 1, 2, \ldots, (N/2 - 1)$. 547 549 548 550 Note that we leave the issue of ``windowing'' the data up to the … … 550 552 551 553 \subsection{Astronomy Utilities} 554 555 Most of the astronomy utilities will be implemented through wrapping 556 the 557 \href{http://star-www.rl.ac.uk/star/docs/sun67.htx/sun67.html}{SLALIB 558 Positional Astronomy Library}. 559 560 \subsubsection{Celestial Coordinate Conversions} 561 562 These 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 575 The following information is from 576 \href{http://www.cv.nrao.edu/fits/documents/wcs/wcs.all.ps}{Greisen \& 577 Calabretta (1995, ADASS, 4, 233)}. 578 579 Let the latitude be $\phi$ and the longitude $\theta$. The domains of 580 these are $-\pi < \phi \le \pi$ and $-\pi/2 \le \theta \le \pi/2$. 581 582 For zenithal projections (e.g.\ Gnomonic and Orthographic) the 583 following hold: 584 585 \begin{eqnarray} 586 x & = & R \sin \phi \\ 587 y & = & -R \cos \phi 588 \end{eqnarray} 589 590 and 591 592 \begin{eqnarray} 593 R & = & \sqrt{x^2 + y^2} \\ 594 \phi & = & {\rm arg} (-y,x) 595 \end{eqnarray} 596 597 \subsubsubsection{Gnomonic} 598 599 The Gnomonic projection (``TAN'') is a zenithal projection. 600 601 \begin{eqnarray} 602 R & = & \cot \theta 180^\circ/\pi \\ 603 \theta & = & \arctan (180^\circ/(\pi R)) 604 \end{eqnarray} 605 606 \subsubsubsection{Orthographic} 607 608 The Orthographic projection (``SIN'') is a zenithal projection. 609 610 \begin{eqnarray} 611 R & = & \cos \theta 180^\circ/\pi \\ 612 \theta & = & \arccos (\pi R / 180^\circ) 613 \end{eqnarray} 614 615 \subsubsubsection{Cartesian} 616 617 The Cartesian projection (``CAR'') is a very simple cylindrical projection. 618 619 \begin{eqnarray} 620 x & = & \phi \\ 621 y & = & \theta 622 \end{eqnarray} 623 624 \subsubsubsection{Mercator} 625 626 The Mercator projection (``MER'') is a cylindrical projection. 627 628 \begin{eqnarray} 629 x & = & \phi \\ 630 y & = & \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 636 The Hammer-Aitoff projection is a general projection, and is defined: 637 638 \begin{eqnarray} 639 x & = & 2 \alpha \cos \theta \sin (\phi/2) \\ 640 y & = & \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 644 And 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 552 657 553 658 \section{Modules}
Note:
See TracChangeset
for help on using the changeset viewer.
