IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 4982


Ignore:
Timestamp:
Sep 9, 2005, 8:30:32 AM (21 years ago)
Author:
eugene
Message:

added updates based on psphot work

Location:
trunk/doc
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/modules/ModulesSDRS.tex

    r4867 r4982  
    1 %%% $Id: ModulesSDRS.tex,v 1.54 2005-08-24 21:27:10 price Exp $
     1%%% $Id: ModulesSDRS.tex,v 1.55 2005-09-09 18:30:32 eugene Exp $
    22\documentclass[panstarrs]{panstarrs}
    33
     
    14341434\subsection{Structures to Describe Sources}
    14351435
     1436\subsubsection{pmSource and pmPeak}
     1437
    14361438We start by defining a single source detected in a single band:
    14371439\begin{datatype}
     
    14471449\end{datatype}
    14481450
    1449 This source has the capacity for several types of measurements.  The
     1451In the object analysis process, we will use specific mask values to
     1452mark the image pixels.  The following structure defines the relevant
     1453mask values.
     1454\begin{datatype}
     1455enum {
     1456    PSPHOT_MASK_CLEAR     = 0x00,
     1457    PSPHOT_MASK_INVALID   = 0x01,
     1458    PSPHOT_MASK_SATURATED = 0x02,
     1459    PSPHOT_MASK_MARKED    = 0x08,
     1460} psphotMaskValues;
     1461\end{datatype}
     1462
     1463A source has the capacity for several types of measurements.  The
    14501464simplest measurement of a source is the location and flux of the peak
    14511465pixel associated with the source:
     
    14751489\end{datatype}
    14761490
     1491\subsubsection{pmMoments and source description}
     1492
    14771493The pixels which contain the source may be specified with the
    14781494\code{psImage *pixels} element, and the mask image may be used to
     
    14961512  float Peak;               // peak counts above sky
    14971513  float Sky;                // sky level (background)
     1514  float SN;                 // approx signal-to-noise
    14981515  int   nPixels;            // number of pixels used
    14991516} pmMoments;
    15001517\end{datatype}
     1518
     1519A collection of object moment measurements can be used to determine
     1520approximate object classes.  The key to this analysis is the location
     1521and statistics (in the second-moment plane, $\sigma_x$ vs $\sigma_y$)
     1522of the group of objects which are likely PSF objects.  We define the
     1523following structure to identify the location and size of the psf clump
     1524in the second-moment plane.
     1525\begin{datatype}
     1526typedef struct {
     1527    float X;
     1528    float dX;
     1529    float Y;
     1530    float dY;
     1531} pmPSFClump;
     1532\end{datatype}
     1533
     1534A given source may be identified as most-likely to be one of several
     1535source types.  The \code{pmSource} entry \code{pmSourceType} defines
     1536the current best-guess for this source.  \tbd{The values given below
     1537are currently illustrative and will require some modification as the
     1538source classification code is developed.}
     1539
     1540\begin{datatype}
     1541typedef enum {
     1542    PM_SOURCE_DEFECT,              // a cosmic-ray
     1543    PM_SOURCE_SATURATED,           // random saturated pixels
     1544
     1545    PM_SOURCE_SATSTAR,             // a saturated star
     1546    PM_SOURCE_PSFSTAR,             // a PSF star
     1547    PM_SOURCE_GOODSTAR,            // a good-quality star
     1548
     1549    PM_SOURCE_POOR_FIT_PSF,        // poor quality PSF fit
     1550    PM_SOURCE_FAIL_FIT_PSF,        // failed to get a good PSF fit
     1551    PM_SOURCE_FAINTSTAR,           // below S/N cutoff
     1552
     1553    PM_SOURCE_GALAXY,              // an extended object (galaxy)
     1554    PM_SOURCE_FAINT_GALAXY,        // a galaxy below S/N cutoff
     1555    PM_SOURCE_DROP_GALAXY,         // ?
     1556    PM_SOURCE_FAIL_FIT_GAL,        // failed on the galaxy fit
     1557    PM_SOURCE_POOR_FIT_GAL,        // poor quality galaxy fit
     1558
     1559    PM_SOURCE_OTHER,               // unidentified
     1560} pmSourceType;
     1561\end{datatype}
     1562
     1563\subsubsection{pmModel Source Model and Abstraction}
    15011564
    15021565An object's flux distribution may be modelled with some analytical
     
    15211584parameters are specified for the object by the PSF, not by the fit.
    15221585The FLT model represents the best fit of the given model to the
    1523 object, with all parameters floating in the fit.
     1586object, with all parameters floating in the fit. 
    15241587
    15251588\begin{datatype}
    15261589typedef struct {
    1527   psS32 type;               // model to be used
     1590  pmModelType type;         // model to be used
    15281591  psVector *params;         // parameter values
    15291592  psVector *dparams;        // parameter errors
     
    15311594  psS32 nDOF;               // number of degrees of freedom
    15321595  psS32 nIter;              // number of iterations
     1596  float radius;             // fit radius actually used
    15331597} pmModel;
    15341598\end{datatype}
    15351599
    1536 A given source may be identified as most-likely to be one of several
    1537 source types.  The \code{pmSource} entry \code{pmSourceType} defines
    1538 the current best-guess for this source.  \tbd{The values given below
    1539 are currently illustrative and will require some modification as the
    1540 source classification code is developed.}
     1600Every model instance belongs to a class of models, defined by the
     1601value of the \code{pmModelType type} entry.  Various functions need
     1602access to information about each of the models.  Some of this
     1603information varies from model to model, and may depend on the current
     1604parameter values or other data quantities.  In order to keep the code
     1605from requiring the information about each model to be coded into the
     1606low-level fitting routines, we define a collection of functions which
     1607allow us to abstract this type of model-dependent information.  These
     1608generic functions take the model type and return the corresponding
     1609function pointer for the specified model.  Each
     1610model is defined by creating this collection of specific functions,
     1611and placing them in a single file for each model.  We define the
     1612following structure to carry the collection of information about the
     1613models.
    15411614
    15421615\begin{datatype}
    1543 typedef enum {
    1544   PM_SOURCE_PSFSTAR;
    1545   PM_SOURCE_GALAXY;
    1546   PM_SOURCE_DEFECT;
    1547   PM_SOURCE_SATURATED;
    1548   PM_SOURCE_SATSTAR;
    1549   PM_SOURCE_FAINTSTAR;
    1550   PM_SOURCE_BRIGHTSTAR;
    1551   PM_SOURCE_OTHER;
    1552 } pmSourceType;
     1616typedef struct {
     1617    char *name;
     1618    int nParams;
     1619    pmModelFunc          modelFunc;
     1620    pmModelFlux          modelFlux;
     1621    pmModelRadius        modelRadius;
     1622    pmModelLimits        modelLimits;
     1623    pmModelGuessFunc     modelGuessFunc;
     1624    pmModelFromPSFFunc   modelFromPSFFunc;
     1625    pmModelFitStatusFunc modelFitStatusFunc;
     1626} pmModelGroup;
    15531627\end{datatype}
     1628
     1629Each entry in the \code{pmModelGroup} defines the information needed
     1630by the system to specify a model.  The function types define above are
     1631\begin{prototype}
     1632typedef psMinimizeLMChi2Func pmModelFunc;
     1633typedef psF64 (*pmModelFlux)(const psVector *params);
     1634typedef psF64 (*pmModelRadius)(const psVector *params, double flux);
     1635typedef bool (*pmModelLimits)(psVector **beta_lim, psVector **params_min, psVector **params_max);
     1636typedef bool (*pmModelGuessFunc)(pmModel *model, pmSource *source);
     1637typedef bool (*pmModelFromPSFFunc)(pmModel *modelPSF, pmModel *modelFLT, pmPSF *psf);
     1638typedef bool (*pmModelFitStatusFunc)(pmModel *model);
     1639\end{prototype}
     1640
     1641Each of these functions is found for a given model by calling the
     1642corresponding lookup function:
     1643\begin{prototype}
     1644pmModelFunc          pmModelFunc_GetFunction (pmModelType type);
     1645pmModelFlux          pmModelFlux_GetFunction (pmModelType type);
     1646pmModelRadius        pmModelRadius_GetFunction (pmModelType type);
     1647pmModelLimits        pmModelLimits_GetFunction (pmModelType type);
     1648pmModelGuessFunc     pmModelGuessFunc_GetFunction (pmModelType type);
     1649pmModelFromPSFFunc   pmModelFromPSFFunc_GetFunction (pmModelType type);
     1650pmModelFitStatusFunc pmModelFitStatusFunc_GetFunction (pmModelType type);
     1651\end{prototype}
     1652
     1653\code{pmModelFunc} is the function used to determine the value of the
     1654mdoel at a specific coordinate, and is the one used by
     1655\code{psMinimizeLMChi2}. 
     1656
     1657\code{pmModelFlux} returns the total integrated flux for the given
     1658input parameters.
     1659
     1660\code{pmModelRadius} returns the scaling radius at which the flux of
     1661the model matches the specified flux.  This presumes that the model is
     1662a function of an elliptical contour. 
     1663
     1664\code{pmModelLimits} sets the parameter limit vectors for the
     1665function.
     1666
     1667\code{pmModelGuessFunc} generates an initial guess for the model based
     1668on the provided source statistics (moments and pixel values as
     1669needed).
     1670
     1671\code{pmModelFromPSFFunc} takes as input a representation of the psf
     1672and a value for the model and fills in the PSF parameters of the
     1673model.  The input primarily relies upon the centroid coordinates of
     1674the input model, thought the normalization may potentially be used.
     1675
     1676\code{pmModelFitStatusFunc} returns a true or false values based on
     1677the success or failure of a model fit.  the success is determined by
     1678quantities such as the chisq or the signal-to-noise.
     1679
     1680In addition, the following functions are useful for interacting with
     1681the collection of models:
     1682\begin{prototype}
     1683int                  pmModelParameterCount (pmModelType type);
     1684\end{prototype}
     1685This function returns the number of parameters used by the listed
     1686function.
     1687
     1688\begin{prototype}
     1689char                *pmModelGetType (pmModelType type);
     1690pmModelType          pmModelSetType (char *name);
     1691\end{prototype}
     1692These two functions provide translations between the user-space model
     1693names and the internal model type codes.  The model type codes are not
     1694necessarily maintained between compilations of the program; the name
     1695should be used to transfer models between programs or systems.
     1696
     1697\subsubsection{pmPSF, pmPSFtry, and PSF model}
    15541698
    15551699It is useful to generate a model to define the point-spread-function
     
    15721716\end{datatype}
    15731717
     1718\begin{prototype}
     1719pmModel     *pmModelFromPSF (pmModel *model, pmPSF *psf);
     1720\end{prototype}
     1721This function constructs a \code{pmModel} instance based on the
     1722\code{pmPSF} description of the PSF.  The input is a \code{pmModel}
     1723with at least the values of the centroid coordinates (possibly
     1724normalization if this is needed) defined.  The values of the
     1725PSF-dependent parameters are specified for the specific realization
     1726based on the coordinates of the object. 
     1727
     1728\begin{prototype}
     1729bool         pmPSFFromModels (pmPSF *psf, psArray *models, psVector *mask);
     1730\end{prototype}
     1731This function takes a collection of \code{pmModel} fitted models from
     1732across a single image and builds a \code{pmPSF} representation of the
     1733PSF.  The input array of model fits may consist of entries to be
     1734ignored (noted by a non-zero \code{mask} entry).  The analysis of the
     1735models fits a 2D polynomial for each parameter to the collection of
     1736model parameters as a function of position (and normalization?).  In
     1737this process, some of the input models may be marked as outliers and
     1738excluded from the fit.  These elements will be marked with a specific
     1739mask value (1 == \code{PSFTRY_MASK_OUTLIER}). 
     1740
     1741We have the capability to test several different model functions in an
     1742attempt to build an accurate PSF for an image.  The complete set of
     1743data needed to build and test as specific PSF model is carried by the
     1744\code{pmPSFtry} structure:
     1745\begin{datatype}
     1746typedef struct {
     1747    pmModelType modelType;
     1748    pmPSF      *psf;
     1749    psArray    *sources;      // pointers to the original sources
     1750    psArray    *modelFLT;     // model fits, floating parameters
     1751    psArray    *modelPSF;     // model fits, PSF parameters
     1752    psVector   *mask;
     1753    psVector   *metric;
     1754    psVector   *fitMag;
     1755    float       ApResid;
     1756    float       dApResid;
     1757    float       skyBias;
     1758} pmPSFtry;
     1759\end{datatype}
     1760This structure contains a pointer to the collection of \code{sources}
     1761which will be used to test the PSF model form.  It lists the
     1762\code{pmModelType type} of model being tests, and contains an element
     1763to store the resulting \code{psf} representation.  In addition, this
     1764structure carries the complete collection of FLT (floating parameter)
     1765and PSF (fixed parameter) model fits to each of the sources
     1766\code{modelFLT} and \code{modelPSF}.  It also contains a mask which is
     1767set by the model fitting and psf fitting steps.  For each model, the
     1768value of the quality metric is stored in the vector \code{metric} and
     1769the fitted instrumental magntiude is stored in \code{fitMag}.  The
     1770quality metric for the PSF model is the aperture magnitude minus the
     1771fitted magnitude for each source.  This collection of aperture
     1772residuals is examined in the analysis process, and a linear trend of
     1773the residual with the inverse object flux (ie, $10^{0.4*mag)$) is
     1774fitted.  The result of this fit is a measured sky bias (systematic
     1775error in the sky measured by the fits), an effective
     1776infinite-magnitude aperture correction (\code{ApResid}), and the
     1777scatter of the aperture correction for the ensemble of PSF stars
     1778(\code{dApResid}).  The ultimate metric to intercompare multiple types
     1779of PSF models is the value of the aperture correction scatter.
     1780
     1781The following functions are used to try out a single PSF model.
     1782\begin{prototype}
     1783pmPSFtry *pmPSFtryModel (psArray *sources, char *modelName, float RADIUS);
     1784\end{prototype}
     1785This function takes the input collection of sources and performs a
     1786complete analysis to determine a PSF model of the given type
     1787(specified by model name).  The result is a \code{pmPSFtry} with the
     1788results of the analysis.
     1789
     1790\begin{prototype}
     1791bool pmPSFtryMetric (pmPSFtry *try, float RADIUS);
     1792\end{prototype}
     1793This function is used to measure the PSF model metric for the set of
     1794results contained in the \code{pmPSFtry} structure.
     1795
     1796The following datatype defines the masks used by the \code{pmPSFtry}
     1797anslysis to identify sources which should or should not be included in
     1798the analysis.
     1799\begin{datatype}
     1800enum {
     1801    PSFTRY_MASK_CLEAR    = 0x00,
     1802    PSFTRY_MASK_OUTLIER  = 0x01, // 1: outlier in psf polynomial fit (provided by psPolynomials)
     1803    PSFTRY_MASK_FLT_FAIL = 0x02, // 2: flt model failed to converge
     1804    PSFTRY_MASK_PSF_FAIL = 0x04, // 3: psf model failed to converge
     1805    PSFTRY_MASK_BAD_PHOT = 0x08, // 4: invalid source photometry           
     1806    PSFTRY_MASK_ALL      = 0x0f,
     1807} pmPSFtryMaskValues;
     1808\end{datatype}
     1809
    15741810\begin{datatype}
    15751811typedef enum {
     
    15871823
    15881824\subsection{Object Model Abstraction}
     1825
     1826\tbd{this section is duplicating the section above}
    15891827
    15901828The object model functions are defined to allow for the flexible
     
    17311969circular radius of the \code{source.peak} coordinates.  The return
    17321970value indicates the success (TRUE) of the operation.
     1971
     1972\tbd{add pmSourcePSFClump}
     1973
     1974\tbd{fix pmSourceRoughClass}
     1975
     1976\tbd{add pmSourcePhotometry}
     1977
     1978\tbd{pmSourceDophotType}
     1979
     1980\tbd{pmSourceSextractType}
     1981
     1982\tbd{pmModelFitStatus}
    17331983
    17341984\begin{prototype}
  • trunk/doc/pslib/ChangeLogSDRS.tex

    r4945 r4982  
    1 %%% $Id: ChangeLogSDRS.tex,v 1.169 2005-09-02 22:29:08 price Exp $
     1%%% $Id: ChangeLogSDRS.tex,v 1.170 2005-09-09 18:30:23 eugene Exp $
    22
    33\subsection{Changes from version 00 to version 01}
     
    779779  and an optional error vector.
    780780\item Changed \code{complex double} to \code{complex} throughout.
    781 \end{itemize}
    782 
     781
     782\item Added \code{psImageCountPixelMask}
     783\item Added \code{psVectorCountPixelMask}
     784\item Added \code{psVectorCreate}
     785\item Added \code{psImageRow}
     786\item Added \code{psImageColumn}
     787\item moved \code{paramMask} to \code{psMinimization}
     788\item added \code{paramMin} to \code{psMinimization}
     789\item added \code{paramMax} to \code{psMinimization}
     790\item added \code{paramDelta} to \code{psMinimization}
     791\item adjusted \code{psMinimizeLMChi2} to drop \code{paramMask}
     792
     793\end{itemize}
     794
  • trunk/doc/pslib/psLibSDRS.tex

    r4945 r4982  
    1 %%% $Id: psLibSDRS.tex,v 1.333 2005-09-02 22:29:08 price Exp $
     1%%% $Id: psLibSDRS.tex,v 1.334 2005-09-09 18:30:23 eugene Exp $
    22\documentclass[panstarrs,spec]{panstarrs}
    33
     
    34053405
    34063406\begin{prototype}
    3407 bool psVectorInit(psVector *image, ...);
     3407bool psVectorInit(psVector *vector, ...);
    34083408\end{prototype}
    34093409
     
    34233423value of the \code{input} vector at the specified \code{position}.  A
    34243424negative \code{position} means index from the end.
     3425
     3426\begin{prototype}
     3427psVector psVectorCreate(psVector *input, double lower, double upper, double delta, psElemType type);
     3428\end{prototype}
     3429
     3430This function creates a new vector, or reallocates the provided vector
     3431if \code{input} is not \code{NULL}.  The created vector consists of
     3432the data range starting at \code{lower}, running to \code{upper}, in
     3433steps of \code{delta}.  The upper-end value is {\em exclusive}; the
     3434sequence is equivalent to \code{for (x = lower; x < upper; x +=
     3435  delta)}. 
    34253436
    34263437%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     
    43784389\end{prototype}
    43794390
     4391\begin{prototype}
     4392long psVectorCountPixelMask (psVector *mask, psMaskValue value);
     4393\end{prototype}
     4394This function returns the number of pixels in the \code{vector} which
     4395satisfy any of the mask bits.  An error (eg, invalid vector) results
     4396in a return value of -1.  The vector must be of the same type as
     4397psMaskValue.
     4398
    43804399\subsubsection{Histograms}
    43814400\label{sec:histograms}
     
    46404659We specify two minimization engines, Levenberg-Marquardt and Powell,
    46414660since the former is relatively robust, but requires derivatives to be
    4642 known, while the latter does not always obtain the best fit but does
    4643 not require derivatives to be known.
    4644 
    4645 In both cases, we need to be able to set the maximum number of
    4646 iterations (\code{maxIter}) and the maximum tolerance (\code{tol}) for
    4647 convergence, in addition to having some basic information on the
    4648 results and quality of the minimization: the value of the function at
    4649 the minimum (\code{value}), the number of iterations performed
    4650 (\code{iter}) and last change in tolerance before returning
    4651 (\code{lastDelta}).
     4661known, while the latter does not require derivatives to be known, but
     4662since it needs to calculate the derivatives on the fly, is more
     4663computationally intensive. 
     4664
     4665We define the structure \code{psMinimization} to carry in user-defined
     4666limits on the minimization process, and to carry out information about
     4667the minimization analysis.  The maximum number of iterations is
     4668specified by \code{maxIter}, while the maximum tolerance for
     4669convergence is \code{tol}.  Four parameter vectors describe the
     4670behavior of individual parameters.  The \code{paramMask} vector
     4671defines the free (0) or frozen (not 0) parameters.  The
     4672\code{paramMin} defines the minimum allowed value for each parameter,
     4673while \code{paramMax} defines the maximum allowed value for each
     4674parameter.  During the analysis, parameters which would trend beyond
     4675these limits saturate to the limit.  The \code{paramDelta} specifies
     4676the maximum allowed absolute value of the swing of a given parameter.
     4677If the delta for a specific parameter would be larger than this, the
     4678swing is saturated to the limit (with the correct sign).  Any of these
     4679parameter vectors may be set to \code{NULL}, in which case the concept
     4680is ignored in the analysis.  The output information carried by the
     4681structure consists of the value of the function at the minimum
     4682(\code{value}), the number of iterations performed (\code{iter}) and
     4683last change in tolerance before returning (\code{lastDelta}).
    46524684
    46534685\begin{datatype}
     
    46584690    int iter;                           ///< Actual number of iterations performed
    46594691    float lastDelta;                    ///< Last change before quitting
     4692    psVector *paramMask;                ///< valid / invalid parameters
     4693    psVector *paramMax;                 ///< max allowed parameters
     4694    psVector *paramMin;                 ///< min allowed parameters
     4695    psVector *paramDelta;               ///< max allowed param swing
    46604696} psMinimization;
    46614697\end{datatype}
     
    46654701psMinimization *psMinimizationAlloc(int maxIter, float tol);
    46664702\end{prototype}
     4703and the parameter vectors are initially set to \code{NULL}. 
    46674704
    46684705\subsubsection{Levenberg-Marquardt}
     
    46854722                      psImage *covar,
    46864723                      psVector *params,
    4687                       const psVector *paramMask,
    46884724                      const psArray  *x,
    46894725                      const psVector *y,
     
    46944730The function shall return \code{false} in the event that there was an
    46954731error (bad input, too many iterations), and also call \code{psError}.
     4732It is not an error for the minimization to reach one of the parameter
     4733limits. 
    46964734
    46974735The minimization specification, \code{min}, shall be modified with the
     
    47414779the goodness of a fit.  This function returns the distances of the
    47424780current parameter set from the minimization parameters expected from
    4743 Gauss-Newton minimization.  The arguments are identical to those of
    4744 \code{psMinimizeLMChi2}, except only the single vector \code{delta},
    4745 consisting of the distances, is returned.  This vector must be
    4746 pre-allocated to the dimenstions of \code{params}.
     4781Gauss-Newton minimization.  The arguments have the same meaning as for
     4782\code{psMinimizeLMChi2}.  The returned vector, \code{delta}, consists
     4783of the distances.  This vector must be pre-allocated to the
     4784dimenstions of \code{params}.
    47474785
    47484786%% \subsubsubsection{Pre-defined Functions for LM}
     
    47854823
    47864824\begin{prototype}
    4787 bool psMinimizePowell(psMinimization *min, psVector *params, const psVector *paramMask,
    4788                       const psArray *coords, psMinimizePowellFunc func);
     4825bool psMinimizePowell(psMinimization *min,
     4826                      psVector *params,
     4827                      const psVector *paramMask,
     4828                      const psArray *coords,
     4829                      psMinimizePowellFunc func);
    47894830\end{prototype}
    47904831
    47914832The inputs and general behavior of this function is the same as for
    47924833\code{psMinimizeLM}, except for the absence of the covariance matrix,
    4793 \code{covar}.
     4834\code{covar} \note{why does this not have a covar matrix?}
    47944835
    47954836\subsubsubsection{Minimizing $\chi^2$ with Powell}
     
    48034844
    48044845\begin{prototype}
    4805 bool psMinimizeChi2Powell(psMinimization *min, psVector *params, const psVector *paramMask,
    4806                           const psArray *coords, const psVector *value, const psVector *error,
     4846bool psMinimizeChi2Powell(psMinimization *min,
     4847                          psVector *params,
     4848                          const psVector *paramMask,
     4849                          const psArray *coords,
     4850                          const psVector *value,
     4851                          const psVector *error,
    48074852                          psMinimizeChi2PowellFunc model);
    48084853\end{prototype}
     
    48124857instead of being provided the function to be minimized, it is provided
    48134858a model to fit and must calculate the $\chi^2$ to be minimized itself.
     4859
     4860\note{why does this not have a covar matrix?}
     4861
     4862\note{unify the param names with psMinimizeLMChi2Func?}
    48144863
    48154864For this purpose, \code{value} shall contain measured values at the
     
    50095058
    50105059\begin{prototype}
     5060psVector *psImageRow(psVector *out,
     5061                     const psImage *input,
     5062                     psU32 row);
     5063psVector *psImageCol(psVector *out,
     5064                     const psImage *input,
     5065                     psU32 column);
     5066\end{prototype}
     5067
     5068These two functions extract a single complete \code{row} or
     5069\code{column} from the \code{image} and return it to the provided
     5070\code{vector}, allocating it if it is \code{NULL}.  These are provided
     5071as fast, simple implementations of data extraction.  For more
     5072sophisticated operations, the following two functions should be used.
     5073
     5074\begin{prototype}
    50115075psVector *psImageSlice(psVector *out,
    50125076                       psPixels *coords,
     
    52575321following types: \code{psS8}, \code{psU16}, \code{psF32},
    52585322\code{psF64}.
     5323
     5324\begin{prototype}
     5325long psImageCountPixelMask (psImage *mask, psRegion region, psMaskValue value);
     5326\end{prototype}
     5327This function returns the number of pixels in the image region which
     5328satisfy any of the mask bits.  An error (eg, invalid image, invalid
     5329region) results in a return value of -1.
    52595330
    52605331\begin{prototype}
     
    62306301bool psTimerStart(char *name);
    62316302psF64 psTimerMark(char *name);
     6303psF64 psTimerClear(char *name);
    62326304psF64 psTimerStop(void);
    62336305\end{prototype}
     
    62366308timers, under the supplied \code{name}.  \code{psTimerMark} shall
    62376309return the elapsed time, in seconds, for the timer specified by
    6238 \code{name}.  \code{psTimerStop} shall free all memory associated with
    6239 the timers, so that no memory is leaked, and return the maximum time
    6240 expended.
    6241 
     6310\code{name}.  \code{psTimerClear} resets the named timer.
     6311\code{psTimerStop} shall free all memory associated with all timers,
     6312so that no memory is leaked, and return the maximum time expended.
    62426313
    62436314%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Note: See TracChangeset for help on using the changeset viewer.