Changeset 4982 for trunk/doc/modules/ModulesSDRS.tex
- Timestamp:
- Sep 9, 2005, 8:30:32 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/doc/modules/ModulesSDRS.tex (modified) (10 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}
Note:
See TracChangeset
for help on using the changeset viewer.
