Changeset 1767
- Timestamp:
- Sep 9, 2004, 2:17:59 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/doc/pslib/psLibSDRS.tex (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/pslib/psLibSDRS.tex
r1766 r1767 1 %%% $Id: psLibSDRS.tex,v 1.11 8 2004-09-09 23:48:55 jhoblittExp $1 %%% $Id: psLibSDRS.tex,v 1.119 2004-09-10 00:17:59 price Exp $ 2 2 \documentclass[panstarrs,spec]{panstarrs} 3 3 … … 176 176 \item Set the error codes for PSLib. 177 177 \item Seed the random number generator. 178 \item Read the \code{psTimeTable} configuration file and set up the 179 appropriate \code{psTimeTable}s and predictions. 178 180 \end{itemize} 179 181 … … 3231 3233 Time math is only done on the \code{psTime} TAI type. 3232 3234 3235 \subsubsection{Time Tables} 3236 3237 The offset of UTC from UT1, $\Delta$UT = UT1-UTC, as well as the polar 3238 motion, $x_p$ and $y_p$, may be determined from table lookups. Tables 3239 are available covering different time periods and with different time 3240 resolution, and so it is important to be able to utilise multiple 3241 tables. Some tables may be found at: 3242 3243 \begin{itemize} 3244 \item \code{ftp://maia.usno.navy.mil/ser7/ser7.dat} 3245 \item \code{ftp://maia.usno.navy.mil/ser7/finals.all} with explanatory 3246 guide at \code{ftp://maia.usno.navy.mil/ser7/readme.finals} . See also 3247 the web page \code{http://maia.usno.navy.mil/}. 3248 \item \code{http://hpiers.obspm.fr/eoppc/eop/eopc01/eopc01.1900-2004} 3249 (contains estimates prior to 1972). 3250 \end{itemize} 3251 3252 The tables shall reside on local disk in known locations (i.e., there 3253 is no need that they are downloaded from the internet and parsed by 3254 PSLib). The format of these files shall be simple, for speed in 3255 reading: Each line shall contain the MJD, $x_p$ (in arcseconds), $y_p$ 3256 (in arcseconds) and $\Delta$UT (in seconds) separated by whitespace; 3257 blank lines and lines commencing with the comment character (the hash 3258 symbol, \code{#}) as the first character shall be ignored. For 3259 example: 3260 3261 \begin{verbatim} 3262 # Bulletin A, 9 September 2004. 3263 # ftp://maia.usno.navy.mil/ser7/ser7.dat 3264 # MJD XP(") YP(") UT1-UTC(s) 3265 53258 0.1715 0.4774 -0.45092 3266 53259 0.1734 0.4757 -0.45039 3267 53260 0.1753 0.4741 -0.45012 3268 53261 0.1770 0.4724 -0.45015 3269 53262 0.1787 0.4708 -0.45045 3270 \end{verbatim} 3271 3272 The location of these files, their priority order, and the ``from'' 3273 and ``to'' dates of applicability will be specified through metadata 3274 (\S\ref{sec:timeMetadata}). 3275 3276 When a value is required, the tables shall shall be checked in 3277 priority order to see if the date is within the range of applicability 3278 for the table. If a table is found that is applicable, then the 3279 appropriate value shall be derived from linear interpolation between 3280 the nearest entries in the table. If no table is found that is 3281 applicable, and the required date is later than those covered in the 3282 tables, a warning shall be generated, and a pre-determined formula 3283 shall be applied (\S\ref{sec:timeMetadata}). For dates prior to those 3284 covered in the tables, the function shall generate a warning and use 3285 pre-determined values (\S\ref{sec:timeMetadata}). 3286 3287 We define a structure, \code{psTimeTable} to hold a single time table: 3288 \begin{verbatim} 3289 typedef struct { 3290 const char *filename; // Filename of time table 3291 const psF64 validFrom, validTo; // MJDs of validity of time table 3292 bool loaded; // Has the table been loaded? 3293 psVector *mjd; // MJD data, type is psF64 3294 psVector *dut; // delta UT = UT1 - UTC data 3295 psVector *xp, *yp; // Polar motion data 3296 } psTimeTable; 3297 \end{verbatim} 3298 3299 The tables shall be read in only when required by the user (hence the 3300 \code{loaded} member); once loaded, the table shall remain in memory 3301 until the termination of the program. The corresponding constructor 3302 shall be: 3303 \begin{verbatim} 3304 psTimeTable *psTimeTableAlloc(const char *filename, psF64 validFrom, psF64 validTo); 3305 \end{verbatim} 3306 which simply constructs a \code{psTimeTable} with the appropriate 3307 \code{filename}, \code{validFrom} and \code{validTo}. Upon 3308 construction, the \code{loaded} member shall be set to \code{false}, 3309 and the vectors containing the data shall be set to \code{NULL}. 3310 3311 The function \code{psTimeTableLoad} shall load a specified time 3312 \code{table}, returning \code{true} for success, and \code{false} if 3313 the table failed to load. If the \code{table} has already been 3314 loaded, then it shall be re-loaded. 3315 \begin{verbatim} 3316 bool psTimeTableLoad(psTimeTable *table); 3317 \end{verbatim} 3318 3319 Given a time \code{table} and a Modified Julian Date, \code{mjd}, at 3320 which to interpolate values, \code{psTimeTableInterpolate} shall 3321 calculate the appropriate UT1-UTC (\code{dut}; if non-\code{NULL}), 3322 and polar motion (\code{xp,yp}; if non-\code{NULL}) by interpolation 3323 on the table. If the \code{mjd} is outside the range of the table or 3324 the interpolation was for some other reason unsuccessful, then the 3325 function shall return \code{false}; otherwise the function shall set 3326 those parameters which are non-\code{NULL} (\code{dut,xp,yp}) and 3327 return \code{true}. If the requested \code{mjd} lies in the range of 3328 the \code{table}, but the \code{table} has not been \code{loaded}, 3329 then the function shall call \code{psTimeTableLoad}. 3330 \begin{verbatim} 3331 bool psTimeTableInterpolate(const psTimeTable *table, double *xp, 3332 double *yp, double *dut, psF64 mjd); 3333 \end{verbatim} 3334 3335 \paragraph{Time Metadata} 3336 \label{sec:timeMetadata} 3337 3338 The following metadata keys will be used in time calculations: 3339 3340 \begin{tabular}{l|l} \hline 3341 Metadata key & Purpose \\ \hline 3342 psLib.time.tables.files & Time table file names (space-delimited) \\ 3343 psLib.time.tables.from & Time tables are valid from these MJDs (vector) \\ 3344 psLib.time.tables.to & Time tables are valid to these MJDs (vector) \\ 3345 psLib.time.before.xp & Value of XP for before the earliest MJD \\ 3346 psLib.time.before.yp & Value of YP for before the earliest MJD \\ 3347 psLib.time.before.dut & Value of UT1-UTC for before the earliest MJD \\ 3348 pslib.time.predict.xp & A vector containing the $x_p$ prediction formula coefficients \\ 3349 pslib.time.predict.yp & A vector containing the $y_p$ prediction formula coefficients \\ 3350 pslib.time.predict.mjd & A value containing the MJD offset for temporary variables \\ 3351 pslib.time.predict.dut & A vector containing the UT1-UTC prediction formula coefficients \\ 3352 \hline 3353 \end{tabular} 3354 3355 These metadata keys shall reside in a configuration file 3356 (\S\ref{sec:configspec}), \code{psTime.config}, which shall be loaded 3357 into a \code{psMetadata} structure private to \code{psTime}, as part 3358 of \code{psLibInit}. An example of \code{psTime.config} follows: 3359 3360 \begin{verbatim} 3361 # This configuration file specifies values required for time calculations by psLib. 3362 psLib.time.tables.n U8 2 # Number of time tables 3363 psLib.time.tables.files STR bulletinA_09Sep2004.dat eopc01_1900_2004.40.dat # These are the file names 3364 @psLib.time.tables.from F64 53258.0, 15020.0 # Valid from these MJDs 3365 @psLib.time.tables.to F64 53622.0, 53258.0 # Valid to these MJDs 3366 psLib.time.before.xp F64 0.0 # Value of XP for before the earliest MJD 3367 psLib.time.before.yp F64 0.0 # Value of YP for before the earliest MJD 3368 psLib.time.before.dut F64 0.0 # Value of UT1-UTC for before the earliest MJD 3369 3370 # Now follows formulae for predicting ahead of the most recent available table entry. 3371 # xp = [0] + [1]*cos A + [2]*sin A + [3]*cos C + [4]*sin C 3372 # yp = [0] + [1]*cos A + [2]*sin A + [3]*cos C + [4]*sin C 3373 # A = 2*pi*(MJD - pslib.time.predict.mjd)/365.25 3374 # C = 2*pi*(MJD - pslib.time.predict.mjd)/435.0 3375 # dut = ut1-utc = [0] + [1]*(MJD - [2]) - (UT2-UT1) 3376 # ut2-ut1 = 0.022 sin(2*pi*T) - 0.012 cos(2*pi*T) - 0.006 sin(4*pi*T) + 0.007 cos(4*pi*T) 3377 # T = 2000.0 + (MJD - 51544.03)/365.2422 3378 @psLib.time.predict.xp F64 0.0569, 0.0555, -0.0200, 0.0513, 0.1483 3379 @psLib.time.predict.yp F64 0.3498, -0.0176, -0.0498, 0.1483, -0.0513 3380 psLib.time.predict.mjd F64 53257.0 3381 @psLib.time.predict.dut F64 -0.4944, -0.00023, 53262.0 3382 \end{verbatim} 3383 3233 3384 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3234 3385
Note:
See TracChangeset
for help on using the changeset viewer.
