Changeset 2314
- Timestamp:
- Nov 8, 2004, 5:45:07 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/doc/pslib/psLibSDRS.tex (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/pslib/psLibSDRS.tex
r2300 r2314 1 %%% $Id: psLibSDRS.tex,v 1.14 6 2004-11-08 00:43:20 eugene Exp $1 %%% $Id: psLibSDRS.tex,v 1.147 2004-11-09 03:45:07 price Exp $ 2 2 \documentclass[panstarrs,spec]{panstarrs} 3 3 … … 1725 1725 psVector *index; ///< Index values 1726 1726 psArray *values; ///< Corresponding values: an array of vectors 1727 const char *filename; ///< File from which table was read 1728 const psF64 validFrom, validTo; ///< Range of validity 1727 1729 } psLookupTable; 1728 1730 \end{verbatim} … … 1733 1735 vectors (including the \code{index} and all vectors in the 1734 1736 \code{values} array) may be any numerical type except complex types. 1737 The \code{filename} shall specify the file from which the table is to 1738 be read. The \code{validFrom} and \code{validTo} shall specify the 1739 range of valid values for the index; in most cases, these will simply 1740 be the first and last indices. 1735 1741 1736 1742 The constructor shall be: 1737 1743 \begin{verbatim} 1738 psLookupTable *psLookupTableAlloc(int numValues); 1739 \end{verbatim} 1740 Here the \code{numValues} indicates the number of vectors in the 1744 psLookupTable *psLookupTableAlloc(const char *filename, int numValues); 1745 \end{verbatim} 1746 Here the \const{filename} indicates the file from which the table 1747 shall be read when \code{psLookupTableRead} is 1748 called. \code{numValues} indicates the number of vectors in the 1741 1749 \code{values} array. 1742 1750 … … 1744 1752 1745 1753 \begin{verbatim} 1746 psLookupTable *psLookupTableRead(const char *filename, int numValues); 1747 \end{verbatim} 1748 \code{psLookupTableRead} shall read the file specified by 1749 \code{filename} and import the data into a \code{psLookupTable}. The 1750 file shall be plain text, with index and values on separate lines, 1751 separated by whitespace. Lines commencing with a comment character 1752 (the pound sign, \code{#}) and blank lines shall be ignored. 1753 \code{numValues} in addition to the index shall be read on each line. 1754 If the \code{index} vector is not sorted in the file, the lookup table 1755 shall be sorted prior to the function returning, but no sort shall be 1756 performed if the indices were sorted in the file. 1754 int psLookupTableRead(psLookupTable *table); 1755 \end{verbatim} 1756 \code{psLookupTableRead} shall read the \code{table} from the 1757 appropriate file and import the data into the \code{table}, and set 1758 the \code{validFrom} and \code{validTo} on the basis of the first and 1759 last values in the \code{table}. Sufficient memory shall be allocated 1760 to hold all the data in the specified file. The file shall be plain 1761 text, with index and values on separate lines, separated by 1762 whitespace. Lines commencing with a comment character (the pound 1763 sign, \code{#}) and blank lines shall be ignored. 1764 \code{table->values->n} in addition to the index shall be read on each 1765 line. If the \code{index} vector is not sorted in the file, the 1766 lookup table shall be sorted prior to the function returning, but no 1767 sort shall be performed if the indices were sorted in the file. If 1768 the input \code{table} has already been read from a file, the file 1769 shall be re-read, and the contents replaced. The function shall 1770 return the number of lines read (not including ignored lines). 1757 1771 1758 1772 Interpolation on a lookup table is performed by the following … … 3520 3534 pre-determined values (\S\ref{sec:timeMetadata}). 3521 3535 3522 We define a structure, \code{psTimeTable} to hold a single time table:3523 \begin{verbatim}3524 typedef struct {3525 const char *filename; // Filename of time table3526 const psF64 validFrom, validTo; // MJDs of validity of time table3527 psLookupTable *table; // Lookup table indexed on MJD, with UT1-UTC, xp and yp3528 } psTimeTable;3529 \end{verbatim}3530 3531 The tables shall be read in only when required by the user (hence the3532 \code{loaded} member); once loaded, the table shall remain in memory3533 until the termination of the program. The corresponding constructor3534 shall be:3535 \begin{verbatim}3536 psTimeTable *psTimeTableAlloc(const char *filename, psF64 validFrom, psF64 validTo);3537 \end{verbatim}3538 which simply constructs a \code{psTimeTable} with the appropriate3539 \code{filename}, \code{validFrom} and \code{validTo}. Upon3540 construction, the \code{loaded} member shall be set to \code{false},3541 and the vectors containing the data shall be set to \code{NULL}.3542 3543 The function \code{psTimeTableLoad} shall load a specified time3544 \code{table}, returning \code{true} for success, and \code{false} if3545 the table failed to load. If the \code{table} has already been3546 loaded, then it shall be re-loaded.3547 \begin{verbatim}3548 bool psTimeTableLoad(psTimeTable *table);3549 \end{verbatim}3550 3551 %Given a time \code{table} and a Modified Julian Date, \code{mjd}, at3552 %which to interpolate values, \code{psTimeTableInterpolate} shall3553 %calculate the appropriate UT1-UTC (\code{dut}; if non-\code{NULL}),3554 %and polar motion (\code{xp,yp}; if non-\code{NULL}) by interpolation3555 %on the table. If the \code{mjd} is outside the range of the table or3556 %the interpolation was for some other reason unsuccessful, then the3557 %function shall return \code{false}; otherwise the function shall set3558 %those parameters which are non-\code{NULL} (\code{dut,xp,yp}) and3559 %return \code{true}. If the requested \code{mjd} lies in the range of3560 %the \code{table}, but the \code{table} has not been \code{loaded},3561 %then the function shall call \code{psTimeTableLoad}.3562 %\begin{verbatim}3563 %bool psTimeTableInterpolate(const psTimeTable *table, double *xp,3564 % double *yp, double *dut, psF64 mjd);3565 %\end{verbatim}3566 3567 3536 \paragraph{Time Metadata} 3568 3537 \label{sec:timeMetadata}
Note:
See TracChangeset
for help on using the changeset viewer.
