Changeset 3718
- Timestamp:
- Apr 19, 2005, 1:40:47 PM (21 years ago)
- Location:
- trunk/doc/pslib
- Files:
-
- 3 edited
-
ChangeLogADD.tex (modified) (2 diffs)
-
psLibADD.tex (modified) (26 diffs)
-
rotations.ps (modified) ( previous)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/pslib/ChangeLogADD.tex
r3564 r3718 29 29 \end{itemize} 30 30 31 \subsection{Changes from version 09 (14 February 2005) to version 10 (29 March 2005 }31 \subsection{Changes from version 09 (14 February 2005) to version 10 (29 March 2005)} 32 32 33 33 \begin{itemize} … … 48 48 \item promoted all PSLib subsections to sections 49 49 \end{itemize} 50 \end{itemize} 50 51 52 \subsection{Changes from version 10 (29 March 2005) to version 11 (19 April 2005)} 53 54 \begin{itemize} 55 \item defined earth orientation algorithms 56 \item provided quaternions for rotations 57 \item moved some sections to reflect order in SDRS (matrix, fftw) 51 58 \end{itemize} -
trunk/doc/pslib/psLibADD.tex
r3564 r3718 1 %%% $Id: psLibADD.tex,v 1.7 0 2005-03-30 21:14:48eugene Exp $1 %%% $Id: psLibADD.tex,v 1.71 2005-04-19 23:40:47 eugene Exp $ 2 2 \documentclass[panstarrs]{panstarrs} 3 3 … … 14 14 \project{Pan-STARRS Image Processing Pipeline} 15 15 \organization{Institute for Astronomy} 16 \version{1 0}16 \version{11} 17 17 \docnumber{PSDC-430-006} 18 18 19 \setcounter{tocdepth}{5} % lowest level to be included in toc19 % \setcounter{tocdepth}{5} % lowest level to be included in toc 20 20 21 21 \newcommand\citealt{} … … 41 41 09 & 2005 Feb 14 & Frozen for Cycle 5 \\ \hline 42 42 10 & 2005 Mar 21 & Draft for Cycle 6 \\ \hline 43 11 & 2005 Apr 19 & Frozen for Cycle 6 \\ \hline 43 44 \RevisionsEnd 44 45 … … 347 348 Note that the total adds to one --- the number of values added. 348 349 349 \subsection{Matrix Operations} 350 351 In this section, we define the linear algebra operations performed on 352 matrices. We have defined APIs to implement the following matrix 353 functions: 354 350 \subsection{Polynomials} 351 \label{sec:polynomials} 352 353 We will employ Chebyshev polynomials (NR \S 5.8) to approximate functions: 354 \begin{equation} 355 f(x) = \sum_{i=0}^{n} c_i T_i(x) 356 \end{equation} 357 These have some desirable features: 355 358 \begin{itemize} 356 \item Invert a matrix; 357 \item Calculate a matrix determinant; 358 \item Perform matrix addition, subtraction and multiplication; 359 \item Transpose a matrix; and 360 \item Convert a matrix to a vector. 359 \item They are bounded on $-1 < x < 1$, with the maxima and minima 360 over this range being 1 and $-1$, respectively; 361 \item Truncation of the higher-order terms leaves one with the most accurate 362 lower-order polynomial representation of the desired function. 361 363 \end{itemize} 362 364 363 Many of these operations are implemented using LU decomposition. We 364 define LU decomposition in the following paragraph. Implementation of 365 LU decomposition shall make use of the GSL function 366 \code{gsl_linalg_LU_decomp}. 367 368 \subsubsection{LU Decomposition} 369 \label{LUdecomp} 370 371 We wish to decompose the matrix $A$ with elements $a_{ij}$ into 372 diagonal matrices that satisfy the relationship $A = L U$ where $L$ is 373 a lower-diagonal matrix of the form: 374 \begin{equation} 375 L = \left( 376 \begin{matrix} 377 \alpha_{11} & 0 & 0 & 0 \\ 378 \alpha_{21} & \alpha_{22} & 0 & 0 \\ 379 \alpha_{31} & \alpha_{32} & \alpha_{33} & 0 \\ 380 \alpha_{41} & \alpha_{42} & \alpha_{43} & \alpha_{44} \\ 381 \end{matrix} \right) 382 \end{equation} 383 % 384 (where all diagonal values $\alpha_{ii} = 1$) and $U$ is an upper-diagonal matrix of the form: 385 \begin{equation} 386 U = \left( 387 \begin{matrix} 388 \beta_{11} & \beta_{12} & \beta_{13} & \beta_{14} \\ 389 0 & \beta_{22} & \beta_{23} & \beta_{24} \\ 390 0 & 0 & \beta_{33} & \beta_{34} \\ 391 0 & 0 & 0 & \beta_{44} \\ 392 \end{matrix} \right) 393 \end{equation} 394 395 We can find the values of $\alpha_{ij}$ and $\beta_{ij}$ by following 396 this procedure. First, $\alpha_{ii} = 1$. For all values of $j = 1, 397 2, \dots, N$, follow the next steps: For each value of $i = 1, 2, 398 \dots, j$, solve for $\beta_{ij}$ using the relationship: 399 \begin{equation} 400 \beta_{ij} = a_{ij} - \sum_{k=1}^{i-1} \alpha_{ik}\beta_{kj} 401 \end{equation} 402 For the values of $i = j+1, j+2, \dots, N$, solve for the values of 403 $\alpha_{ij}$ with the following: 404 % 405 \begin{equation} 406 \alpha_{ij} = \frac{1}{\beta_{jj}} \left( a_{ij} - \sum_{k=1}^{j-1} \alpha_{ik}\beta_{kj} \right) 407 \end{equation} 408 409 \subsubsection{Calculate a matrix determinant} 410 411 The determinant $D$ of a matrix $a_{ij}$ is calculated from the 412 product of the diagonal elements of the LU decomposition: 413 \begin{equation} 414 D = P_{i=1}{N} U_{ii} 415 \end{equation} 416 417 This shall be calculated using the GSL function 418 \code{gsl_linalg_LU_det}. If the matrix is large or the magnitude of 419 the elements is large, the determinant may overflow the data type. In 420 these cases, the (natural) logarithm of the determinant may be 421 calculated instead (as the sum of the logarithms of the diagonal 422 elements). In this case, the GSL function \code{gsl_linalg_LU_lndet} 423 shall be used. 424 425 \subsubsection{Solving a Linear Equation} 426 427 The LU decomposition of a matrix may be used to solve the 428 matrix equation $\sum_{j=1}^{N} A_{i,j} \times x_j = B_j $ 429 430 Given the LU decomposition of a matrix into $\alpha_{ij}$ and 431 $\beta_{ij}$, the technique of back-substitution is used to solve the 432 equation above. First solve the equation $L y = B$: 433 \begin{eqnarray} 434 y_1 & = & \frac{b_1}{\alpha_{11}} \\ 435 y_i & = & \frac{1}{\alpha_{ii}}\left(b_i - \sum_{j=1}^{i-1} \alpha_{ij} y_i\right) 436 \end{eqnarray} 437 438 The values of $y$ may be used to solve for $x_i$ using the 439 relationship $U x = b$: 440 \begin{eqnarray} 441 x_N & = & \frac{y_N}{\beta_{NN}} \\ 442 x_i & = & \frac{1}{\beta_{ii}}\left(y_i - \sum_{j=i+1}^N \beta_{ij} y_ij\right) 443 \end{eqnarray} 444 445 \subsubsection{Invert a matrix} 446 447 Inversion of a matrix using the LU decomposition is performed by 448 performing back-subsitution to solve a series of linear equations of 449 the form $\sum_{j=1}^{N} A_{i,j} \times x_j = B_j $ where the values 450 of $B_j$ represent the columns of the identity matrix. The solution 451 vectors $x_j$ represent the columns of the inverse matrix. This 452 operation shall be implemented using the GSL function \code{gsl_linalg_LU_invert}. 453 454 \subsubsection{Perform matrix addition, subtraction and multiplication} 455 456 Matrix binary arithmetic operations differ from image binary 457 arithmetic operations in a fundamental way: For image operations, the 458 resulting pixel value is determined by performing the operation on the 459 two corresponding input operand pixels. For matrix operations, the 460 resulting element value results from the operation on the 461 corresponding pair of row and colum from the input matrices. So, for 462 example, given the input matrices $\alpha_{ij}$ and $\beta_{ij}$, the 463 image and matrix multiplications correspond to: 464 % 465 \begin{eqnarray} 466 \mbox{image}_{ij} & = & \alpha_{ij} \times \beta_{ij} \\ 467 \mbox{matrix}_{jk} = \sum_{i=1}^N \alpha_{ij} \times \beta_{ki} 468 \end{eqnarray} 469 % 470 The matrix and image operations for addition and subtraction are 471 identical: the operation is performed on the corresponding elements in 472 each matrix. Matrix division is not defined (to divide, the user 473 should first invert the matrix, and then multiply). The matrix math 474 function \code{psMatrixOp} shall implement the matrix version of the 475 binary arithmetical operations for the following operators: $+, -, 476 \times$. 477 478 \subsubsection{Transpose a matrix} 479 480 The transpose of a matrix is simply the reorganization of the matrix 481 elements by 'flipping' the matrix along a diagonal. For non-square 482 matrices with dimensions $N \times M$, the resulting matrix has 483 dimensions $M \times N$. The element of the output matrix $T_{ij}$ is 484 given by 485 % 486 \begin{equation} 487 T_{ij} = M_{ji} 488 \end{equation} 489 where $M_{ij}$ is the matrix to be transposed. 490 491 \subsubsection{Convert a matrix to a vector} 492 493 Matrix-to-vector conversion is only defined for a matrix that has a 494 size of one in at least one dimension. In that case, the elements 495 should be extracted, and placed in a vector, with care that the 496 \code{psType} is defined correctly --- a $1\times N$ matrix is 497 converted to a \code{PS_DIMEN_VECTOR}-type vector, while a $N\times 1$ 498 matrix is converted to a \code{PS_DIMEN_TRANV}-type vector. 365 The first few Chebyshev polynomials are: 366 \begin{eqnarray} 367 T_0(x) & = & 1 \\ 368 T_1(x) & = & x \\ 369 T_2(x) & = & 2x^2 - 1 \\ 370 T_3(x) & = & 4x^3 - 3x \\ 371 T_4(x) & = & 8x^4 - 8x^2 + 1 \\ 372 \end{eqnarray} 373 Chebyshev polynomials follow the recurrence relation: 374 \begin{equation} 375 T_{n+1} = 2xT_n - T_{n-1} 376 \end{equation} 377 378 Practically, Chebyshev polynomials should be evaluated using Clenshaw's recurrence 379 formula (NR \S 5.5): 380 \begin{eqnarray} 381 d_j & = & 2xd_{j+1} - d_{j+2} + c_j \\ 382 f(x) & = & x*d_1 - d_2 + 1/2 c_0 \\ 383 \end{eqnarray} 384 385 It shall be the responsibility of the user to convert the domain into the range 386 $-1 < x < 1$. 387 388 \subsubsection{Multi-dimensional polynomials} 389 390 Multi-dimensional polynomials shall be composed of multiplications of 391 1D Chebyshev polynomials, with the coefficients stored in tensors of 392 the appropriate rank. 393 394 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 499 395 500 396 \subsection{Fitting} … … 670 566 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 671 567 672 \subsection{Polynomials}673 \label{sec:polynomials}674 675 We will employ Chebyshev polynomials (NR \S 5.8) to approximate functions:676 \begin{equation}677 f(x) = \sum_{i=0}^{n} c_i T_i(x)678 \end{equation}679 These have some desirable features:680 \begin{itemize}681 \item They are bounded on $-1 < x < 1$, with the maxima and minima682 over this range being 1 and $-1$, respectively;683 \item Truncation of the higher-order terms leaves one with the most accurate684 lower-order polynomial representation of the desired function.685 \end{itemize}686 687 The first few Chebyshev polynomials are:688 \begin{eqnarray}689 T_0(x) & = & 1 \\690 T_1(x) & = & x \\691 T_2(x) & = & 2x^2 - 1 \\692 T_3(x) & = & 4x^3 - 3x \\693 T_4(x) & = & 8x^4 - 8x^2 + 1 \\694 \end{eqnarray}695 Chebyshev polynomials follow the recurrence relation:696 \begin{equation}697 T_{n+1} = 2xT_n - T_{n-1}698 \end{equation}699 700 Practically, Chebyshev polynomials should be evaluated using Clenshaw's recurrence701 formula (NR \S 5.5):702 \begin{eqnarray}703 d_j & = & 2xd_{j+1} - d_{j+2} + c_j \\704 f(x) & = & x*d_1 - d_2 + 1/2 c_0 \\705 \end{eqnarray}706 707 It shall be the responsibility of the user to convert the domain into the range708 $-1 < x < 1$.709 710 \subsubsection{Multi-dimensional polynomials}711 712 Multi-dimensional polynomials shall be composed of multiplications of713 1D Chebyshev polynomials, with the coefficients stored in tensors of714 the appropriate rank.715 716 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%717 718 \subsection{(Fast) Fourier Transforms}719 720 (Fast) Fourier Transforms (FFTs) shall be implemented using the721 \href{www.fftw.org}{{\em Fastest Fourier Transform in the West} (FFTW)722 library}.723 724 \subsubsection{FFTW Plans}725 726 FFTW requires the user to create a ``plan'' for each transform size,727 the time to create which is a function of the desired speed of the728 transform --- faster transforms for a given size (and machine) may be729 performed if more time is spent testing plans.730 731 In the \PS{} IPP, we will want to perform FFTs on images of common732 sizes (e.g.\ $512 \times 512$) regularly. This means that we would733 gain from determining an FFTW plan for each of these common sizes.734 FFTW provides a binary, \code{fftw-wisdom} which may be used to735 generate and save ``wisdom''. The location of the \code{wisdom} file736 will be specified as a configuration variable for the IPP (defaulting737 to \code{/etc/fftw/wisdom}). The \code{wisdom} should be read in upon738 initialisation of the PSLib FFT functions and saved at the conclusion.739 740 \subsubsection{Function mapping}741 742 The forward and reverse transforms call the corresponding743 FFTW function to plan the transform:744 745 \begin{tabular}{ll}746 PSLib function & Major FFTW call \\ \hline747 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%748 \code{psFFTForward()} & \code{fftw_plan_dft_r2c_2d()} \\749 \code{psFFTReverse()} & \code{fftw_plan_dft_c2r_2d()} \\750 \end{tabular}751 752 These plans should be formulated using the \code{FFTW_ESTIMATE} flag,753 which will allow FFTW to default to a minimal planning time if the754 wisdom has not been loaded. Transforms should be performed out of755 place to avoid the need to pad the input array to hold the output.756 757 \subsubsection{More Complicated Functions}758 759 \code{psFFTCrossCorrelate()} and \code{psFFTConvolve()} both involve760 multiplication of two Fourier transforms. In the former, the first761 Fourier transform is multiplied by the complex conjugate of the second762 Fourier transform to yield the Fourier transform of the763 cross-correlation (NR \S 13.2). In the latter, the two Fourier764 transforms are multiplied directly to yield the Fourier transform of765 the convolution (NR \S 13.1).766 767 If the elements of the discrete Fourier transform are $C_k$, then the768 the elements of the power spectrum are (NR \S 13.4):769 \begin{eqnarray}770 P_0 & = & \left| C_0 \right|^2 / N^2 \\771 P_j & = & \left( \left| C_j \right|^2 + \left| C_{N-j} \right|^2 \right)/ N^2 \\772 P_{N/2} & = & \left| C_{N/2} \right|^2 / N^2 \\773 \end{eqnarray}774 where $j = 1, 2, \ldots, (N/2 - 1)$.775 776 Note that we leave the issue of ``windowing'' the data up to the777 caller, and choose to normalise by $1/N^2$.778 779 568 \subsection{Image Manipulations} 780 569 … … 971 760 972 761 \pagebreak 762 763 \subsection{Matrix Operations} 764 765 In this section, we define the linear algebra operations performed on 766 matrices. We have defined APIs to implement the following matrix 767 functions: 768 769 \begin{itemize} 770 \item Invert a matrix; 771 \item Calculate a matrix determinant; 772 \item Perform matrix addition, subtraction and multiplication; 773 \item Transpose a matrix; and 774 \item Convert a matrix to a vector. 775 \end{itemize} 776 777 Many of these operations are implemented using LU decomposition. We 778 define LU decomposition in the following paragraph. Implementation of 779 LU decomposition shall make use of the GSL function 780 \code{gsl_linalg_LU_decomp}. 781 782 \subsubsection{LU Decomposition} 783 \label{LUdecomp} 784 785 We wish to decompose the matrix $A$ with elements $a_{ij}$ into 786 diagonal matrices that satisfy the relationship $A = L U$ where $L$ is 787 a lower-diagonal matrix of the form: 788 \begin{equation} 789 L = \left( 790 \begin{matrix} 791 \alpha_{11} & 0 & 0 & 0 \\ 792 \alpha_{21} & \alpha_{22} & 0 & 0 \\ 793 \alpha_{31} & \alpha_{32} & \alpha_{33} & 0 \\ 794 \alpha_{41} & \alpha_{42} & \alpha_{43} & \alpha_{44} \\ 795 \end{matrix} \right) 796 \end{equation} 797 % 798 (where all diagonal values $\alpha_{ii} = 1$) and $U$ is an upper-diagonal matrix of the form: 799 \begin{equation} 800 U = \left( 801 \begin{matrix} 802 \beta_{11} & \beta_{12} & \beta_{13} & \beta_{14} \\ 803 0 & \beta_{22} & \beta_{23} & \beta_{24} \\ 804 0 & 0 & \beta_{33} & \beta_{34} \\ 805 0 & 0 & 0 & \beta_{44} \\ 806 \end{matrix} \right) 807 \end{equation} 808 809 We can find the values of $\alpha_{ij}$ and $\beta_{ij}$ by following 810 this procedure. First, $\alpha_{ii} = 1$. For all values of $j = 1, 811 2, \dots, N$, follow the next steps: For each value of $i = 1, 2, 812 \dots, j$, solve for $\beta_{ij}$ using the relationship: 813 \begin{equation} 814 \beta_{ij} = a_{ij} - \sum_{k=1}^{i-1} \alpha_{ik}\beta_{kj} 815 \end{equation} 816 For the values of $i = j+1, j+2, \dots, N$, solve for the values of 817 $\alpha_{ij}$ with the following: 818 % 819 \begin{equation} 820 \alpha_{ij} = \frac{1}{\beta_{jj}} \left( a_{ij} - \sum_{k=1}^{j-1} \alpha_{ik}\beta_{kj} \right) 821 \end{equation} 822 823 \subsubsection{Calculate a matrix determinant} 824 825 The determinant $D$ of a matrix $a_{ij}$ is calculated from the 826 product of the diagonal elements of the LU decomposition: 827 \begin{equation} 828 D = P_{i=1}{N} U_{ii} 829 \end{equation} 830 831 This shall be calculated using the GSL function 832 \code{gsl_linalg_LU_det}. If the matrix is large or the magnitude of 833 the elements is large, the determinant may overflow the data type. In 834 these cases, the (natural) logarithm of the determinant may be 835 calculated instead (as the sum of the logarithms of the diagonal 836 elements). In this case, the GSL function \code{gsl_linalg_LU_lndet} 837 shall be used. 838 839 \subsubsection{Solving a Linear Equation} 840 841 The LU decomposition of a matrix may be used to solve the 842 matrix equation $\sum_{j=1}^{N} A_{i,j} \times x_j = B_j $ 843 844 Given the LU decomposition of a matrix into $\alpha_{ij}$ and 845 $\beta_{ij}$, the technique of back-substitution is used to solve the 846 equation above. First solve the equation $L y = B$: 847 \begin{eqnarray} 848 y_1 & = & \frac{b_1}{\alpha_{11}} \\ 849 y_i & = & \frac{1}{\alpha_{ii}}\left(b_i - \sum_{j=1}^{i-1} \alpha_{ij} y_i\right) 850 \end{eqnarray} 851 852 The values of $y$ may be used to solve for $x_i$ using the 853 relationship $U x = b$: 854 \begin{eqnarray} 855 x_N & = & \frac{y_N}{\beta_{NN}} \\ 856 x_i & = & \frac{1}{\beta_{ii}}\left(y_i - \sum_{j=i+1}^N \beta_{ij} y_ij\right) 857 \end{eqnarray} 858 859 \subsubsection{Invert a matrix} 860 861 Inversion of a matrix using the LU decomposition is performed by 862 performing back-subsitution to solve a series of linear equations of 863 the form $\sum_{j=1}^{N} A_{i,j} \times x_j = B_j $ where the values 864 of $B_j$ represent the columns of the identity matrix. The solution 865 vectors $x_j$ represent the columns of the inverse matrix. This 866 operation shall be implemented using the GSL function \code{gsl_linalg_LU_invert}. 867 868 \subsubsection{Perform matrix addition, subtraction and multiplication} 869 870 Matrix binary arithmetic operations differ from image binary 871 arithmetic operations in a fundamental way: For image operations, the 872 resulting pixel value is determined by performing the operation on the 873 two corresponding input operand pixels. For matrix operations, the 874 resulting element value results from the operation on the 875 corresponding pair of row and colum from the input matrices. So, for 876 example, given the input matrices $\alpha_{ij}$ and $\beta_{ij}$, the 877 image and matrix multiplications correspond to: 878 % 879 \begin{eqnarray} 880 \mbox{image}_{ij} & = & \alpha_{ij} \times \beta_{ij} \\ 881 \mbox{matrix}_{jk} = \sum_{i=1}^N \alpha_{ij} \times \beta_{ki} 882 \end{eqnarray} 883 % 884 The matrix and image operations for addition and subtraction are 885 identical: the operation is performed on the corresponding elements in 886 each matrix. Matrix division is not defined (to divide, the user 887 should first invert the matrix, and then multiply). The matrix math 888 function \code{psMatrixOp} shall implement the matrix version of the 889 binary arithmetical operations for the following operators: $+, -, 890 \times$. 891 892 \subsubsection{Transpose a matrix} 893 894 The transpose of a matrix is simply the reorganization of the matrix 895 elements by 'flipping' the matrix along a diagonal. For non-square 896 matrices with dimensions $N \times M$, the resulting matrix has 897 dimensions $M \times N$. The element of the output matrix $T_{ij}$ is 898 given by 899 % 900 \begin{equation} 901 T_{ij} = M_{ji} 902 \end{equation} 903 where $M_{ij}$ is the matrix to be transposed. 904 905 \subsubsection{Convert a matrix to a vector} 906 907 Matrix-to-vector conversion is only defined for a matrix that has a 908 size of one in at least one dimension. In that case, the elements 909 should be extracted, and placed in a vector, with care that the 910 \code{psType} is defined correctly --- a $1\times N$ matrix is 911 converted to a \code{PS_DIMEN_VECTOR}-type vector, while a $N\times 1$ 912 matrix is converted to a \code{PS_DIMEN_TRANV}-type vector. 913 914 \subsection{(Fast) Fourier Transforms} 915 916 (Fast) Fourier Transforms (FFTs) shall be implemented using the 917 \href{www.fftw.org}{{\em Fastest Fourier Transform in the West} (FFTW) 918 library}. 919 920 \subsubsection{FFTW Plans} 921 922 FFTW requires the user to create a ``plan'' for each transform size, 923 the time to create which is a function of the desired speed of the 924 transform --- faster transforms for a given size (and machine) may be 925 performed if more time is spent testing plans. 926 927 In the \PS{} IPP, we will want to perform FFTs on images of common 928 sizes (e.g.\ $512 \times 512$) regularly. This means that we would 929 gain from determining an FFTW plan for each of these common sizes. 930 FFTW provides a binary, \code{fftw-wisdom} which may be used to 931 generate and save ``wisdom''. The location of the \code{wisdom} file 932 will be specified as a configuration variable for the IPP (defaulting 933 to \code{/etc/fftw/wisdom}). The \code{wisdom} should be read in upon 934 initialisation of the PSLib FFT functions and saved at the conclusion. 935 936 \subsubsection{Function mapping} 937 938 The forward and reverse transforms call the corresponding 939 FFTW function to plan the transform: 940 941 \begin{tabular}{ll} 942 PSLib function & Major FFTW call \\ \hline 943 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 944 \code{psFFTForward()} & \code{fftw_plan_dft_r2c_2d()} \\ 945 \code{psFFTReverse()} & \code{fftw_plan_dft_c2r_2d()} \\ 946 \end{tabular} 947 948 These plans should be formulated using the \code{FFTW_ESTIMATE} flag, 949 which will allow FFTW to default to a minimal planning time if the 950 wisdom has not been loaded. Transforms should be performed out of 951 place to avoid the need to pad the input array to hold the output. 952 953 \subsubsection{More Complicated Functions} 954 955 \code{psFFTCrossCorrelate()} and \code{psFFTConvolve()} both involve 956 multiplication of two Fourier transforms. In the former, the first 957 Fourier transform is multiplied by the complex conjugate of the second 958 Fourier transform to yield the Fourier transform of the 959 cross-correlation (NR \S 13.2). In the latter, the two Fourier 960 transforms are multiplied directly to yield the Fourier transform of 961 the convolution (NR \S 13.1). 962 963 If the elements of the discrete Fourier transform are $C_k$, then the 964 the elements of the power spectrum are (NR \S 13.4): 965 \begin{eqnarray} 966 P_0 & = & \left| C_0 \right|^2 / N^2 \\ 967 P_j & = & \left( \left| C_j \right|^2 + \left| C_{N-j} \right|^2 \right)/ N^2 \\ 968 P_{N/2} & = & \left| C_{N/2} \right|^2 / N^2 \\ 969 \end{eqnarray} 970 where $j = 1, 2, \ldots, (N/2 - 1)$. 971 972 Note that we leave the issue of ``windowing'' the data up to the 973 caller, and choose to normalise by $1/N^2$. 974 973 975 \section{PSLib Astronomy Utilities} 974 975 Most of the astronomy utilities will be implemented through wrapping976 the977 \href{http://star-www.rl.ac.uk/star/docs/sun67.htx/sun67.html}{SLALIB978 Positional Astronomy Library}. \tbd{SLAlib support will be dropped in979 the next release}980 976 981 977 \subsection{Time} … … 1015 1011 Leap-seconds are declared by the International Earth Rotation and Reference 1016 1012 Systems Service (IERS)\footnote{IERS website - http://www.iers.org/}. 1017 leap-seconds only occur in the UTC time system and cannot be accurately1013 Leap-seconds only occur in the UTC time system and cannot be accurately 1018 1014 predicted due to variations in the Earth's rotational period. To determine the 1019 1015 number of leap-second in a given UTC date a table of leap-seconds as annouced by … … 1021 1017 leap-second occurs. 1022 1018 1023 For ease of conversion, UTC should be represented as the number of seconds 1024 since the UNIX epoch of ``1970-01-01T00:00:00Z'', non-inclusive of leap-seconds. 1025 \emph{Times will always be expressed in the 'UTC timezone'. Use of the local 1026 timezone is forbidden.} 1019 For ease of conversion, UTC should be represented as the number of 1020 seconds since the UNIX epoch of ``1970-01-01T00:00:00Z'', 1021 non-inclusive of leap-seconds. \tbd{what does this statement 1022 actually mean? what is the source of time (gettimeofday? let's be 1023 explicit here} 1024 1025 \tbd{Times will always be expressed in the 'UTC timezone'. Use of 1026 the local timezone is forbidden. -- this makes no sense given that we 1027 define LST. In any case, this statement, or somethign equivalent, 1028 belongs in the SDRS not the ADD} 1027 1029 1028 1030 \subsubsection{International Atomic Time (TAI)} … … 1040 1042 1041 1043 For ease of conversion, TAI should be represented as the number of 1042 seconds since the UNIX epoch of ``1970-01-01T00:00:00Z''. 1044 seconds since the UNIX epoch of ``1970-01-01T00:00:00Z''. \tbd{what 1045 does this statement actually mean?} 1043 1046 1044 1047 \subsubsection{Leap-seconds} … … 1076 1079 local disk in a known location (i.e., there is no need that it is 1077 1080 downloaded from the internet by PSLib). Later, the location of this 1078 file will be made configurable. 1079 1080 This data is available from: \code{ftp://maia.usno.navy.mil/ser7/tai-utc.dat} 1081 file will be made configurable. This data is available from 1082 USNO\footnote{ftp://maia.usno.navy.mil/ser7/tai-utc.dat}. 1083 1084 \subsubsection{Universal Time (UT1)} 1085 \label{sec:ut1} 1086 1087 UT1 is directly tied to the rotation of the Earth. Historically, time 1088 has been measured with respect to the rising and setting of the 1089 Sun. However, in the modern era of atomic clocks, the rotation of the 1090 Earth makes for a highly unstable time standard. Tidal effects, 1091 changes in the angular momentum of the atmosphere, seasonal changes in 1092 the polar ice caps, movement within the Earth's core, and other 1093 effects all cause measurable changes in the Earth's rotation on a 1094 daily basis. However, UT1 is still vitally important for determining 1095 the orientation of the Earth with respect to the sky. UT1 is 1096 calculated by applying the value UT1-UTC to the value of UTC. UT1 is 1097 continuously measured by the International Earth Rotation Service, and 1098 tabulated values of the offset of UT1 from UTC are published at 1099 regular intervals, along with predicted future values. The process of 1100 calculating the UT1-UTC offsets are discussed in the section on Earth 1101 Orientation (Section~\ref{sec:ut1}). 1081 1102 1082 1103 \subsubsection{Gregorian dates to seconds} … … 1209 1230 1210 1231 1211 \subsubsection{Universal Time (UT1)}1212 \label{sec:ut1}1213 1214 UT1 is directly tied to the rotation of the Earth. Historically, time has been1215 measured with respect to the rising and setting of the Sun. However, in the1216 modern era of atomic clocks, the rotation of the Earth makes for a highly1217 unstable time standard. Tidal effects, changes in the angular momentum of the1218 atmosphere, seasonal changes in the polar ice caps, movement within the Earth's1219 core, and other effects all cause measurable changes in the Earth's rotation on1220 a daily basis. However, UT1 is still vitally important for determining the1221 orientation of the Earth with respect to the sky.1222 1223 Since 2003-01-01, UT1 has been defined as directly proportional to the Earth1224 Rotation Angle (see IERS Technical Note 32\footnote{IERS Technical Note 32 -1225 http://maia.usno.navy.mil/conv2003.html}). Previous to that date, a different1226 definition was in effect (see IERS Technical Note 21\footnote{IERS Technical1227 Note 21 - http://maia.usno.navy.mil/conventions.html}). We will always use the1228 post-2003 definition.1229 1230 UT1 is continuously measured by the International Earth Rotation Service, and1231 tabulated values of the offset of UT1 from UTC are published at regular1232 intervals, along with predicted future values. IERS Bulletin A gives ``rapid1233 response'' values necessary for real-time and near real-time data analysis1234 (such as Pan-STARRS Otis and IPP subsystems). Bulletin B gives the results of a1235 final, definitive data reduction. An amalgam of Bulletin A and B values is1236 published daily on the IERS website\footnote{IERS Bulletin A \& B -1237 http://maia.usno.navy.mil/ser7/finals2000A.daily} along with a desciption of1238 the format\footnote{IERS finals2000A.daily table format -1239 http://maia.usno.navy.mil/ser7/readme.finals2000A}.1240 1241 The UT1 offsets should be interpolated using the prescription of IERS Gazette1242 \#13\footnote{IERS Gazette \#13 - http://maia.usno.navy.mil/iers-gaz13}. This1243 entails using a third order polynomial to interpolate the table values, and1244 then applying a model for diurnal and semi-diurnal fluctuations due to tidal1245 effects. An example implimentation\footnote{interp.f -1246 ftp://maia.usno.navy.mil/dist/interp.f} written in Fortran is available.1247 1248 \verbatiminput{interp.f}1249 1250 The Polar motion X, and Y coordinates are also important for determining the1251 orientation of the Earth with respect to the sky. This is also given in the1252 IERS publications references above, and should be interpolated in the same way.1253 1254 1232 \subsubsection{Julian Date and Modified Julian Date} 1255 1233 … … 1369 1347 1370 1348 Gives $GMST00$ in seconds. 1371 1372 \subsubsection{Longitude}1373 1374 Longitudes are often expressed in the form of decimal degrees while the1375 algorithm for calculating GMST outputs seconds.1376 1377 \begin{equation}1378 1\degree = 240s1379 \end{equation}1380 1381 \subsubsection{Polar Motion}1382 \tbd{move this to Earth Motion section}1383 1384 The polar coordinates, $x_p$ and $y_p$, required for the transformation from1385 tangent plane to celestial coordiates (and hence \code{psGrommit}), may be1386 calculated through table lookups.1387 1388 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%1389 1349 1390 1350 \subsection{2D transformations} … … 1442 1402 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1443 1403 1444 \subsection{Spherical Rotations with Quaternions} 1404 \subsection{Spherical Rotations} 1405 1406 Spherical rotations may be implemented with a variety of mathematical 1407 methods. A single rotation may be specified by three angles which 1408 describe rotations about the principal axes. Figure~\ref{rotations} 1409 shows the rotation angles for an arbitrary 3-D rotation. A single 1410 rotation may be represented by defining this set of Euler angles. As 1411 an alternative, the quaternion is a convenient construct with which to 1412 represent a single rotation, and it has useful mathematical properties 1413 when applying those rotations. 1414 1415 \begin{figure} 1416 \begin{center} 1417 \psfig{file=rotations.ps} 1418 \caption{Definition of the rotation angles\label{rotations}} 1419 \end{center} 1420 \end{figure} 1445 1421 1446 1422 \subsubsection{Quaternion Construction} … … 1459 1435 Note that the sine and cosine are taken of the half angle of the 1460 1436 rotation. Note also that this implies that the quaternion components 1461 are normalized such that $|\bar{q}| \ defq_0^2 + q_1^2 + q_2^2 + q_3^21437 are normalized such that $|\bar{q}| \equiv q_0^2 + q_1^2 + q_2^2 + q_3^2 1462 1438 = 1$. 1463 1439 … … 1472 1448 \subsubsection{Combining Two Rotations} 1473 1449 1474 Given two quaternions $\bar{ p1}$ and $\bar{p2}$, there is a third1450 Given two quaternions $\bar{a}$ and $\bar{b}$, there is a third 1475 1451 quaternion, $\bar{p}$, which represents the result of first applying 1476 $\bar{ p1}$, and then $\bar{p2}$. The components of $\bar{p}$ are given1452 $\bar{a}$, and then $\bar{b}$. The components of $\bar{p}$ are given 1477 1453 by: 1478 1454 1479 \begin{ verbatim}1480 p_0 & = & p2_3 p1_0 + p2_2 p1_1 - p2_1 p1_2 + p2_0 p1_3 \\1481 p_1 & = & - p2_2 p1_0 + p2_3 p1_1 + p2_0 p1_2 + p2_1 p1_3 \\1482 p_2 & = & p2_1 p1_0 - p2_0 p1_1 + p2_3 p1_2 + p2_2 p1_3 \\1483 p_3 & = & - p2_0 p1_0 - p2_1 p1_1 - p2_2 p1_2 + p2_3 p1_3 \\1484 \end{ verbatim}1455 \begin{eqnarray} 1456 p_0 & = & b_3 a_0 + b_2 a_1 - b_1 a_2 + b_0 a_3 \\ 1457 p_1 & = & -b_2 a_0 + b_3 a_1 + b_0 a_2 + b_1 a_3 \\ 1458 p_2 & = & b_1 a_0 - b_0 a_1 + b_3 a_2 + b_2 a_3 \\ 1459 p_3 & = & -b_0 a_0 - b_1 a_1 - b_2 a_2 + b_3 a_3 \\ 1460 \end{eqnarray} 1485 1461 1486 1462 \subsubsection{Rotating a Vector} 1487 1463 1488 1464 You may rotate a unit vector by first constructing a quaternion 1489 $\bar{ p2}$, whose first three components are the components of the1465 $\bar{b}$, whose first three components are the components of the 1490 1466 unit vector, and whose fourth component is zero. To rotate this vector 1491 by a quaternion $\bar{ p1}$, you apply the formula above for combining1467 by a quaternion $\bar{a}$, you apply the formula above for combining 1492 1468 two quaternions. The rotated vector is found in the first three 1493 1469 components of the resulting quaternion, $\bar{p}$. … … 1503 1479 rot_{y,y} & = & -q_0 q_0 + q_1 q_1 - q_2 q_2 + q_3 q_3 \\ 1504 1480 rot_{z,z} & = & -q_0 q_0 - q_1 q_1 + q_2 q_2 + q_3 q_3 \\ 1505 1506 1481 rot_{x,y} & = & 2 (q_0 q_1 + q_2 q_3) \\ 1507 1482 rot_{y,x} & = & 2 (q_0 q_1 - q_2 q_3) \\ 1508 1509 1483 rot_{x,z} & = & 2 (q_0 q_2 - q_1 q_3) \\ 1510 1484 rot_{z,x} & = & 2 (q_0 q_2 + q_1 q_3) \\ 1511 1512 1485 rot_{y,z} & = & 2 (q_1 q_2 + q_0 q_3) \\ 1513 1486 rot_{z,y} & = & 2 (q_1 q_2 - q_0 q_3) \\ … … 1576 1549 \end{itemize} 1577 1550 Note that $\theta_p$, the latitude of the source system pole in the 1578 target system, is equal to $\delta_p$ by symmetry. 1551 target system, is equal to $\delta_p$ by symmetry. Transformations 1552 between arbitrary systems are specified by determining the appropriate 1553 values of $\alpha_p$, $\delta_p$, and $\phi_p$, and then constructing 1554 the quarternion for this transformation. 1555 1556 \tbd{can we drop this, since we do this with the quaternion?} 1579 1557 1580 1558 The relevant trigonometric relationships are: … … 1627 1605 \subsubsection{Precession} 1628 1606 1629 The appropriate values, from Elixir, are: 1607 Approximate precession, good for modest sub-arcsecond precision, may 1608 be rapidly calculated using the following rotation angles: 1630 1609 \begin{eqnarray} 1631 1610 \alpha_p & = & 90^\circ - (0^\circ.6406161\, T + 0^\circ.0000839\, T^2 + 0^\circ.0000050\, T^3) \\ … … 1660 1639 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1661 1640 1662 \subsection{Tangent Plane to Sky} 1663 1664 \tbd{we will replace the SLALIB version of AOPPA with a new function} 1665 1666 Mappings between the tangent plane and the sky will be implemented 1667 using SLALIB. 1668 1669 To speed up the transformations, SLALIB allows the storage of 1670 ``apparent-to-observed parameters'', which will be contained in a 1671 \code{psGrommit}. The \code{psGrommit} consists of the following: 1672 \begin{enumerate} 1673 \item geodetic latitude (radians) 1674 \item sine and cosine of geodetic latitude 1675 \item magnitude of diurnal aberration vector 1676 \item height (metres) 1677 \item ambient temperature (degrees K) 1678 \item pressure (mB) 1679 \item relative humidity (0--1) 1680 \item wavelength ($\mu$m) 1681 \item lapse rate (degrees K per metre) 1682 \item refraction constants A and B (radians) 1683 \item longitude + eqn of equinoxes + ``sidereal $\Delta$ UT'' (radians) 1684 \item local apparent sidereal time (radians) 1685 \end{enumerate} 1686 These may be calculated using \code{sla_AOPPA}. Note that a 1687 \code{psGrommit} is only appropriate for a single exposure. 1688 1689 Once the \code{psGrommit} has been calculated, the functions 1690 \code{sla_OAPQK} and \code{sla_AOPQK} convert from the tangent plane 1691 to the sky, and the sky to the tangent plane, respectively. (Note 1692 that ``observed'' in SLALIB refers to the tangent plane, and 1693 ``apparent'' refers to the apparent position on the sky.) 1694 1695 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1696 1697 \subsection{Sky to Tangent Plane (II)} 1641 \subsection{Sky to Tangent Plane} 1698 1642 1699 1643 This section describes the transformation between celestial coordinates … … 1725 1669 1726 1670 \begin{figure} 1727 \psfig{file=transforms.ps} 1728 \caption{Coordinates systems and the transformations between them} 1729 1671 \begin{center} 1672 \psfig{file=earthrot.ps} 1673 \caption{Coordinates systems and the transformations between them\label{earthrot}} 1674 \end{center} 1730 1675 \end{figure} 1731 Figure X shows the transformation steps and intermediate coordinate systems 1732 between celestial and local terrestrial coordinate systems. The intermediate 1733 coordinate systems are defined below. 1676 1677 Figure~\ref{earthrot} shows the transformation steps and intermediate 1678 coordinate systems between celestial and local terrestrial coordinate 1679 systems. The intermediate coordinate systems are defined below. 1734 1680 1735 1681 \paragraph{ICRS} … … 1786 1732 \paragraph{Gravitational Deflection} 1787 1733 1788 The Sun's gravity bends the path of light rays which pass near it. 1789 To first order, a light ray is deflected by an angle of $4GM/c^2r_0$ radians, 1790 where $G$ is the gravitational constant, 1791 $M$ is the mass of the Sun, 1792 $c$ is the speed of light, and 1793 $r_0$ is the point of closest approach to the light ray to the Sun. 1794 To the same order this is equal to the impact parameter - i.e. the point 1795 of closest approach if the light ray were not deflected. Note that 1796 $r_0/d = \tan(\theta)$, where $d$ is the distance from the Earth 1797 to the Sun, and $\theta$ 1798 is the angular separation of the star from the center of the Sun. 1799 1800 There is a maximum deflection of 1.75 arc seconds if we set 1801 $r_0$ to the radius of the sun. 1802 Since the Sun bends light rays toward it, a star appears shifted away from the sun in the sky. 1734 The Sun's gravity bends the path of light rays which pass near it. To 1735 first order, a light ray is deflected by an angle of $4GM/c^2r_0$ 1736 radians, where $G$ is the gravitational constant, $M$ is the mass of 1737 the Sun, $c$ is the speed of light, and $r_0$ is the point of closest 1738 approach to the light ray to the Sun. To the same order this is equal 1739 to the impact parameter - i.e. the point of closest approach if the 1740 light ray were not deflected. Note that $r_0/d = \tan(\theta)$, where 1741 $d$ is the distance from the Earth to the Sun, and $\theta$ is the 1742 angular separation of the star from the center of the Sun. 1743 1744 There is a maximum deflection of 1.75 arc seconds if we set $r_0$ to 1745 the radius of the sun. Since the Sun bends light rays toward it, a 1746 star appears shifted away from the sun in the sky. 1803 1747 1804 1748 \paragraph{Aberration} 1805 1749 1806 Aberration is the apparent change in direction of a ray of light in the1807 reference frame of a moving observer. Traditionally the aberration1750 Aberration is the apparent change in direction of a ray of light in 1751 the reference frame of a moving observer. Traditionally the aberration 1808 1752 calculation has been done with a linear expansion of the full 1809 1753 relativistic expression, often neglecting all but the linear term in 1810 $v/c$, since the relativistic terms are on the order of a miliarcsecond. 1811 However, the full relativistic expression poses no challenge for modern 1812 computers, so psLib will use the following procedure to calculate aberration. 1754 $v/c$, since the relativistic terms are on the order of a 1755 miliarcsecond. However, the full relativistic expression poses no 1756 challenge for modern computers, so psLib will use the following 1757 procedure to calculate aberration. 1813 1758 1814 1759 Suppose an observer has a velocity $\beta\hat{\beta}$, with respect to 1815 1760 the Solar System barycenter, where $\beta$ is in units of the speed of 1816 light, and $\hat{\beta}$ is a unit vector. Suppose also that the unit vector 1817 $\hat{r}$ points toward a star in the barycenter frame of reference 1818 (i.e. the ``actual'' position). 1819 and $\hat{r}'$ gives the direction of the star in the observer's frame, 1820 (i.e. the apparent position). 1821 1822 First, decompose $\hat{r}$ into components parallel and perpendicular to 1823 $\hat{\beta}$ by calculating 1824 $\mu = \hat{r}\cdot\hat{\beta}$ and 1761 light, and $\hat{\beta}$ is a unit vector. Suppose also that the unit 1762 vector $\hat{r}$ points toward a star in the barycenter frame of 1763 reference (i.e. the ``actual'' position). and $\hat{r}'$ gives the 1764 direction of the star in the observer's frame, (i.e. the apparent 1765 position). 1766 1767 First, decompose $\hat{r}$ into components parallel and perpendicular 1768 to $\hat{\beta}$ by calculating $\mu = \hat{r}\cdot\hat{\beta}$ and 1825 1769 $\vec{r}_\perp = \hat{r} - \mu \hat{\beta}$. 1826 1770 … … 1849 1793 relatively rapid rotation of the Earth from the motion of its rotational axis. 1850 1794 1851 This section is largely a summary of 1852 Chapter 5 of IERS Technical Note 32 \footnote{http://maia.usno.navy.mil/conv2003.html} 1853 (hereafter IERS32), 1854 which is a description of the implementation of the Resoltions of the 1855 XXIVth General Assembly of the IAU, available from the same URL as above. 1856 These two documents describe a set of conventions which have been in effect 1857 since 2003-01-01. The conventions in effect before that date will not be 1858 implemented by psLib. 1859 1795 This section is largely a summary of Chapter 5 of IERS Technical Note 1796 32 \footnote{http://maia.usno.navy.mil/conv2003.html} (hereafter 1797 IERS32), which is a description of the implementation of the 1798 Resoltions of the XXIVth General Assembly of the IAU, available from 1799 the same URL as above. These two documents describe a set of 1800 conventions which have been in effect since 2003-01-01. The 1801 conventions in effect before that date will not be implemented by 1802 psLib. 1860 1803 1861 1804 \paragraph{Precession/Nutation} 1862 1805 1863 The transform between the GCRS and the CIP/CEO coordinate systems is described 1864 by the IAU 2000A precession-nutation model, which is accurate to the 1865 0.2 mas level. 1866 For higher accuracy the user must apply corrections to the model, which are tabulated by the IERS. 1867 1868 1869 1870 The IAU 2000A precession-nutation model may be calculated in the following 1871 way. First calculate the time $t$ as the number of Julian centuries since 1872 2000-01-01T12:00:00 TT. 1806 The transform between the GCRS and the CIP/CEO coordinate systems is 1807 described by the IAU 2000A precession-nutation model, which is 1808 accurate to the 0.2 mas level. For higher accuracy the user must 1809 apply corrections to the model, which are tabulated by the IERS. 1810 1811 The IAU 2000A precession-nutation model may be calculated in the 1812 following way. First calculate the time $t$ as the number of Julian 1813 centuries since 2000-01-01T12:00:00 TT. 1873 1814 1874 1815 Next calculate the fundamental arguments of nutation using equations (40) … … 1935 1876 \end{itemize} 1936 1877 1937 1938 A FORTRAN reference implementation for the precession/nutation modelis available from the IERS1878 A FORTRAN reference implementation for the precession/nutation model 1879 is available from the IERS 1939 1880 \footnote{http://maia.usno.navy.mil/conv2000/chapter5/XYS2000A.f}. 1940 1881 The psLib results should agree with the reference implementation to within 1941 1882 the limits of numerical precision. 1942 1883 1943 Next, corrections to $X$, and $Y$ may be obtained from the IERS as part of 1944 Bulletin A, or B. It is recommended to use the values published daily in 1945 http://maia.usno.navy.mil/ser7/finals2000A.daily, which has the format 1946 described by http://maia.usno.navy.mil/ser7/readme.finals2000A. The 1947 quantities of interest are labeled dX and dY. Note that UT1$-$UTC and the 1948 polar motion values are obtained from this same table. 1949 1950 By convention, nutation terms with periods of less 1951 than two days 1952 are accounted for by the corresponding polar motion. So it is sufficient to 1953 interpolate the corrections tabulated daily by the IERS, and take the result as 1954 instantaneous values. 1884 Next, corrections to $X$, and $Y$ may be obtained from the IERS as 1885 part of Bulletin A, or B. It is recommended to use the values 1886 published daily by USNO in the table 1887 \code{finals2000A.daily}\footnote{http://maia.usno.navy.mil/ser7/finals2000A.daily}, 1888 which has the format described by 1889 \code{readme.finals2000A}\footnote{http://maia.usno.navy.mil/ser7/readme.finals2000A}. The 1890 quantities of interest are labeled dX and dY. Note that UT1$-$UTC and 1891 the polar motion values are obtained from this same table. 1892 1893 By convention, nutation terms with periods of less than two days are 1894 accounted for by the corresponding polar motion. So it is sufficient 1895 to interpolate the corrections tabulated daily by the IERS, and take 1896 the result as instantaneous values. 1955 1897 1956 1898 The final step is to use $X$, $Y$, and $s$ to calculate the rotation … … 1987 1929 \paragraph{Polar Motion} 1988 1930 1989 The motion of the CIP in the ITRS is known as ``polar motion''. Similarly to 1990 precession/nutation, the instantaneous position of the CIP in the 1991 ITRS is specified by the quantites $x_p$, and $y_p$, and a third quantity, 1992 $s'$, gives the position of the TEO with respect to the ITRS. 1993 The values of $x_p$ and $y_p$ are published daily by the IERS in 1994 http://maia.usno.navy.mil/ser7/finals2000A.daily, which has the format 1995 described by http://maia.usno.navy.mil/ser7/readme.finals2000A. 1996 The UT1$-$UTC, and the precession/nutation corrections (discussed elsewhere 1997 in this document) come from this same source. 1998 1999 The polar motion coordinates should be interpolated using a third order 2000 polynomial, as described in 2001 IERS Gazette \#13 \footnote{http://maia.usno.navy.mil/iers-gaz13}, 2002 which gives a 2003 FORTRAN reference implementation of the correct procedure. 2004 2005 \tbd{reference to interpolation in this doc?} 1931 The motion of the CIP in the ITRS is known as ``polar 1932 motion''. Similarly to precession/nutation, the instantaneous position 1933 of the CIP in the ITRS is specified by the quantites $x_p$, and $y_p$, 1934 and a third quantity, $s'$, gives the position of the TEO with respect 1935 to the ITRS. The values of $x_p$ and $y_p$ are published daily by the 1936 IERS\footnote{http://maia.usno.navy.mil/ser7/finals2000A.daily}, with 1937 a format described by their 1938 \code{readme.finals2000A}\footnote{http://maia.usno.navy.mil/ser7/readme.finals2000A}. 1939 The UT1$-$UTC, and the precession/nutation corrections (discussed 1940 elsewhere in this document) come from this same source. 1941 1942 The polar motion coordinates should be interpolated using a third 1943 order polynomial, as described in IERS Gazette \#13 1944 \footnote{http://maia.usno.navy.mil/iers-gaz13}, which gives a FORTRAN 1945 reference implementation of the correct procedure. 2006 1946 2007 1947 The values published by the IERS are smoothed to remove noise and 2008 1948 variations on the timescale of a day or less. There are two sources of 2009 short timescale variations - tidal effects on the order of 0.1 milliarcseconds,2010 and short period nutation terms on the order of 15 microarcseconds. 2011 Both of these effects may be modeled and added to the interpolated values 2012 for higher accuracy.2013 2014 The tidal effects should be included using the FORTRAN reference implementation2015 of the Ray tidal model given in IERS Gazette \#13. This code should be 2016 mimiced to machine accuracy by psLib.2017 2018 By definition of the CIP, nutation terms with periods less than 2 days are2019 not included in the IAU 2000A precession/nutation model. 2020 So these motions 2021 m ust be compensated for by their equivalent polar motions. These may2022 be calculated using a form similar to that of the precession/nutation $X$, 2023 and $Y$. The constants to use are given in Table 5.1 of IERS32. 2024 Note that only the terms with periods less than2 days should be used.2025 2026 The quantity $s'$ may be approximated with microarcsecond accuracy over this2027 century by $s' = -4.7 \times 10^{-5} t$ in arcseconds. There is no need 2028 to apply short timescale corrections to $s'$.1949 short timescale variations - tidal effects on the order of 0.1 1950 milliarcseconds, and short period nutation terms on the order of 15 1951 microarcseconds. Both of these effects may be modeled and added to 1952 the interpolated values for higher accuracy. 1953 1954 The tidal effects should be included by using the Ray tidal model 1955 given in IERS Gazette \#13. The definition of this correction is 1956 provided below. 1957 1958 By definition of the CIP, nutation terms with periods less than 2 days 1959 are not included in the IAU 2000A precession/nutation model. So these 1960 motions must be compensated for by their equivalent polar 1961 motions. These may be calculated using a form similar to that of the 1962 precession/nutation $X$, and $Y$. The constants to use are given in 1963 Table 5.1 of IERS32. Note that only the terms with periods less than 1964 2 days should be used. 1965 1966 The quantity $s'$ may be approximated with microarcsecond accuracy 1967 over this century by $s' = -4.7 \times 10^{-5} t$ in arcseconds. There 1968 is no need to apply short timescale corrections to $s'$. 2029 1969 2030 1970 The transform from the ITRS to the CIP/TEO frame can be constructed by 2031 first rotating about the X axis by $y_p$, then rotating about the X axis by 2032 $x_p$, and finally rotating about the Z axis by $s'$. 2033 The IERS reference implementation for this is given in the subroutine 2034 POM2000 \footnote{http://maia.usno.navy.mil/conv2000/chapter5/POM2000.f}. 2035 Note that we describe the transform toward celestial coordinates (upward in 2036 figure X), in order to match the reference implementation. 1971 first rotating about the X axis by $y_p$, then rotating about the X 1972 axis by $x_p$, and finally rotating about the Z axis by $s'$. The 1973 IERS reference implementation for this is given in the subroutine 1974 POM2000 1975 \footnote{http://maia.usno.navy.mil/conv2000/chapter5/POM2000.f}. 1976 Note that we describe the transform toward celestial coordinates 1977 (upward in Figure~\ref{earthrot}), in order to match the reference 1978 implementation. 1979 1980 \subsubsection{Universal Time (UT1)} 1981 \label{sec:ut1} 1982 1983 Since 2003-01-01, UT1 has been defined as directly proportional to the 1984 Earth Rotation Angle (see IERS Technical Note 32\footnote{IERS 1985 Technical Note 32 - http://maia.usno.navy.mil/conv2003.html}). 1986 Previous to that date, a different definition was in effect (see IERS 1987 Technical Note 21\footnote{IERS Technical Note 21 - 1988 http://maia.usno.navy.mil/conventions.html}). We will always use the 1989 post-2003 definition. 1990 1991 UT1 is continuously measured by the International Earth Rotation Service, and 1992 tabulated values of the offset of UT1 from UTC are published at regular 1993 intervals, along with predicted future values. IERS Bulletin A gives ``rapid 1994 response'' values necessary for real-time and near real-time data analysis 1995 (such as Pan-STARRS Otis and IPP subsystems). Bulletin B gives the results of a 1996 final, definitive data reduction. An amalgam of Bulletin A and B values is 1997 published daily on the IERS website\footnote{IERS Bulletin A \& B - 1998 http://maia.usno.navy.mil/ser7/finals2000A.daily} along with a desciption of 1999 the format\footnote{IERS finals2000A.daily table format - 2000 http://maia.usno.navy.mil/ser7/readme.finals2000A}. 2001 2002 The UT1 offsets should be interpolated using the prescription of IERS 2003 Gazette \#13\footnote{IERS Gazette \#13 - 2004 http://maia.usno.navy.mil/iers-gaz13}. This entails using a third 2005 order polynomial to interpolate the table values, and then applying a 2006 model for diurnal and semi-diurnal fluctuations due to tidal effects. 2007 An example implimentation\footnote{interp.f - 2008 ftp://maia.usno.navy.mil/dist/interp.f} written in Fortran is 2009 available. The interpolated value of $dT$ must then have the tidal 2010 correction from the Ray Tidal Model applied. 2011 2012 \subsubsection{Ray Tidal Model} 2013 2014 The Ray Model tidal corrections to X, Y, and dT are given by the the 2015 Fortran code listed below. The input information is the epoch of 2016 interest in MJD, while the output results are the corrections $C_x$, 2017 $C_y$, and $C_dt$, which are in turn added to the interpolated values 2018 determined above. 2019 2020 \verbatiminput{raymodel.f} 2021 2022 The Polar motion X, and Y coordinates are also important for determining the 2023 orientation of the Earth with respect to the sky. This is also given in the 2024 IERS publications references above, and should be interpolated in the same way. 2025 2026 \subsubsection{Longitude} 2027 2028 Longitudes are often expressed in the form of decimal degrees while the 2029 algorithm for calculating GMST outputs seconds. 2030 2031 \begin{equation} 2032 1\degree = 240s 2033 \end{equation} 2034 2035 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2037 2036 2038 2037 \subsubsection{ITRS - Alt/Az} … … 2344 2343 \subsection{Positions of Major Solar System Objects} 2345 2344 2346 \tbd{ephemerides code to replace this }2345 \tbd{ephemerides code to replace this?} 2347 2346 2348 2347 The SLALIB function \code{SLA_RDPLAN} returns the apparent position of … … 2358 2357 2359 2358 \pagebreak 2359 2360 2360 \section{Pan-STARRS Modules} 2361 2361
Note:
See TracChangeset
for help on using the changeset viewer.
