Changeset 1554
- Timestamp:
- Aug 16, 2004, 3:56:41 PM (22 years ago)
- Location:
- trunk/doc/pslib
- Files:
-
- 2 edited
-
psLibADD.tex (modified) (10 diffs)
-
psLibSDRS.tex (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/pslib/psLibADD.tex
r1548 r1554 1 %%% $Id: psLibADD.tex,v 1.2 4 2004-08-16 19:12:54eugene Exp $1 %%% $Id: psLibADD.tex,v 1.25 2004-08-17 01:56:41 eugene Exp $ 2 2 \documentclass[panstarrs]{panstarrs} 3 3 … … 644 644 645 645 Correct time representation is critical in astronomical software. 646 PSLib uses the \code{psTime} structure to represent all time 647 values. This structure represents a time which is equivalent to TAI 648 (International Atomic Time) and has the following properties: 649 \begin{itemize} 650 \item it represents both seconds and microseconds 651 \item the seconds are continuous (no leap seconds) 652 \item the zero reference point is \tbd{1970/01/01,00:00:10} UTC. 653 \end{itemize} 646 PSLib uses the \code{psTime} structure to represent all time values. 647 This structure represents a time which is consists of seconds and 648 fractions of seconds in a time system defined by the \code{psTimeType} 649 element \code{type}. Two possible time systems are currently 650 available: TAI and UTC. Both are defined in terms of the reference 651 epoch 1970-01-01T00:00:00Z, but with minor modifications for 652 leap-seconds as needed. The first represenatation, TAI (International 653 Atomic Time), has seconds of uniform length and no leap seconds. The 654 exact zero reference is 1970/01/01,00:00:10 UTC. The second 655 representations is UTC, which has seconds of uniform length and 656 leap-seconds as needed to adjust it to remain within 0.9 seconds of 657 the Earth's rotation. It has a zero-point of exactly 658 1970/01/01,00:00:00 UTC. 654 659 655 660 Julian Day (JD) and Modified Julian Day (MJD) are both continuous time … … 708 713 \end{verbatim} 709 714 715 The conversion from a time and longitude to local mean sidereal time 716 is performed using the SLA Lib function \code{sla_GMST}. This 717 function requires the value $\Delta$ UT1 = UTC - UT1. The value of 718 $\Delta$ UT1 may be determined from the following site in real time: 719 720 \code{ftp://maia.usno.navy.mil/ser7/ser7.dat} 721 722 In addition, the long-term values may be determined from the table 723 found at: \code{ftp://maia.usno.navy.mil/ser7/finals.all}. See also 724 the web page \code{http://maia.usno.navy.mil/}. The most significant 725 accuracy requirements are for the current value when calculating the 726 LST. For this purpose, the table above (\code{ser7.dat}), which 727 provides predictions over a 2 month period, must be made available 728 locally to PSLib and updated regularly. 729 710 730 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 711 731 … … 842 862 \subsubsection{Projections} 843 863 844 We implement three types of projections , {\em zenithal} and{\em845 cylindrical} and {\em pseudocylindrical} projections. These three846 require slightly different handling. Our representations are based on 847 the treatment ofprojections presented by864 We implement three types of projections: {\em zenithal}, {\em 865 cylindrical} and {\em pseudocylindrical}, each requiring slightly 866 different handling. Our representations are based on the treatment of 867 projections presented by 848 868 \href{http://www.cv.nrao.edu/fits/documents/wcs/wcs.all.ps}{Greisen \& 849 Calabretta (1995, ADASS, 4, 233)}. 869 Calabretta (1995, ADASS, 4, 233)}. In all of these projections, we 870 are converting from a spherical coordinate $\alpha,\delta$ to a linear 871 (2-D) coordinate $x_p,y_p$. The projection is defined by the 872 projection type, the projection center ($\alpha_p, \delta_p$) and the 873 the plate scales in the $x_p$ and $y_p$ directions ($\rho_x,\rho_y$). 874 875 In the structure, \code{psProjection}, the projection type is defined 876 by the element \code{type}, the projection center $\alpha_p,\delta_p$ 877 is defined by the elements \code{R,D}, and the plate scales, 878 $\rho_x,\rho_y$, are defined by the elements \code{Xs,Ys}. The plate 879 scales are applied independently to the $x$ and $y$ coordinates to 880 convert them to the corresponding linear units (ie, pixels): 881 % 882 \begin{eqnarray} 883 x_p & = & \rho_x x \\ 884 y_p & = & \rho_y y \\ 885 \end{eqnarray} 886 % 887 In the discussions below, we ignore this last step (or first step, 888 depending on the direction of the conversion). 850 889 851 890 \paragraph{Zenithal Projections} 852 891 853 892 The {\em zenithal} projections are defined relative to a set of 854 spherical coordinates whose pole is the center of the projection 855 ($\alpha_p, \delta_p$, or \code{psProjection.R, psProjection.D}). In 893 spherical coordinates with pole at the center of the projection 894 ($\alpha_p, \delta_p$), and which thus represents a coordinate system 895 rotated relative to the coordinate system of $\alpha, \delta$. In 856 896 this spherical coordinate system, the coordinate of longitude is 857 897 labeled $\phi$, and has domain of $-\pi < \phi \le \pi$, while the … … 859 899 $0 \le \theta \le \pi$. 860 900 861 For zenithal projections (e.g.\ Gnomonic and Orthographic) the862 following hold:863 %864 \begin{eqnarray}865 x & = & R_\theta \sin \phi \\866 y & = & -R_\theta \cos \phi867 \end{eqnarray}868 %869 and870 %871 \begin{eqnarray}872 R_\theta & = & \sqrt{x^2 + y^2} \\873 \phi & = & {\rm arg} (-y,x)874 \end{eqnarray}875 %876 The coordinates $x,y$ above are defined to be in angular units (ie,877 radians). The plate scales ($\rho_x, \rho_y$ = \code{psProjection.Xs,878 psProjection.Ys}) are applied independently to the $x$ and $y$879 coordinates to convert them to the corresponding linear units (ie,880 pixels):881 %882 \begin{eqnarray}883 x_p & = & \rho_x x \\884 y_p & = & \rho_y y \\885 \end{eqnarray}886 887 901 For an arbitrary projection center, it is necessary to convert the 888 902 spherical coordinates to be projected ($\alpha,\delta$) to the 889 projection spherical coordinate system coordinates ($\phi, \theta$) 890 from which $x,y$ may be calculated using the relationships above, 891 given a prescription for $R_\theta$. In practice, we construct the 892 following useful trigonometric relationships between $\phi$ and 893 $\theta$ which may be employed in the equations of $x,y$ above: 903 projection spherical coordinate system coordinates ($\phi, \theta$). 904 In practice, we construct the following useful trigonometric 905 relationships between $\phi$ and $\theta$ which may be employed in the 906 equations of $x,y$ below: 894 907 % 895 908 \begin{eqnarray} … … 907 920 \end{eqnarray} 908 921 % 922 For zenithal projections, the linear coordinates are related to 923 $\phi,\theta$ by: 924 % 925 \begin{eqnarray} 926 x & = & R_\theta \sin \phi \\ 927 y & = & -R_\theta \cos \phi 928 \end{eqnarray} 929 % 930 and the inverse: 931 % 932 \begin{eqnarray} 933 R_\theta & = & \sqrt{x^2 + y^2} \\ 934 \phi & = & {\rm arg} (-y,x) 935 \end{eqnarray} 936 % 937 The coordinates $x,y$ above are defined to be in angular units (ie, 938 radians). 939 909 940 From these relationships, we can calculate $\alpha, \delta$ as: 910 941 % 911 942 \begin{eqnarray} 912 \alpha - \alpha_p & = & arg (\sin \alpha, \cos \alpha) \\ 913 \delta & = & arcsin (sin \delta) \\ 914 \end{eqnarray} 915 % 916 The necessary relationships for $\phi$ are equivalent for all zenithal projections: 917 % 918 \begin{eqnarray} 919 R_\theta & = & \sqrt{x^2 + y^2} \\ 920 \sin \phi & = & x / R_\theta \\ 921 \cos \phi & = & -y / R_\theta \\ 943 \alpha - \alpha_p & = & \arctan (\sin \alpha, \cos \alpha) \\ 944 \delta & = & \arcsin (\sin \delta) \\ 922 945 \end{eqnarray} 923 946 % … … 933 956 x & = & \frac{\cos \theta \sin \phi}{\sin \theta} \\ 934 957 y & = & \frac{-\cos \theta \cos \phi}{\sin \theta} \\ 935 \sin \theta & = & \zeta / \sqrt (1 + \zeta^2)\\936 \cos \theta & = & 1 / \sqrt (1 + \zeta^2)\\958 \sin \theta & = & \zeta / \sqrt{1 + \zeta^2} \\ 959 \cos \theta & = & 1 / \sqrt{1 + \zeta^2} \\ 937 960 \end{eqnarray} 938 961 … … 958 981 coincident with the pole of the spherical coordinates. These 959 982 projections are particularly used for full-sky representations, and 960 are only defined for projection centers with $\delta_ c= 0$. In this983 are only defined for projection centers with $\delta_p = 0$. In this 961 984 spherical coordinate system, the coordinate of longitude is labeled 962 985 $\phi$, and has domain of $-\pi < \phi \le \pi$, while the latitude, 963 986 measured from the pole, is labeled $\theta$ and has domain $0 \le 964 \theta \le \pi$. The projection center longitude, $\alpha_ c$987 \theta \le \pi$. The projection center longitude, $\alpha_p$ 965 988 corresponds to $\phi = 0$, thus the value of $\phi$ is determined as 966 $\alpha - \alpha_c$ for all such projections. The terms 967 $\alpha_c,\delta_c$ are equivalent to the elements 968 \code{psProjection.R} and \code{psProjection.D}. 989 $\alpha - \alpha_p$ for all such projections. 969 990 970 991 \subparagraph{Cartesian} 971 992 972 The Cartesian projection (``CAR'') is a very simple cylindrical with 973 the following relationships between $x,y$ and $\phi,\theta$: 993 The Cartesian projection (``CAR'') is a very simple cylindrical 994 projection with the following relationships between $x,y$ and 995 $\phi,\theta$: 974 996 975 997 \begin{eqnarray} … … 985 1007 x & = & \phi \\ 986 1008 y & = & \ln \left( \tan (\pi/4 + \theta/2) \right) \\ 987 {\rm and}\hspace{1cm} \theta & = & 2 \arctan \left( e^y \right) - \pi/2 ^\circ1009 {\rm and}\hspace{1cm} \theta & = & 2 \arctan \left( e^y \right) - \pi/2 988 1010 \end{eqnarray} 989 1011 990 1012 \subparagraph{Hammer-Aitoff} 991 1013 992 The Hammer-Aitoff projection is a pseudocylindrical projection, and is defined:993 994 \begin{eqnarray} 995 x & = & 2 \ alpha \cos \theta \sin \frac{\phi}{2} \\996 y & = & \ alpha \sin \theta \\997 {\rm where}\hspace{1cm} \ alpha^{-1} & \equiv & \sqrt{\frac{1}{2}\left(1 + \cos \theta \cos \frac{\phi}{2} \right)}1014 The Hammer-Aitoff projection(``AIT'') is a pseudocylindrical projection, and is defined: 1015 1016 \begin{eqnarray} 1017 x & = & 2 \zeta \cos \theta \sin \frac{\phi}{2} \\ 1018 y & = & \zeta \sin \theta \\ 1019 {\rm where}\hspace{1cm} \zeta^{-1} & \equiv & \sqrt{\frac{1}{2}\left(1 + \cos \theta \cos \frac{\phi}{2} \right)} 998 1020 \end{eqnarray} 999 1021 … … 1001 1023 1002 1024 \begin{eqnarray} 1003 \phi & = & 2 {\rm arg} (2z^2 - 1, x z) \\1025 \phi & = & 2 {\rm \arctan} (2z^2 - 1, x z) \\ 1004 1026 \theta & = & \arcsin (yz) \\ 1005 1027 {\rm where}\hspace{1cm} z & \equiv & \sqrt{1 - (x/2)^2 - y^2} -
trunk/doc/pslib/psLibSDRS.tex
r1539 r1554 1 %%% $Id: psLibSDRS.tex,v 1.7 2 2004-08-14 00:58:46 jhoblittExp $1 %%% $Id: psLibSDRS.tex,v 1.73 2004-08-17 01:56:41 eugene Exp $ 2 2 \documentclass[panstarrs,spec]{panstarrs} 3 3 … … 3031 3031 \subsubsection{Overview} 3032 3032 3033 We require a collection of functions to manipulate time data. These operations 3034 primarily consist of conversions between specific time formats. Internally, 3035 PSLib handles times as struct similar to the POSIX \code{struct timeval} which 3036 has been extended to track the time system being represented. 3037 3038 Conversion from one time system to another is achived by converting first to 3039 TAI and then to the destination type. This allows arbitarily many time system 3040 to be supported by merely add functions to convert to and from TAI. 3041 3042 \subsubsection{Generic Data Structures} 3033 We require a collection of functions to manipulate time data. These 3034 operations primarily consist of conversions between specific time 3035 formats. Internally, PSLib handles times as a structure similar to 3036 the POSIX \code{timeval} which has been extended to track the time 3037 system being represented. 3043 3038 3044 3039 \begin{verbatim} … … 3046 3041 PS_TIME_TAI, ///< seconds since 1970-01-01T00:00:00Z (Gregorian) 3047 3042 PS_TIME_UTC, ///< seconds since 1970-01-01T00:00:00Z (Gregorian) 3048 PS_TIME_UT1, ///< seconds since 1970-01-01T00:00:00Z (Gregorian)3049 PS_TIME_LST, ///< seconds since 1970-01-01T00:00:00Z (Gregorian)3050 3043 } psTimeType; 3051 3044 3052 3045 typedef struct { 3053 3046 psU64 sec; ///< seconds 3054 psU32 nsec; ///< nanoseconds3047 psU32 usec; ///< microseconds 3055 3048 psTimeType type; ///< type of time 3056 3049 } psTime; … … 3059 3052 \subsubsection{Current Date and Time} 3060 3053 3061 A number of functions are provided to get the current time in a particular time 3062 system. 3063 3064 \begin{verbatim} 3065 psTime *psGetTAI(void); 3066 psTime *psGetUTC(void); 3067 psTime *psGetUT1(void); 3068 psTime *psGetLST(psF64 longitude); 3069 psF64 *psGetJD(void); 3070 psF64 *psGetMJD(void); 3071 \end{verbatim} 3072 3073 \subsubsection{Automatic Date and Time Type Conversion} 3074 3075 When converting to a time system the source time system is automaticaly 3076 converted to TAI and then from TAI to the destination type. 3077 3078 \begin{verbatim} 3079 bool psTimeToTAI(psTimeType type, psTime *time); 3080 bool psTimeToUTC(psTimeType type, psTime *time); 3081 bool psTimeToUT1(psTimeType type, psTime *time); 3082 bool psTimeToLST(psTimeType type, psTime *time); 3054 Get the current time (in given system): 3055 3056 \begin{verbatim} 3057 psTime *psTimeGetTime(psTimeType); 3058 \end{verbatim} 3059 3060 \subsubsection{Time Conversion} 3061 3062 Converting between the \code{psTime} time systems is done with: 3063 \begin{verbatim} 3064 psTime *psTimeConvert(psTime *time, psTimeType type); 3065 \end{verbatim} 3066 This function may be used to convert between \code{PS_TIME_TAI} and 3067 \code{PS_TIME_UTC} time representations. 3068 3069 To convert to or from Local Mean Sidereal Time, it is necessary to 3070 provide the local longitude as well: 3071 % 3072 \begin{verbatim} 3073 psTime *psTimeToLST(psTime *time, double longitude); 3074 psTime *psLSTToTime(psTime *time, double longitude); 3075 \end{verbatim} 3076 % 3077 The functions may accept either \code{psTimeType}. Note that this 3078 function must supply the value UT1-UTC, which is available externally 3079 The value UT1-UTC is necessary for this an various other SLALIB 3080 functions. The following utility function encapsulates the PSLib 3081 mechanism to extract the value of UT1-UTC: 3082 \begin{verbatim} 3083 double psGetUT1Delta(psTime *time); 3084 \end{verbatim} 3085 3086 \subsubsection{External Date and Time Formats} 3087 3088 A collection of functions convert from the \code{psTime} types to various 3089 external formats. Note that ISO8601 format is "YYYY-MM-DDThh:mm:ss,sZ" 3090 3091 \begin{verbatim} 3083 3092 psF64 psTimeToJD(psTime *time); 3084 3093 psF64 psTimeToMJD(psTime *time); 3085 \end{verbatim} 3086 3087 \subsubsection{Date and Time Formatting} 3088 3089 A collection of functions convert from the \code{psTime} types to various 3090 external formats. Note that ISO8601 format is "YYYY-MM-DDThh:mm:ss,sZ" 3091 3092 \begin{verbatim} 3093 char *psFormatISO8601(psTime *time); 3094 struct timeval *psFormatTimeval(psTime *time); 3094 char *psTimeToISOTime(psTime *time); 3095 struct timeval *psTimeToTimeval(psTime *time); 3095 3096 \end{verbatim} 3096 3097 … … 3101 3102 3102 3103 \begin{verbatim} 3103 psTime *psParseISO8601(psTimeType type, char *input); 3104 psTime *psParseTimeval(psTimeType type, struct timeval *input); 3105 \end{verbatim} 3106 3107 \subsubsection{Date and Time System Support} 3108 3109 All \code{psTime} types must be able to be converted to to the TAI type. 3110 Conversion from one \code{psTime} type to another is achieved by first 3111 converting to TAI and then to the target type. 3112 3113 \begin{verbatim} 3114 psTime *psTAIToUTC(psTime *time); 3115 psTime *psUTCToTAI(psTime *time); 3116 \end{verbatim} 3117 3118 A utility function provides the current time from the system clock, in correct TAI units: 3119 3120 \begin{verbatim} 3121 psTime *psTAIToUT1(psTime *time); 3122 psTime *psUT1ToTAI(psTime *time); 3123 \end{verbatim} 3124 3125 \begin{verbatim} 3126 psTime *psTAIToLST(psTime *time, double longitude); 3127 psTime *psLSTToTAI(psTime *time, double longitude); 3128 \end{verbatim} 3129 3130 \subsubsection{Utility Functions} 3131 3132 A number of utility functions is needed for type conversion. 3133 3134 \begin{verbatim} 3135 psTime *psUT1ToGMST00(psTime *time); 3136 psTime *psGMST00ToUT1(psTime *time); 3137 \end{verbatim} 3138 3139 \begin{verbatim} 3140 psTime *psGMST00ToLST(psTime *time, double longitude); 3141 psTime *psLSTToGMST00(psTime *time, double longitude); 3142 \end{verbatim} 3143 3144 Conversions to/from Julian Centuries. 3145 3146 \begin{verbatim} 3147 psF64 psJDToJC(psF64 time); 3148 psF64 psJCToJD(psF64 time); 3149 \end{verbatim} 3150 3151 \begin{verbatim} 3152 psF64 psMJDToJC(psF64 time); 3153 psF64 psJCToMJD(psF64 time); 3154 \end{verbatim} 3155 3156 \begin{verbatim} 3157 unsigned int psGetLeapSeconds(psTime *utc); 3158 \end{verbatim} 3159 3160 \begin{verbatim} 3161 double psGetUT1Delta(psTime *tai); 3104 psTime *psJDToTime(psF64 input); 3105 psTime *psMJDToTime(psF64 input); 3106 psTime *psISOTimeToTime(char *input); 3107 psTime *psTimevalToTime(struct timeval *input); 3162 3108 \end{verbatim} 3163 3109 … … 3710 3656 PS_PROJ_AIT, ///< Aitoff projection 3711 3657 PS_PROJ_PAR, ///< Par projection 3712 PS_PROJ_GLS, ///< GLS projection3713 3658 PS_PROJ_NTYPE ///< Number of types; must be last 3714 3659 } psProjectionType;
Note:
See TracChangeset
for help on using the changeset viewer.
