Changeset 1554 for trunk/doc/pslib/psLibSDRS.tex
- Timestamp:
- Aug 16, 2004, 3:56:41 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/doc/pslib/psLibSDRS.tex (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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.
