IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 2188


Ignore:
Timestamp:
Oct 21, 2004, 12:40:25 PM (22 years ago)
Author:
Paul Price
Message:

Added psLookupTable, and removed psTimeTableInterpolate (now redundant).

Location:
trunk/doc/pslib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/pslib/ChangeLogSDRS.tex

    r2187 r2188  
    1 %%% $Id: ChangeLogSDRS.tex,v 1.36 2004-10-21 21:54:57 price Exp $
     1%%% $Id: ChangeLogSDRS.tex,v 1.37 2004-10-21 22:40:25 price Exp $
    22
    33\subsection{Changes from version 00 to version 01}
     
    352352\item In \code{psVectorStats} and \code{psVectorHistogram}, the \code{errors}
    353353vector must be of the same type as the input values vector.
     354\item Added \code{psLookupTable} section, and removed
     355  \code{psTimeTableInterpolate} (now redundant).
    354356\end{itemize}
  • trunk/doc/pslib/psLibSDRS.tex

    r2187 r2188  
    1 %%% $Id: psLibSDRS.tex,v 1.139 2004-10-21 21:55:03 price Exp $
     1%%% $Id: psLibSDRS.tex,v 1.140 2004-10-21 22:39:57 price Exp $
    22\documentclass[panstarrs,spec]{panstarrs}
    33
     
    17171717\code{psHash} table as a linked list.
    17181718
     1719\subsection{Lookup Tables}
     1720
     1721Lookup tables store a variety of values indexed on a certain column.
     1722An example is for storing the difference between UT1 and UTC, and the
     1723polar motion vector as a function of date.
     1724
     1725\begin{verbatim}
     1726typedef struct {
     1727    psVector *index;                    ///< Index values
     1728    psArray *values;                    ///< Corresponding values: an array of vectors
     1729} psLookupTable;
     1730\end{verbatim}
     1731
     1732\code{index} shall contain the index values, which shall be sorted in
     1733increasing order.  The \code{values} shall consist of an array of
     1734vectors, each of the same length as the \code{index} vector.  The
     1735vectors (including the \code{index} and all vectors in the
     1736\code{values} array) may be any numerical type except complex types.
     1737
     1738The constructor shall be:
     1739\begin{verbatim}
     1740psLookupTable *psLookupTableAlloc(int numValues);
     1741\end{verbatim}
     1742Here the \code{numValues} indicates the number of vectors in the
     1743\code{values} array.
     1744
     1745The destructor shall also free the components.
     1746
     1747\begin{verbatim}
     1748psLookupTable *psLookupTableRead(const char *filename, int numValues);
     1749\end{verbatim}
     1750\code{psLookupTableRead} shall read the file specified by
     1751\code{filename} and import the data into a \code{psLookupTable}.  The
     1752file shall be plain text, with index and values on separate lines,
     1753separated by whitespace.  Lines commencing with a comment character
     1754(the pound sign, \code{#}) and blank lines shall be ignored.
     1755\code{numValues} in addition to the index shall be read on each line.
     1756If the \code{index} vector is not sorted in the file, the lookup table
     1757shall be sorted prior to the function returning, but no sort shall be
     1758performed if the indices were sorted in the file.
     1759
     1760Interpolation on a lookup table is performed by the following
     1761functions:
     1762\begin{verbatim}
     1763psF64 psLookupTableInterpolate(psLookupTable *table, psF64 index, int column);
     1764psVector *psLookupTableInterpolateAll(psLookupTable *table, psF64 index);
     1765\end{verbatim}
     1766Both functions shall interpolate the \code{table} at the provided
     1767\code{index}.  For \code{psLookupTableInterpolate}, only the value in
     1768the specified \code{column} shall be calculated and returned.  For
     1769\code{psLookupTableInterpolateAll}, all the values shall be calculated
     1770and returned as a \code{psVector}, the type of which shall be
     1771\code{PS_TYPE_F64}.  If the \code{index} is beyond the range of the
     1772\code{table}, \code{psLookupTableInterpolate} shall return \code{NaN},
     1773and \code{psLookupTableInterpolateAll} shall return \code{NULL} ---
     1774that is, no attempt is made at extrapolation.
     1775
     1776
     1777
     1778
     1779
     1780%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     1781
    17191782\section{Data manipulation}
    17201783
     
    17321795\item Minimization and fitting routines.
    17331796\end{itemize}
    1734 
    1735 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    17361797
    17371798\subsection{BitSets}
     
    34103471PSLib).  The format of these files shall be simple, for speed in
    34113472reading: Each line shall contain the MJD, $x_p$ (in arcseconds), $y_p$
    3412 (in arcseconds) and $\Delta$UT (in seconds) separated by whitespace;
    3413 blank lines and lines commencing with the comment character (the hash
    3414 symbol, \code{#}) as the first character shall be ignored.  For
    3415 example:
     3473(in arcseconds) and $\Delta$UT (in seconds) in a format readable by
     3474\code{psLookupTableRead}.  For example:
    34163475
    34173476\begin{verbatim}
     
    34463505    const char *filename;               // Filename of time table
    34473506    const psF64 validFrom, validTo;     // MJDs of validity of time table
    3448     bool loaded;                        // Has the table been loaded?
    3449     psVector *mjd;                      // MJD data, type is psF64
    3450     psVector *dut;                      // delta UT = UT1 - UTC data
    3451     psVector *xp, *yp;                  // Polar motion data
     3507    psLookupTable *table;               // Lookup table indexed on MJD, with UT1-UTC, xp and yp
    34523508} psTimeTable;
    34533509\end{verbatim}
     
    34733529\end{verbatim}
    34743530
    3475 Given a time \code{table} and a Modified Julian Date, \code{mjd}, at
    3476 which to interpolate values, \code{psTimeTableInterpolate} shall
    3477 calculate the appropriate UT1-UTC (\code{dut}; if non-\code{NULL}),
    3478 and polar motion (\code{xp,yp}; if non-\code{NULL}) by interpolation
    3479 on the table.  If the \code{mjd} is outside the range of the table or
    3480 the interpolation was for some other reason unsuccessful, then the
    3481 function shall return \code{false}; otherwise the function shall set
    3482 those parameters which are non-\code{NULL} (\code{dut,xp,yp}) and
    3483 return \code{true}.  If the requested \code{mjd} lies in the range of
    3484 the \code{table}, but the \code{table} has not been \code{loaded},
    3485 then the function shall call \code{psTimeTableLoad}.
    3486 \begin{verbatim}
    3487 bool psTimeTableInterpolate(const psTimeTable *table, double *xp,
    3488                             double *yp, double *dut, psF64 mjd);
    3489 \end{verbatim}
     3531%Given a time \code{table} and a Modified Julian Date, \code{mjd}, at
     3532%which to interpolate values, \code{psTimeTableInterpolate} shall
     3533%calculate the appropriate UT1-UTC (\code{dut}; if non-\code{NULL}),
     3534%and polar motion (\code{xp,yp}; if non-\code{NULL}) by interpolation
     3535%on the table.  If the \code{mjd} is outside the range of the table or
     3536%the interpolation was for some other reason unsuccessful, then the
     3537%function shall return \code{false}; otherwise the function shall set
     3538%those parameters which are non-\code{NULL} (\code{dut,xp,yp}) and
     3539%return \code{true}.  If the requested \code{mjd} lies in the range of
     3540%the \code{table}, but the \code{table} has not been \code{loaded},
     3541%then the function shall call \code{psTimeTableLoad}.
     3542%\begin{verbatim}
     3543%bool psTimeTableInterpolate(const psTimeTable *table, double *xp,
     3544%                            double *yp, double *dut, psF64 mjd);
     3545%\end{verbatim}
    34903546
    34913547\paragraph{Time Metadata}
Note: See TracChangeset for help on using the changeset viewer.