IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4711


Ignore:
Timestamp:
Aug 4, 2005, 5:51:16 PM (21 years ago)
Author:
Paul Price
Message:

Adding psTimer, changing psLibInit to psTimeInit, adding psArgument functions

Location:
trunk/doc/pslib
Files:
2 edited

Legend:

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

    r4599 r4711  
    1 %%% $Id: ChangeLogSDRS.tex,v 1.161 2005-07-22 22:39:21 price Exp $
     1%%% $Id: ChangeLogSDRS.tex,v 1.162 2005-08-05 03:51:16 price Exp $
    22
    33\subsection{Changes from version 00 to version 01}
     
    760760\item \code{psPixelCoord} now contains floats.
    761761\item \code{psImageSlice} uses \code{psPixels} to output coordinates.
    762 \end{itemize}
    763 
     762\item Added \code{psTimer} functions (prototypes by EAM).
     763\item \code{psLibInit} and \code{psLibCleanup} changed to
     764  \code{psTimeInitialize} and \code{psTimeFinalize}.  Calls to
     765  functions that require the time tables before calling
     766  \code{psTimeInitialize} shall produce an error.
     767\item Added \code{psArgument} functions to provide simple argument
     768  handling.
     769\end{itemize}
     770
  • trunk/doc/pslib/psLibSDRS.tex

    r4598 r4711  
    1 %%% $Id: psLibSDRS.tex,v 1.321 2005-07-22 22:36:33 price Exp $
     1%%% $Id: psLibSDRS.tex,v 1.322 2005-08-05 03:51:16 price Exp $
    22\documentclass[panstarrs,spec]{panstarrs}
    33
     
    271271\subsection{Initialization}
    272272
    273 PSLib may be initialized by calling \code{psLibInit} by the user
    274 before use.  This enables the library to perform the following tasks
    275 that are required before general use:
    276 \begin{itemize}
    277 \item Set the error codes for PSLib.
    278 \item Read the \code{psTime} configuration file (\code{timeConfig})
    279   and set up the appropriate \code{psTimeTable}s and predictions.
    280 \end{itemize}
    281 
    282 The prototype is:
    283 \begin{prototype}
    284 void psLibInit(const char *timeConfig);
    285 \end{prototype}
    286 
    287 \code{timeConfig} specifies the filename of the configuration file
    288 for \code{psTime} metadata.
    289 
    290 \subsection{Finalization}
    291 
    292 \begin{prototype}
    293 void psLibCleanup(void);
    294 \end{prototype}
    295 
    296 \code{psLibCleanup} shall free memory that was allocated by
    297 \code{psLibInit}, allowing a subsequent search for leaked memory (even
    298 memory marked as \code{persistent}).
     273Before certain \code{psTime} functions can be employed, the user must
     274call \code{psTimeInitialize}.
    299275
    300276\subsection{Memory Management}
     
    16281604
    16291605
    1630 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     1606%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    16311607
    16321608\subsection{Abort}
     
    16391615\end{prototype}
    16401616
    1641 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     1617%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     1618
     1619\subsection{Command-line arguments}
     1620
     1621The following functions are provided to aid parsing of command-line
     1622arguments:
     1623
     1624\begin{prototype}
     1625int psArgumentGet(int argc, char **argv, const char *arg);
     1626bool psArgumentRemove(int argnum, int *argc, char **argv);
     1627\end{prototype}
     1628
     1629\code{psArgumentGet} shall return the index of the element in the
     1630argument list, \code{argv} with number of entries \code{argc}, that
     1631matches the specified argument, \code{arg}, or zero if there is no
     1632match.
     1633
     1634\code{psArgumentRemove} shall remove from the argument list
     1635(\code{argv} with number of entries \code{argc}) the argument whose
     1636index is \code{argnum}.  The number of entries in the argument list
     1637shall be decremented.  The function shall return \code{true} if the
     1638\code{argnum} is in the argument list, and \code{false} otherwise.
     1639
     1640\begin{prototype}
     1641int psArgumentVerbosity(int *argc, char **argv);
     1642\end{prototype}
     1643
     1644\code{psArgumentVebosity} shall implement the various verbosity
     1645controls under the following guidelines:
     1646\begin{itemize}
     1647\item \code{-v} switch shall set the log level to 3.
     1648\item \code{-vv} switch shall set the log level to 4.
     1649\item \code{-vvv} switch shall set the log level to 5.
     1650\item \code{-logfmt someFormat} switch shall set the log format to
     1651  \code{someFormat}.
     1652\item \code{-trace facility level} switch shall set the trace level
     1653  for the specified \code{facility} to the specified \code{level}.
     1654\item \code{-trace-levels} switch shall print the trace levels as
     1655  currently set.
     1656\end{itemize}
     1657
     1658The above arguments shall be removed from the argument list as they
     1659are processed.  The function shall return the resultant logging level.
     1660
     1661%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    16421662
    16431663\pagebreak
     
    57305750track the time system being represented.
    57315751
     5752\subsubsection{Initialization and Finalization}
     5753
     5754The conversions between various time standards, and the polar motion
     5755requires importing external data (``time tables''), the locations of
     5756which are specified in a configuration file.
     5757
     5758\begin{prototype}
     5759void psTimeInitialize(const char *timeConfig);
     5760\end{prototype}
     5761
     5762\code{psTimeInitialize} shall read the \code{psTime} configuration
     5763file (\code{timeConfig}) and set up the appropriate
     5764\code{psTimeTable}s and predictions.
     5765
     5766{\bf Calls to \code{psTime} functions that require the time tables
     5767before calling \code{psTimeInitialize} shall result in an error.}
     5768
     5769\begin{prototype}
     5770void psTimeFinalize(void);
     5771\end{prototype}
     5772
     5773\code{psTimeFinalize} shall free memory that was allocated by
     5774\code{psTime} functions, allowing a subsequent search for leaked
     5775memory (even memory marked as \code{persistent}).
     5776
    57325777\subsubsection{Data Types}
    57335778
     
    59525997and ``to'' dates of applicability will be specified through metadata
    59535998(\S\ref{sec:timeMetadata}).
     5999
     6000{\bf Calls to \code{psTime} functions that require the time tables
     6001before calling \code{psTimeInitialize} shall result in an error.}
    59546002
    59556003When a value is required, the tables shall shall be checked in
     
    60176065A series of test inputs is contained in \S\ref{sec:timetest}.
    60186066
     6067\subsection{Timers}
     6068
     6069It is useful to be able to time an operation.  For this purpose, we specify
     6070the following:
     6071
     6072\begin{prototype}
     6073bool psTimerStart(char *name);
     6074psF64 psTimerMark(char *name);
     6075psF64 psTimerStop(void);
     6076\end{prototype}
     6077
     6078\code{psTimerStart} shall store the current time in a \code{psHash} of
     6079timers, under the supplied \code{name}.  \code{psTimerMark} shall
     6080return the elapsed time, in seconds, for the timer specified by
     6081\code{name}.  \code{psTimerStop} shall free all memory associated with
     6082the timers, so that no memory is leaked, and return the maximum time
     6083expended.
     6084
     6085
    60196086%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    60206087
Note: See TracChangeset for help on using the changeset viewer.