Changeset 4982
- Timestamp:
- Sep 9, 2005, 8:30:32 AM (21 years ago)
- Location:
- trunk/doc
- Files:
-
- 3 edited
-
modules/ModulesSDRS.tex (modified) (10 diffs)
-
pslib/ChangeLogSDRS.tex (modified) (2 diffs)
-
pslib/psLibSDRS.tex (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/modules/ModulesSDRS.tex
r4867 r4982 1 %%% $Id: ModulesSDRS.tex,v 1.5 4 2005-08-24 21:27:10 price Exp $1 %%% $Id: ModulesSDRS.tex,v 1.55 2005-09-09 18:30:32 eugene Exp $ 2 2 \documentclass[panstarrs]{panstarrs} 3 3 … … 1434 1434 \subsection{Structures to Describe Sources} 1435 1435 1436 \subsubsection{pmSource and pmPeak} 1437 1436 1438 We start by defining a single source detected in a single band: 1437 1439 \begin{datatype} … … 1447 1449 \end{datatype} 1448 1450 1449 This source has the capacity for several types of measurements. The 1451 In the object analysis process, we will use specific mask values to 1452 mark the image pixels. The following structure defines the relevant 1453 mask values. 1454 \begin{datatype} 1455 enum { 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 1463 A source has the capacity for several types of measurements. The 1450 1464 simplest measurement of a source is the location and flux of the peak 1451 1465 pixel associated with the source: … … 1475 1489 \end{datatype} 1476 1490 1491 \subsubsection{pmMoments and source description} 1492 1477 1493 The pixels which contain the source may be specified with the 1478 1494 \code{psImage *pixels} element, and the mask image may be used to … … 1496 1512 float Peak; // peak counts above sky 1497 1513 float Sky; // sky level (background) 1514 float SN; // approx signal-to-noise 1498 1515 int nPixels; // number of pixels used 1499 1516 } pmMoments; 1500 1517 \end{datatype} 1518 1519 A collection of object moment measurements can be used to determine 1520 approximate object classes. The key to this analysis is the location 1521 and statistics (in the second-moment plane, $\sigma_x$ vs $\sigma_y$) 1522 of the group of objects which are likely PSF objects. We define the 1523 following structure to identify the location and size of the psf clump 1524 in the second-moment plane. 1525 \begin{datatype} 1526 typedef struct { 1527 float X; 1528 float dX; 1529 float Y; 1530 float dY; 1531 } pmPSFClump; 1532 \end{datatype} 1533 1534 A given source may be identified as most-likely to be one of several 1535 source types. The \code{pmSource} entry \code{pmSourceType} defines 1536 the current best-guess for this source. \tbd{The values given below 1537 are currently illustrative and will require some modification as the 1538 source classification code is developed.} 1539 1540 \begin{datatype} 1541 typedef 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} 1501 1564 1502 1565 An object's flux distribution may be modelled with some analytical … … 1521 1584 parameters are specified for the object by the PSF, not by the fit. 1522 1585 The FLT model represents the best fit of the given model to the 1523 object, with all parameters floating in the fit. 1586 object, with all parameters floating in the fit. 1524 1587 1525 1588 \begin{datatype} 1526 1589 typedef struct { 1527 p sS32 type;// model to be used1590 pmModelType type; // model to be used 1528 1591 psVector *params; // parameter values 1529 1592 psVector *dparams; // parameter errors … … 1531 1594 psS32 nDOF; // number of degrees of freedom 1532 1595 psS32 nIter; // number of iterations 1596 float radius; // fit radius actually used 1533 1597 } pmModel; 1534 1598 \end{datatype} 1535 1599 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.} 1600 Every model instance belongs to a class of models, defined by the 1601 value of the \code{pmModelType type} entry. Various functions need 1602 access to information about each of the models. Some of this 1603 information varies from model to model, and may depend on the current 1604 parameter values or other data quantities. In order to keep the code 1605 from requiring the information about each model to be coded into the 1606 low-level fitting routines, we define a collection of functions which 1607 allow us to abstract this type of model-dependent information. These 1608 generic functions take the model type and return the corresponding 1609 function pointer for the specified model. Each 1610 model is defined by creating this collection of specific functions, 1611 and placing them in a single file for each model. We define the 1612 following structure to carry the collection of information about the 1613 models. 1541 1614 1542 1615 \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; 1616 typedef 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; 1553 1627 \end{datatype} 1628 1629 Each entry in the \code{pmModelGroup} defines the information needed 1630 by the system to specify a model. The function types define above are 1631 \begin{prototype} 1632 typedef psMinimizeLMChi2Func pmModelFunc; 1633 typedef psF64 (*pmModelFlux)(const psVector *params); 1634 typedef psF64 (*pmModelRadius)(const psVector *params, double flux); 1635 typedef bool (*pmModelLimits)(psVector **beta_lim, psVector **params_min, psVector **params_max); 1636 typedef bool (*pmModelGuessFunc)(pmModel *model, pmSource *source); 1637 typedef bool (*pmModelFromPSFFunc)(pmModel *modelPSF, pmModel *modelFLT, pmPSF *psf); 1638 typedef bool (*pmModelFitStatusFunc)(pmModel *model); 1639 \end{prototype} 1640 1641 Each of these functions is found for a given model by calling the 1642 corresponding lookup function: 1643 \begin{prototype} 1644 pmModelFunc pmModelFunc_GetFunction (pmModelType type); 1645 pmModelFlux pmModelFlux_GetFunction (pmModelType type); 1646 pmModelRadius pmModelRadius_GetFunction (pmModelType type); 1647 pmModelLimits pmModelLimits_GetFunction (pmModelType type); 1648 pmModelGuessFunc pmModelGuessFunc_GetFunction (pmModelType type); 1649 pmModelFromPSFFunc pmModelFromPSFFunc_GetFunction (pmModelType type); 1650 pmModelFitStatusFunc pmModelFitStatusFunc_GetFunction (pmModelType type); 1651 \end{prototype} 1652 1653 \code{pmModelFunc} is the function used to determine the value of the 1654 mdoel 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 1658 input parameters. 1659 1660 \code{pmModelRadius} returns the scaling radius at which the flux of 1661 the model matches the specified flux. This presumes that the model is 1662 a function of an elliptical contour. 1663 1664 \code{pmModelLimits} sets the parameter limit vectors for the 1665 function. 1666 1667 \code{pmModelGuessFunc} generates an initial guess for the model based 1668 on the provided source statistics (moments and pixel values as 1669 needed). 1670 1671 \code{pmModelFromPSFFunc} takes as input a representation of the psf 1672 and a value for the model and fills in the PSF parameters of the 1673 model. The input primarily relies upon the centroid coordinates of 1674 the input model, thought the normalization may potentially be used. 1675 1676 \code{pmModelFitStatusFunc} returns a true or false values based on 1677 the success or failure of a model fit. the success is determined by 1678 quantities such as the chisq or the signal-to-noise. 1679 1680 In addition, the following functions are useful for interacting with 1681 the collection of models: 1682 \begin{prototype} 1683 int pmModelParameterCount (pmModelType type); 1684 \end{prototype} 1685 This function returns the number of parameters used by the listed 1686 function. 1687 1688 \begin{prototype} 1689 char *pmModelGetType (pmModelType type); 1690 pmModelType pmModelSetType (char *name); 1691 \end{prototype} 1692 These two functions provide translations between the user-space model 1693 names and the internal model type codes. The model type codes are not 1694 necessarily maintained between compilations of the program; the name 1695 should be used to transfer models between programs or systems. 1696 1697 \subsubsection{pmPSF, pmPSFtry, and PSF model} 1554 1698 1555 1699 It is useful to generate a model to define the point-spread-function … … 1572 1716 \end{datatype} 1573 1717 1718 \begin{prototype} 1719 pmModel *pmModelFromPSF (pmModel *model, pmPSF *psf); 1720 \end{prototype} 1721 This function constructs a \code{pmModel} instance based on the 1722 \code{pmPSF} description of the PSF. The input is a \code{pmModel} 1723 with at least the values of the centroid coordinates (possibly 1724 normalization if this is needed) defined. The values of the 1725 PSF-dependent parameters are specified for the specific realization 1726 based on the coordinates of the object. 1727 1728 \begin{prototype} 1729 bool pmPSFFromModels (pmPSF *psf, psArray *models, psVector *mask); 1730 \end{prototype} 1731 This function takes a collection of \code{pmModel} fitted models from 1732 across a single image and builds a \code{pmPSF} representation of the 1733 PSF. The input array of model fits may consist of entries to be 1734 ignored (noted by a non-zero \code{mask} entry). The analysis of the 1735 models fits a 2D polynomial for each parameter to the collection of 1736 model parameters as a function of position (and normalization?). In 1737 this process, some of the input models may be marked as outliers and 1738 excluded from the fit. These elements will be marked with a specific 1739 mask value (1 == \code{PSFTRY_MASK_OUTLIER}). 1740 1741 We have the capability to test several different model functions in an 1742 attempt to build an accurate PSF for an image. The complete set of 1743 data needed to build and test as specific PSF model is carried by the 1744 \code{pmPSFtry} structure: 1745 \begin{datatype} 1746 typedef 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} 1760 This structure contains a pointer to the collection of \code{sources} 1761 which will be used to test the PSF model form. It lists the 1762 \code{pmModelType type} of model being tests, and contains an element 1763 to store the resulting \code{psf} representation. In addition, this 1764 structure carries the complete collection of FLT (floating parameter) 1765 and PSF (fixed parameter) model fits to each of the sources 1766 \code{modelFLT} and \code{modelPSF}. It also contains a mask which is 1767 set by the model fitting and psf fitting steps. For each model, the 1768 value of the quality metric is stored in the vector \code{metric} and 1769 the fitted instrumental magntiude is stored in \code{fitMag}. The 1770 quality metric for the PSF model is the aperture magnitude minus the 1771 fitted magnitude for each source. This collection of aperture 1772 residuals is examined in the analysis process, and a linear trend of 1773 the residual with the inverse object flux (ie, $10^{0.4*mag)$) is 1774 fitted. The result of this fit is a measured sky bias (systematic 1775 error in the sky measured by the fits), an effective 1776 infinite-magnitude aperture correction (\code{ApResid}), and the 1777 scatter of the aperture correction for the ensemble of PSF stars 1778 (\code{dApResid}). The ultimate metric to intercompare multiple types 1779 of PSF models is the value of the aperture correction scatter. 1780 1781 The following functions are used to try out a single PSF model. 1782 \begin{prototype} 1783 pmPSFtry *pmPSFtryModel (psArray *sources, char *modelName, float RADIUS); 1784 \end{prototype} 1785 This function takes the input collection of sources and performs a 1786 complete analysis to determine a PSF model of the given type 1787 (specified by model name). The result is a \code{pmPSFtry} with the 1788 results of the analysis. 1789 1790 \begin{prototype} 1791 bool pmPSFtryMetric (pmPSFtry *try, float RADIUS); 1792 \end{prototype} 1793 This function is used to measure the PSF model metric for the set of 1794 results contained in the \code{pmPSFtry} structure. 1795 1796 The following datatype defines the masks used by the \code{pmPSFtry} 1797 anslysis to identify sources which should or should not be included in 1798 the analysis. 1799 \begin{datatype} 1800 enum { 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 1574 1810 \begin{datatype} 1575 1811 typedef enum { … … 1587 1823 1588 1824 \subsection{Object Model Abstraction} 1825 1826 \tbd{this section is duplicating the section above} 1589 1827 1590 1828 The object model functions are defined to allow for the flexible … … 1731 1969 circular radius of the \code{source.peak} coordinates. The return 1732 1970 value 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} 1733 1983 1734 1984 \begin{prototype} -
trunk/doc/pslib/ChangeLogSDRS.tex
r4945 r4982 1 %%% $Id: ChangeLogSDRS.tex,v 1.1 69 2005-09-02 22:29:08 price Exp $1 %%% $Id: ChangeLogSDRS.tex,v 1.170 2005-09-09 18:30:23 eugene Exp $ 2 2 3 3 \subsection{Changes from version 00 to version 01} … … 779 779 and an optional error vector. 780 780 \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.33 3 2005-09-02 22:29:08 price Exp $1 %%% $Id: psLibSDRS.tex,v 1.334 2005-09-09 18:30:23 eugene Exp $ 2 2 \documentclass[panstarrs,spec]{panstarrs} 3 3 … … 3405 3405 3406 3406 \begin{prototype} 3407 bool psVectorInit(psVector * image, ...);3407 bool psVectorInit(psVector *vector, ...); 3408 3408 \end{prototype} 3409 3409 … … 3423 3423 value of the \code{input} vector at the specified \code{position}. A 3424 3424 negative \code{position} means index from the end. 3425 3426 \begin{prototype} 3427 psVector psVectorCreate(psVector *input, double lower, double upper, double delta, psElemType type); 3428 \end{prototype} 3429 3430 This function creates a new vector, or reallocates the provided vector 3431 if \code{input} is not \code{NULL}. The created vector consists of 3432 the data range starting at \code{lower}, running to \code{upper}, in 3433 steps of \code{delta}. The upper-end value is {\em exclusive}; the 3434 sequence is equivalent to \code{for (x = lower; x < upper; x += 3435 delta)}. 3425 3436 3426 3437 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% … … 4378 4389 \end{prototype} 4379 4390 4391 \begin{prototype} 4392 long psVectorCountPixelMask (psVector *mask, psMaskValue value); 4393 \end{prototype} 4394 This function returns the number of pixels in the \code{vector} which 4395 satisfy any of the mask bits. An error (eg, invalid vector) results 4396 in a return value of -1. The vector must be of the same type as 4397 psMaskValue. 4398 4380 4399 \subsubsection{Histograms} 4381 4400 \label{sec:histograms} … … 4640 4659 We specify two minimization engines, Levenberg-Marquardt and Powell, 4641 4660 since 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}). 4661 known, while the latter does not require derivatives to be known, but 4662 since it needs to calculate the derivatives on the fly, is more 4663 computationally intensive. 4664 4665 We define the structure \code{psMinimization} to carry in user-defined 4666 limits on the minimization process, and to carry out information about 4667 the minimization analysis. The maximum number of iterations is 4668 specified by \code{maxIter}, while the maximum tolerance for 4669 convergence is \code{tol}. Four parameter vectors describe the 4670 behavior of individual parameters. The \code{paramMask} vector 4671 defines the free (0) or frozen (not 0) parameters. The 4672 \code{paramMin} defines the minimum allowed value for each parameter, 4673 while \code{paramMax} defines the maximum allowed value for each 4674 parameter. During the analysis, parameters which would trend beyond 4675 these limits saturate to the limit. The \code{paramDelta} specifies 4676 the maximum allowed absolute value of the swing of a given parameter. 4677 If the delta for a specific parameter would be larger than this, the 4678 swing is saturated to the limit (with the correct sign). Any of these 4679 parameter vectors may be set to \code{NULL}, in which case the concept 4680 is ignored in the analysis. The output information carried by the 4681 structure consists of the value of the function at the minimum 4682 (\code{value}), the number of iterations performed (\code{iter}) and 4683 last change in tolerance before returning (\code{lastDelta}). 4652 4684 4653 4685 \begin{datatype} … … 4658 4690 int iter; ///< Actual number of iterations performed 4659 4691 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 4660 4696 } psMinimization; 4661 4697 \end{datatype} … … 4665 4701 psMinimization *psMinimizationAlloc(int maxIter, float tol); 4666 4702 \end{prototype} 4703 and the parameter vectors are initially set to \code{NULL}. 4667 4704 4668 4705 \subsubsection{Levenberg-Marquardt} … … 4685 4722 psImage *covar, 4686 4723 psVector *params, 4687 const psVector *paramMask,4688 4724 const psArray *x, 4689 4725 const psVector *y, … … 4694 4730 The function shall return \code{false} in the event that there was an 4695 4731 error (bad input, too many iterations), and also call \code{psError}. 4732 It is not an error for the minimization to reach one of the parameter 4733 limits. 4696 4734 4697 4735 The minimization specification, \code{min}, shall be modified with the … … 4741 4779 the goodness of a fit. This function returns the distances of the 4742 4780 current parameter set from the minimization parameters expected from 4743 Gauss-Newton minimization. The arguments are identical to those of4744 \code{psMinimizeLMChi2} , except only the single vector \code{delta},4745 consisting of the distances, is returned. This vector must be4746 pre-allocated to thedimenstions of \code{params}.4781 Gauss-Newton minimization. The arguments have the same meaning as for 4782 \code{psMinimizeLMChi2}. The returned vector, \code{delta}, consists 4783 of the distances. This vector must be pre-allocated to the 4784 dimenstions of \code{params}. 4747 4785 4748 4786 %% \subsubsubsection{Pre-defined Functions for LM} … … 4785 4823 4786 4824 \begin{prototype} 4787 bool psMinimizePowell(psMinimization *min, psVector *params, const psVector *paramMask, 4788 const psArray *coords, psMinimizePowellFunc func); 4825 bool psMinimizePowell(psMinimization *min, 4826 psVector *params, 4827 const psVector *paramMask, 4828 const psArray *coords, 4829 psMinimizePowellFunc func); 4789 4830 \end{prototype} 4790 4831 4791 4832 The inputs and general behavior of this function is the same as for 4792 4833 \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?} 4794 4835 4795 4836 \subsubsubsection{Minimizing $\chi^2$ with Powell} … … 4803 4844 4804 4845 \begin{prototype} 4805 bool psMinimizeChi2Powell(psMinimization *min, psVector *params, const psVector *paramMask, 4806 const psArray *coords, const psVector *value, const psVector *error, 4846 bool psMinimizeChi2Powell(psMinimization *min, 4847 psVector *params, 4848 const psVector *paramMask, 4849 const psArray *coords, 4850 const psVector *value, 4851 const psVector *error, 4807 4852 psMinimizeChi2PowellFunc model); 4808 4853 \end{prototype} … … 4812 4857 instead of being provided the function to be minimized, it is provided 4813 4858 a 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?} 4814 4863 4815 4864 For this purpose, \code{value} shall contain measured values at the … … 5009 5058 5010 5059 \begin{prototype} 5060 psVector *psImageRow(psVector *out, 5061 const psImage *input, 5062 psU32 row); 5063 psVector *psImageCol(psVector *out, 5064 const psImage *input, 5065 psU32 column); 5066 \end{prototype} 5067 5068 These 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 5071 as fast, simple implementations of data extraction. For more 5072 sophisticated operations, the following two functions should be used. 5073 5074 \begin{prototype} 5011 5075 psVector *psImageSlice(psVector *out, 5012 5076 psPixels *coords, … … 5257 5321 following types: \code{psS8}, \code{psU16}, \code{psF32}, 5258 5322 \code{psF64}. 5323 5324 \begin{prototype} 5325 long psImageCountPixelMask (psImage *mask, psRegion region, psMaskValue value); 5326 \end{prototype} 5327 This function returns the number of pixels in the image region which 5328 satisfy any of the mask bits. An error (eg, invalid image, invalid 5329 region) results in a return value of -1. 5259 5330 5260 5331 \begin{prototype} … … 6230 6301 bool psTimerStart(char *name); 6231 6302 psF64 psTimerMark(char *name); 6303 psF64 psTimerClear(char *name); 6232 6304 psF64 psTimerStop(void); 6233 6305 \end{prototype} … … 6236 6308 timers, under the supplied \code{name}. \code{psTimerMark} shall 6237 6309 return 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, 6312 so that no memory is leaked, and return the maximum time expended. 6242 6313 6243 6314 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Note:
See TracChangeset
for help on using the changeset viewer.
