Changeset 5030
- Timestamp:
- Sep 13, 2005, 11:05:23 AM (21 years ago)
- Location:
- trunk/doc/modules
- Files:
-
- 3 edited
-
CameraImages.tex (modified) (4 diffs)
-
ChangeLogSDRS.tex (modified) (3 diffs)
-
ModulesSDRS.tex (modified) (49 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/modules/CameraImages.tex
r5022 r5030 114 114 of analyses (e.g., the r.m.s. of the overscan fit). 115 115 116 \tbd{At what stage are the offsets ( \code{col0,row0}) get set, and how117 arethey known?}116 \tbd{At what stage are the offsets ({\tt col0,row0}) set, and how are 117 they known?} 118 118 119 119 \subsubsection{A Readout} … … 405 405 have \code{valid} set to \code{true}. 406 406 407 \tbd{make these functions richer: select by extention, extname, cell, 408 options to invalidate all / validate all, etc} 409 407 410 \begin{prototype} 408 411 bool pmFPAMorph(pmFPA *toFPA, pmFPA *fromFPA, bool positionDependent, int chipNum, int cellNum); 409 bool pmFPAWrite(psFits *fits, pmFPA *fpa);410 412 \end{prototype} 411 412 These two functions write out a focal plane hierarchy to a FITS file.413 413 414 414 \code{pmFPAMorph} shall morph the \code{fromFPA} focal plane hierarchy … … 434 434 suitable error message, in which case it shall return \code{false}. 435 435 436 \begin{prototype} 437 bool pmFPAWrite(psFits *fits, pmFPA *fpa); 438 \end{prototype} 439 436 440 \code{pmFPAWrite} shall write the focal plane hierarchy, \code{fpa}, 437 441 to the specified \code{fits} file, returning \code{true} upon success … … 445 449 \code{pmFPAWriteMask} is very similar to \code{pmFPAWrite}, but it 446 450 shall write the \code{mask} elements of the \code{pmReadout}s 447 comprinsing the \code{fpa}. 451 comprising the \code{fpa}. 452 453 \begin{prototype} 454 pmFPAWriteWeight(psFits *fits, pmFPA *fpa); 455 \end{prototype} 456 457 \code{pmFPAWriteWeight} is very similar to \code{pmFPAWrite}, but it 458 shall write the \code{weight} elements of the \code{pmReadout}s 459 comprising the \code{fpa}. 448 460 449 461 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -
trunk/doc/modules/ChangeLogSDRS.tex
r5022 r5030 1 %%% $Id: ChangeLogSDRS.tex,v 1.3 1 2005-09-13 03:26:45 price Exp $1 %%% $Id: ChangeLogSDRS.tex,v 1.32 2005-09-13 21:05:23 eugene Exp $ 2 2 3 3 \subsection{Changes from version 00 (16 August 2004) to version 01 (12 October 2004)} … … 87 87 \end{itemize} 88 88 89 \subsection{Changes from version 07 (15 July 2005) to present (???)}89 \subsection{Changes from version 07 (15 July 2005) to version 08 (13 Sept 2005)} 90 90 91 91 \begin{itemize} … … 107 107 \item Modified \code{pmSubtractBias}. 108 108 \item Remove mask from \code{pmFlatField} (mask is contained in the readout). 109 110 \item cleaned up / extended discussion of FITS and the FPA hierarchy. 111 \item added \code{CONCEPT.DEFAULT} to \code{DEFAULTS} table. 112 \item added \code{psArgumentVerbosity} requirement to \code{pmConfigRead}. 113 114 \item substantial changes to the Objects section: 115 \begin{itemize} 116 \item added \code{psphotMaskValues}? 117 \item added SN to \code{pmMoments} 118 \item added \code{pmPSFClump} 119 \item modified \code{pmSourceType} enum list 120 \item added radius to \code{pmModel} 121 \item added \code{pmModelGroup} 122 \item added several Model Group functions 123 \item added \code{pmPSF} and related functions 124 \item added \code{pmPSFtry} and related functions 125 \item added \code{pmSourceDefinePixels} 126 \item modified \code{pmSourceLocalSky} API 127 \item modified \code{pmSourceMoments} API 128 \item added \code{pmSourcePSFClump} 129 \item modified \code{pmSourceRoughClass} API 130 \item dropped \code{pmSourceSetPixelsCircle} (replaced with 131 \code{pmSourceDefinePixels} and the image mask functions. 132 \item added \code{pmModelFitStatus} 133 \item added \code{pmSourcePhotometry} 134 \item added \code{pmSourceDophotType} 135 \item added \code{pmSourceSextractType} 136 \item moved discussion of the object models to an appendix 109 137 \end{itemize} 138 \end{itemize} -
trunk/doc/modules/ModulesSDRS.tex
r5023 r5030 1 %%% $Id: ModulesSDRS.tex,v 1.5 7 2005-09-13 03:36:09 price Exp $2 \documentclass[panstarrs ]{panstarrs}1 %%% $Id: ModulesSDRS.tex,v 1.58 2005-09-13 21:05:23 eugene Exp $ 2 \documentclass[panstarrs,spec]{panstarrs} 3 3 4 4 % basic document variables … … 11 11 \project{Pan-STARRS Image Processing Pipeline} 12 12 \organization{Institute for Astronomy} 13 \version{0 7}13 \version{08} 14 14 \docnumber{PSDC-430-012} 15 15 16 \setlength{\topsep}{-2pt}17 18 16 \begin{document} 19 17 \maketitle … … 35 33 06 & 2005 Apr 27 & final for cycle 6 \\ \hline 36 34 07 & 2005 Jul 15 & final for cycle 7 \\ \hline 35 08 & 2005 Sep 13 & final for cycle 8 \\ \hline 37 36 \RevisionsEnd 38 37 … … 74 73 75 74 PSLib defines a \code{psMetadata} structure which can carry labeled 76 data of arbi rtary types. The associated functions implemented by75 data of arbitrary types. The associated functions implemented by 77 76 PSLib consist of tools to manipulate and extract data from 78 \code{psMetadata} collections. Within PSLib, the \code{psMetadata} 79 stucture is used to carry the data from a FITS header. In addition, 80 functions are available to fill a \code{psMetadata} collection from a 81 text-based configuration file using a particular syntax, and to fill a 82 \code{psMetadata} collection from a properly formatted XML document. 77 \code{psMetadata} collections. A particular application of the 78 \code{psMetadata} structure within PSLib is to carry the data from a 79 FITS header. Other general-purpose information is also carried with 80 the structure. Functions are available to fill a \code{psMetadata} 81 collection from a text-based configuration file using a human-readable 82 syntax, and to fill a \code{psMetadata} collection from a properly 83 formatted XML document. 83 84 84 85 In the IPP Modules, we use \code{psMetadata} collections to carry … … 108 109 configuration being the most general, and the recipe configuration the 109 110 most specific. For example, not all sites will have to deal with all 110 cameras, and different cameras will have different recipes according 111 to their particular quirks. 111 cameras, and different cameras may require different recipes at 112 different times according to their particular quirks, analysis 113 experimentations, or their evolution. 112 114 113 115 Each of the levels will have a metadata configuration file. In the … … 116 118 environment variable \code{PS_SITE}, if defined, or \code{~/.ipprc} 117 119 otherwise. The camera configuration shall be specified by the 118 \code{ camera} option on the command line if provided, or shall be120 \code{-camera} option on the command line if provided, or shall be 119 121 inferred from a FITS header (more detail below). The recipe 120 122 configuration shall be specified by the \code{-recipe} option on the … … 138 140 \end{itemize} 139 141 \item \code{CAMERAS} of type \code{METADATA}: A list of instruments 140 that the system can handle. Cameras are specified as separate142 that the system understands. Cameras are specified as separate 141 143 metadata entries, with the name of the camera as the key, and the 142 144 filename of the camera configuration file (of type \code{STR}) as … … 197 199 \subsubsection{Camera Configuration} 198 200 199 The camera configuration is the most complicated and involved, since201 The camera configuration is somewhat complicated and involved, since 200 202 it must not only specify how to translate the pixels from a FITS file 201 203 into a focal plane hierarchy (\S\ref{sec:focalplane}), but it must … … 216 218 correspond to individual reads of the detector. 217 219 220 The FITS data storage formation is a standard in the astronomical 221 community for storing astronomical images. A FITS file consists of an 222 arbitrary number of coupled human readable \code{ASCII} header 223 segments and binary data segments. The headers describe the format 224 and layout of the data segments. The first of these groups is 225 traditionally called the 'primary header unit' (PHU) and the rest are 226 referred to as 'extensions'. The header segments may contain 227 extensive documentary information related to the interpretation of the 228 data. Although the FITS format defines a standard representation of 229 the data, the header metadata is not so consistently defined within 230 the astronomical community. Also, the flexibility of the data format 231 means that different representations are possible for the same 232 fundamental collection of data. The tools presented in this section 233 provide a method to define and constrain the wide range of possible 234 FITS representations of astronomical images. 235 218 236 Within the FITS data representation, there are various choices which 219 237 can and have been made for the placement of the pixels in the file. … … 222 240 image data could be written as part of the primary data unit. In a 223 241 more complex case with multiple chips and multiple cells, the data may 224 be organized in variousways. The data may be distributed into242 be organized in several ways. The data may be distributed into 225 243 multiple files or in multiple FITS data extensions. A single camera 226 244 image may be written as a collection of files for individual chips … … 231 249 232 250 In all of these representations, there are only two basic distinctions 233 in how the pixel data is stored: what level the entire FITS file 234 corresponds to (FPA or chip), and what level the extensions correspond 235 to (chip, cell or no extensions at all). Knowing these, and having 236 a list of the components, we can construct the focal plane hierarchy. 237 238 We therefore specify the following keywords: 251 in how the pixel data is stored: what level in the hierarchy the 252 entire FITS file corresponds to (FPA, chip, or cell), and what level 253 the extensions correspond to (chip, cell or no extensions at all). 254 Knowing these, and having a list of the components, we can construct 255 the focal plane hierarchy. 256 257 Note that a single data extension, consisting of a uniform grid of 258 pixels, can only naturally represent a cell or a chip. In order to 259 represent the entire focal plane array as a single grid, some 260 artificial choices would be made to fill-in or ignore the gaps between 261 chips and their relative rotations. Within our framework, a complete 262 focal plane mosaic of multiple chips could be represented as a single 263 extension by treating the collection of pixels as if they were from a 264 single chip. 265 266 To define the hierarchy, we specify the following keywords: 239 267 \begin{itemize} 240 \item \code{PHU} of type \code{STR}: May be one of \code{CHIP} or 241 \code{CELL}. This specifies what the scale of the Primary Header 242 Unit (and hence the entire FITS file) is. 268 269 \item \code{PHU} of type \code{STR}: May be one of \code{FPA}, 270 \code{CHIP}, or \code{CHIP}. This specifies the focal plane level 271 of the Primary Header Unit, and hence the entire FITS file (the 272 'class' of the file) . 273 243 274 \item \code{EXTENSIONS} of type \code{STR}: May be one of \code{CHIP}, 244 275 \code{CELL} or \code{NONE}, though not of a level higher than that 245 276 specified by the \code{PHU}. This specifies what each extension 246 277 represents. 278 247 279 \item \code{CONTENTS} which may be of type \code{METADATA} or 248 280 \code{STR}, depending upon the \code{PHU} and \code{EXTENSIONS}, … … 431 463 Each image has associated with it what we will call {\it concepts} 432 464 (for want of a better word). These are values corresponding to 433 general quantities and qualities relevant to the IPP such as airmass,434 date, read noise and filter. The values of each of the below concepts 435 shall be determined when the FPA is read into memory (via 436 \code{pmFPARead}), and stored at the appropriate level in the focal 437 plane hierarchy.465 general quantities and qualities necessary to understand and interpret 466 the data such as airmass, date, read noise and filter. The values of 467 each of the below concepts shall be determined when the FPA is read 468 into memory (via \code{pmFPARead}), and stored at the appropriate 469 level in the focal plane hierarchy. 438 470 439 471 Below is a list of concepts that the IPP requires, with the … … 466 498 \end{itemize} 467 499 468 \tbd{Note that \code{CELL.EXPOSURE}, \code{CELL.DARKTIME} and469 \code{CELL.TIME} should actually be specified at the readout level. 470 However, at this present time, we're not sure how these should be471 specified, and so we move them up to the cell level and assume that 472 all readouts are of the sameexposure and dark time.}500 \tbd{Note that CELL.EXPOSURE, CELL.DARKTIME and CELL.TIME should 501 actually be specified at the readout level. However, at this present 502 time, we're not sure how these should be specified, and so we move 503 them up to the cell level and assume that all readouts are of the same 504 exposure and dark time.} 473 505 474 506 For different camera systems, these concepts are not always known by … … 498 530 \code{METADATA}, with the component keywords being the value of the 499 531 second concept (on which the first depends). To avoid infinite 500 recursion, no further dependency is permitted. An example of the 532 recursion, no further dependency is permitted. We also allow an entry 533 \code{CONCEPT.DEFAULT} specifiying the default value of the concept if 534 a match is not made with the dependcency list. An example of the 501 535 dependency: 502 536 … … 505 539 DEFAULTS METADATA 506 540 CELL.GAIN.DEPEND STR CHIP.NAME 541 CELL.GAIN.DEFAULT STR 1.0 507 542 CELL.GAIN METADATA 508 543 ccd00 F32 1.2 … … 552 587 553 588 Note that the FITS standard is that the time in the header refers to 554 the {\it start} of the observation. \tbd{In the future, we might add 555 additional qualifiers that calculate the start time of the observation 556 based on someone foolishly putting the end- or mid-time in the header.} 557 558 \tbd{Should we move \code{CELL.TIMESYS} into the format as well?} 589 the {\it start} of the observation. 590 591 \tbd{the PRE2000 and BACKWARDS qualifiers should be replace with 592 explicit format definitions in the form YYYY/MM/DD} 593 594 \tbd{In the future, we might add additional qualifiers that calculate 595 the start time of the observation based on someone foolishly putting 596 the end- or mid-time in the header.} 597 598 \tbd{Should we move CELL.TIMESYS into the format as well?} 559 599 560 600 \paragraph{FPA.RA and FPA.DEC} … … 607 647 commas or semi-colons) that contains the appropriate values. 608 648 \end{itemize} 649 650 \tbd{the use of implicit interpretation of formats should be 651 discouraged: format interpretation guides should be provided} 609 652 610 653 \subsection{Configuration APIs} … … 641 684 trace levels specified by the \code{TRACE}. 642 685 \end{itemize} 686 Note that additional log/trace command-line options may be specified 687 and interpretted using the \code{psArgumentVerbosity} function from 688 psLib. These options should (in the case of logging) override the 689 configuration-supplied information or (in the case of tracing) 690 supplement it. 643 691 644 692 \code{pmConfigCameraFromHeader} shall load the \code{camera} … … 784 832 M_{\rm pM} - pA, M_{\rm sP} - M_{\rm sM} - sA)$. 785 833 786 \section{Phase 2} 787 788 Phase 2 is the processing stage wherein the instrumental signatures 789 are removed from the detector images, in preparation for the 790 combination of multiple images in Phase 4. 791 792 The Phase 2 processing modules are: 834 \section{Image Detrending} 835 836 Image Detrending is the image analysis process wherein the 837 instrumental signatures are removed from the individual images. This 838 section discusses the modules used for image detrending. The basic 839 image detrending steps are: 793 840 \begin{itemize} 794 841 \item Subtract bias; … … 797 844 \item Mask bad pixels; 798 845 \item Subtract the background; 799 \item \tbd{Mask cosmic rays;} 800 \item \tbd{Mask optical defects;} 801 \item \tbd{Measure the PSF;} 802 \item \tbd{Find and measure objects;} 803 \item \tbd{Correct astrometry; and} 804 \item \tbd{Get postage stamps.} 846 \item Mask cosmic rays; 847 \item Mask optical defects; 805 848 \end{itemize} 806 807 Each of these shall be discussed in turn, below. Those modules which808 are \tbd{} will be deferred until they may be properly defined,809 some of which requires further research to define the best algorithm.810 849 811 850 \subsection{Bias subtraction} … … 995 1034 \label{sec:maskValues} 996 1035 997 We define several mask values for use in the phase 2processing:1036 We define several mask values for use in the detrend processing: 998 1037 \begin{datatype} 999 1038 /** Mask values */ … … 1033 1072 the \code{growVal}). 1034 1073 1035 \tbd{In the future, may change \code{grow} to a convolution kernel}.1074 \tbd{In the future, may change {\tt grow} to a convolution kernel}. 1036 1075 1037 1076 Note that the input image, \code{in}, and the \code{mask} need not be … … 1104 1143 1105 1144 The elements of the focal plane hierarchy each contain an 1106 \code{analysis} member, intended to log the results of the Phase 21107 tasks. The Phase 2tasks shall add to the \code{analysis} members as1145 \code{analysis} member, intended to log the results of the detrend 1146 tasks. The detrend tasks shall add to the \code{analysis} members as 1108 1147 follows: 1109 1148 … … 1294 1333 of the same type. 1295 1334 1296 \section{Object Detection, Measurement, and Classification Routines}1335 \section{Objects on Images} 1297 1336 1298 1337 \subsection{Overview} … … 1304 1343 The elements defined in this section are generally low-level 1305 1344 components which can be connected together to construct a complete 1306 object measurement suite. An example pseudo-C program using these 1307 functions is provided in Appendix~\ref{psphot}. 1345 object measurement suite. 1308 1346 1309 1347 We first define the collection of structures needed to carry … … 1329 1367 referenced without attempting to supply an analytical model. Finally, 1330 1368 it is often useful to allow a single complex model to be represented 1331 as a collection of simpler contained structures which may be model led.1369 as a collection of simpler contained structures which may be modeled. 1332 1370 Thus, the representation of an object must be capable of identifying 1333 1371 children, or substructures, of that object. … … 1394 1432 edge. The \code{PM_PEAK_FLAT} represents a peak pixel which has more 1395 1433 than a specific number of neighbors at the same value, within some 1396 tol arence:1434 tolerance: 1397 1435 \begin{datatype} 1398 1436 typedef enum { … … 1477 1515 \subsubsection{pmModel Source Model and Abstraction} 1478 1516 1479 An object's flux distribution may be model led with some analytical1517 An object's flux distribution may be modeled with some analytical 1480 1518 function. The description of the model includes the model parameters 1481 1519 and their errors, along with the fit $\chi^2$. The model type is … … 1566 1604 1567 1605 \code{pmModelFunc} is the function used to determine the value of the 1568 m doel at a specific coordinate, and is the one used by1606 model at a specific coordinate, and is the one used by 1569 1607 \code{psMinimizeLMChi2}. 1570 1608 … … 1681 1719 set by the model fitting and psf fitting steps. For each model, the 1682 1720 value of the quality metric is stored in the vector \code{metric} and 1683 the fitted instrumental magn tiude is stored in \code{fitMag}. The1721 the fitted instrumental magnitude is stored in \code{fitMag}. The 1684 1722 quality metric for the PSF model is the aperture magnitude minus the 1685 1723 fitted magnitude for each source. This collection of aperture 1686 1724 residuals is examined in the analysis process, and a linear trend of 1687 the residual with the inverse object flux (ie, $10^{0.4*mag )$) is1725 the residual with the inverse object flux (ie, $10^{0.4*mag}$) is 1688 1726 fitted. The result of this fit is a measured sky bias (systematic 1689 1727 error in the sky measured by the fits), an effective … … 1709 1747 1710 1748 The following datatype defines the masks used by the \code{pmPSFtry} 1711 an slysis to identify sources which should or should not be included in1749 analysis to identify sources which should or should not be included in 1712 1750 the analysis. 1713 1751 \begin{datatype} … … 1736 1774 \end{prototype} 1737 1775 1738 \subsection{Object Model Abstraction}1739 1740 \tbd{this section is duplicating the section above}1741 1742 The object model functions are defined to allow for the flexible1743 addition of new object models. Every object model, with parameters1744 represented by \code{pmModel}, has an associated set of functions1745 which provide necessary support operations. A set of abstract1746 functions allow the programmer to select the approriate function or1747 property for a specific named object model.1748 1749 The following function concepts are provided by each model.1750 1751 \begin{prototype}1752 typedef psMinimizeLMChi2Func psModelFunc;1753 \end{prototype}1754 This function is the model chi-square minimization function for this1755 model.1756 1757 \begin{prototype}1758 typedef psF64 (*psModelFlux)(const psVector *params);1759 \end{prototype}1760 This function returns the integrated flux for the given model1761 parameters.1762 1763 \begin{prototype}1764 typedef bool (*psModelGuessFunc)(psModel *model, psSource *source);1765 \end{prototype}1766 This function provides the model guess parameters based on the details1767 of the given source.1768 1769 \begin{prototype}1770 typedef bool (*psModelFromPSFFunc)(psModel *modelPSF, psModel *modelFLT, pmPSF *psf);1771 \end{prototype}1772 This function constructs the PSF model for the given source based on1773 the supplied \code{psf} and the FLT model for the object.1774 1775 \begin{prototype}1776 typedef psF64 (*psModelRadius)(const psVector *params, double flux);1777 \end{prototype}1778 This function returns the radius at which the given model and1779 parameters achieves the given flux.1780 1781 Each of the function types above has a corresponding function which1782 returns the function given the model type:1783 \begin{prototype}1784 psModelFunc psModelFunc_GetFunction (psModelType type);1785 psModelFlux psModelFlux_GetFunction (psModelType type);1786 psModelGuessFunc psModelGuessFunc_GetFunction (psModelType type);1787 psModelFromPSFFunc psModelFromPSFFunc_GetFunction (psModelType type);1788 psModelRadius psModelRadius_GetFunction (psModelType type);1789 \end{prototype}1790 1791 In addition, the following utility functions return information about1792 the specified model:1793 1794 \begin{prototype}1795 psS32 psModelParameterCount (psModelType type);1796 psS32 psModelSetType (char *name);1797 char *psModelGetType (psModelType type);1798 \end{prototype}1799 \code{psModelParameterCount} returns the number of parameters for the1800 given model. The remaining functions lookup the name or identifying1801 code for the model from the other concept. Model names are character1802 strings in all caps of the form \code{GAUSS}. Names are invarient1803 between multiple compliations of the library, but the model numbers1804 are not and should only be used within programs.1805 1806 1776 \subsection{Basic Object Detection APIs} 1807 1777 … … 1819 1789 cases must be addressed. Equal value elements: If an element has the 1820 1790 same value as the following element, it is not considered a peak. If 1821 an element has the same value as the prece eding element (but not the1791 an element has the same value as the preceding element (but not the 1822 1792 following), then it is considered a peak. Note that this rule 1823 1793 (arbitrarily) identifies flat regions by their trailing edge. Edge … … 1858 1828 1859 1829 \begin{prototype} 1860 pmSource *pmSourceLocalSky(const psImage *image, const pmPeak *peak, psStatsOptions statsOptions, float innerRadius, float outerRadius); 1861 \end{prototype} 1862 1863 Measure the local sky in the vicinity of the given \code{peak}. The 1864 image pixels in the square annulus with inner and outer half-width 1865 ('square-radii') as specified are used to measure the local background 1866 in the vicinity of the the specified peak coordinates. The local 1867 background measurement uses the specified statistic passed in via the 1868 \code{stats} entry. This function allocates a \code{pmSource} 1869 structure and uses the resulting sky to set the value of the 1870 \code{pmMoments.sky} element of that \code{pmSource} structure. The 1871 input \code{peak} is also placed on the \code{pmSource} structure, 1872 which is then returned. 1830 bool pmSourceDefinePixels(pmSource *mySource, 1831 pmReadout *readout, 1832 psF32 x, 1833 psF32 y, 1834 psF32 Radius) 1835 \end{prototype} 1836 1837 Define \code{psImage} subarrays for the source located at coordinates 1838 \code{x,y} on the image set defined by \code{readout}. The pixels 1839 defined by this operation consist of a square window (of full width $2 1840 Radius + 1$) centered on the pixel which contains the given 1841 coordinate, in the frame of the readout. The window is defined to 1842 have limits which are valid within the boundary of the \code{readout} 1843 image, thus if the radius would fall outside the image pixels, the 1844 subimage is truncated to only consist of valid pixels. If 1845 \code{readout->mask} or \code{readout->weight} are not \code{NULL}, 1846 matching subimages are defined for those images as well. This 1847 function fails if no valid pixels can be defined (x or y less than 1848 Radius, for example). This function should be used to define a region 1849 of interest around a source, including both source and sky pixels. 1850 1851 \begin{prototype} 1852 pmSource *pmSourceLocalSky(pmSource *source, 1853 psStatsOptions statsOptions, 1854 psF32 Radius) 1855 \end{prototype} 1856 1857 Measure the local sky in the vicinity of the given \code{source}. The 1858 \code{Radius} defines the square aperture in which the moments will be 1859 measured. This function assumes the source pixels have been defined, 1860 and that the value of \code{Radius} here is smaller than the value of 1861 \code{Radius} used to define the pixels. The annular region not 1862 contained within the radius defined here is used to measure the local 1863 background in the vicinity of the source. The local background 1864 measurement uses the specified statistic passed in via the 1865 \code{statsOptions} entry. This function allocates the 1866 \code{pmMoments} structure. The resulting sky is used to set the 1867 value of the \code{pmMoments.sky} element of the provided 1868 \code{pmSource} structure. 1873 1869 1874 1870 \begin{prototype} … … 1884 1880 value indicates the success (TRUE) of the operation. 1885 1881 1886 \tbd{add pmSourcePSFClump} 1887 1888 \tbd{fix pmSourceRoughClass} 1889 1890 \tbd{add pmSourcePhotometry} 1891 1892 \tbd{pmSourceDophotType} 1893 1894 \tbd{pmSourceSextractType} 1895 1896 \tbd{pmModelFitStatus} 1897 1898 \begin{prototype} 1899 bool pmSourceRoughClass(pmArray *source, psMetadata *metadata); 1882 \begin{prototype} 1883 pmPSFClump pmSourcePSFClump(psArray *sources, psMetadata *metadata); 1884 \end{prototype} 1885 1886 We use the source moments to make an initial, approximate source 1887 classification, and as part of the information needed to build a PSF 1888 model for the image. As long as the PSF shape does not vary 1889 excessively across the image, the sources which are represented by a 1890 PSF (the start) will have very similar second moments. The function 1891 \code{pmSourcePSFClump} searches a collection of \code{sources} with 1892 measured moments for a group with moments which are all very similar. 1893 The function returns a \code{pmPSFClump} structure, representing the 1894 centroid and size of the clump in the $\sigma_x$, $\sigma_y$ 1895 second-moment plane. 1896 1897 The goal is to identify and characterize the stellar clump within the 1898 $\sigma_x, \sigma_y$ plane. To do this, an image is constructed to 1899 represent this plane. The units of $\sigma_x$ and $\sigma_y$ are in 1900 image pixels. A pixel in this analysis image represents 0.1 pixels in 1901 the input image. The dimensions of the image need only be 10 pixels. 1902 The peak pixel in this image (above a threshold of half of the image 1903 maximum) is found. The coordinates of this peak pixel represent the 1904 2D mode of the $\sigma_x, \sigma_y$ distribution. The sources with 1905 $\sigma_x, \sigma_y$ within 0.2 pixels of this value are then used to 1906 calculate the median and standard deviation of the $\sigma_x, 1907 \sigma_y$ values. These resulting values are returned via the 1908 \code{pmPSFClump} structure. 1909 1910 The return value indicates the success (TRUE) of the operation. 1911 1912 \tbd{limit the S/N of the candidate sources (part of Metadata)?} 1913 1914 \tbd{save the clump parameters on the Metadata} 1915 1916 \begin{prototype} 1917 bool pmSourceRoughClass(psArray *sources, psMetadata *metadata, pmPSFClump clump) 1900 1918 \end{prototype} 1901 1919 1902 1920 Based on the specified data values, make a guess at the source 1903 1921 classification. The sources are provides as a \code{psArray} of 1904 \code{p sSource} entries. Definable parameters needed to make the1922 \code{pmSource} entries. Definable parameters needed to make the 1905 1923 classification are provided to the routine with the \code{psMetadata} 1906 1924 structure. The rules below refer to values which can be extracted … … 1925 1943 electrons, stored with the metadata keyword \code{READ_NOISE}. 1926 1944 1927 Sources with $SN$ less than \code{FAINT_SN_LIM} are identified as type1928 \code{PM_SOURCE_FAINTSTAR}. Sources with $SN$ greater than1929 \code{PSF_SN_LIM} are then selected as possible PSF stars. These1930 sources are used to determine a guess at the shape of the PSF, based1931 on the collection of $\sigma_x$ and $\sigma_y$ values.1932 1933 The goal is to identify and characterize the stellar clump within the1934 $\sigma_x, \sigma_y$ plane. To do this, an image is constructed to1935 represent this plane. The units of $\sigma_x$ and $\sigma_y$ are in1936 image pixel. A pixel in this analysis image represents 0.1 pixels in1937 the input image. The dimensions of the image need only be 10 pixels.1938 The peak pixel in this image (above a threshold of half of the image1939 maximum) is found. The coordinates of this peak pixel represent the1940 2D mode of the $\sigma_x, \sigma_y$ distribution. The sources with1941 $\sigma_x, \sigma_y$ within 0.2 pixels of this value are then used to1942 calculate the median and standard deviation of the $\sigma_x,1943 \sigma_y$ values. These resulting values are placed back on the1944 metadata structure with the metadata names \code{PSF_CLUMP_X},1945 \code{PSF_CLUMP_dX} and \code{PSF_CLUMP_Y}, \code{PSF_CLUMP_dY}.1946 1947 1945 All sources with: 1948 1946 \[ |\sigma_x - \mbox{CLUMP}_x| < \mbox{CLUMP}_{dx}\] … … 1961 1959 \tbd{need to exclude stars outside valid data region}. 1962 1960 1963 The return value indicates the success (TRUE) of the operation. 1961 Sources with $SN$ less than \code{FAINT_SN_LIM} are identified as type 1962 \code{PM_SOURCE_FAINTSTAR}. Sources with $SN$ greater than 1963 \code{PSF_SN_LIM} are then selected as possible PSF stars. These 1964 sources are used to determine a guess at the shape of the PSF, based 1965 on the collection of $\sigma_x$ and $\sigma_y$ values. 1966 1967 \tbd{this discussion needs to be adjusted to match the implementation} 1964 1968 1965 1969 \subsection{Object Fitting} … … 1987 1991 \item Subtract model from image. 1988 1992 \end{enumerate} 1989 1990 \begin{prototype}1991 bool pmSourceSetPixelsCircle(pmSource *source, const psImage *image, float radius, int maskVal);1992 \end{prototype}1993 1994 Define pixels associated with a source based on a circular aperture.1995 This operation creates the \code{source.pixels} and \code{source.mask}1996 entries for the source based on a circular aperture centered on the1997 source centroid, if the \code{pmSource.pmMoments} entry exists, or1998 \code{pmSource.pmPeak} if it does not. The \code{source.pixels} is a1999 subimage of the input image. The function returns \code{TRUE} on2000 success or \code{FALSE} on failure.2001 1993 2002 1994 \begin{prototype} … … 2039 2031 2040 2032 \begin{prototype} 2033 bool pmModelFitStatus (pmModel *model); 2034 \end{prototype} 2035 2036 This function wraps the call to the model-specific function returned 2037 by \code{pmModelFitStatusFunc_GetFunction}. The model-specific 2038 function examines the model parameters, parameter errors, Chisq, S/N, 2039 and other parameters available from \code{model} to decide if the 2040 particular fit was successful or not. 2041 2042 \begin{prototype} 2041 2043 bool pmSourceAddModel(psImage *image, pmSource *source, bool center, bool sky); 2042 2044 bool pmSourceSubModel(psImage *image, pmSource *source, bool center, bool sky); … … 2045 2047 Add or subtract the given source model flux to/from the provided 2046 2048 image. The boolean option \code{center} selects if the source is 2047 re centered to the image center or if it is placed at its centroid2049 re-centered to the image center or if it is placed at its centroid 2048 2050 location. The boolean option \code{sky} selects if the background sky 2049 2051 is applied (\code{TRUE}) or not. The pixel range in the target image … … 2051 2053 image. The success status is returned. 2052 2054 2053 \subsection{Basic Object Models} 2054 \label{ObjectModels} 2055 2056 We specify a variety of basic object models which are required. 2057 Details of the model functional forms, parameters, and the derivatives 2058 are specified in the ADD. 2059 2060 \subsubsection{Real 2D Gaussian} 2061 2062 \begin{prototype} 2063 float pmMinLM_Gauss2D(psVector *deriv, psVector *params, psVector *x); 2064 \end{prototype} 2065 2066 This function is a two-dimensional Gaussian with an elliptical 2067 cross-section and a constant local background. 2068 2069 The intial guess for the Gaussian parameters may be taken from the 2070 moments, peak value, and local sky. 2071 2072 \subsubsection{Pseudo-Gaussian} 2073 2074 \begin{prototype} 2075 float pmMinLM_PseudoGauss2D(psVector *deriv, psVector *params, psVector *x); 2076 \end{prototype} 2077 2078 This function is a polynomial approximation of a 2D Gaussian otherwise 2079 very similar to the real Gaussian. It is used in place of a real 2080 Gaussian for speed. 2081 2082 The intial guess for the Gaussian parameters may be taken from the 2083 moments, peak value, and local sky. 2084 2085 \subsubsection{Waussian} 2086 2087 \begin{prototype} 2088 float pmMinLM_Wauss2D(psVector *deriv, psVector *params, psVector *x); 2089 \end{prototype} 2090 2091 The Waussian is a modified polynomial approximation of a 2D Gaussian, 2092 with non-linear polynomial terms having variable coefficients, rather 2093 than the Taylor series values of 1/2 and 1/6. 2094 2095 \subsubsection{Twisted Gaussian} 2096 2097 \begin{prototype} 2098 float pmMinLM_TwistGauss2D(psVector *deriv, psVector *params, psVector *x); 2099 \end{prototype} 2100 2101 This function describes an object with power-law wings and a flattened 2102 core, where the core has a different contour from the wings. 2103 2104 The intial guess for the Gaussian parameters may be taken from the 2105 moments, peak value, and local sky. 2106 2107 \tbd{future galaxy models to be implemented} 2108 2109 \subsubsection{Sersic Galaxy Model} 2110 2111 \begin{prototype} 2112 float pmMinLM_Sersic(psVector *deriv, psVector *params, psVector *x); 2113 \end{prototype} 2114 2115 \subsubsection{Sersic with Core Galaxy Model} 2116 2117 \begin{prototype} 2118 float pmMinLM_SersicCore(psVector *deriv, psVector *params, psVector *x); 2119 \end{prototype} 2120 2121 \subsubsection{Pseudo Sersic Galaxy Model} 2122 2123 \begin{prototype} 2124 float pmMinLM_PseudoSersic(psVector *deriv, psVector *params, psVector *x); 2125 \end{prototype} 2126 2055 \begin{prototype} 2056 bool pmSourcePhotometry (float *fitMag, // integrated fit magnitude 2057 float *obsMag, // aperture flux magnitude 2058 pmModel *model, // model used for photometry 2059 psImage *image, // image pixels to be used 2060 psImage *mask // mask of pixels to ignore 2061 ); 2062 \end{prototype} 2063 2064 The function returns both the magnitude of the fit, defined as $-2.5 2065 \log{\rm flux}$, where the flux is integrated under the model, 2066 theoretically from a radius of 0 to infinity. In practice, we 2067 integrate the model beyond $50 \sigma$. The aperture magnitude is 2068 defined as $-2.5 \log{\rm flux}$, where the flux is summed for all 2069 pixels which are not excluded by the aperture mask. The model flux is 2070 calculated by calling the model-specific function provided by 2071 \code{pmModelFlux_GetFunction}. 2072 2073 \begin{prototype} 2074 int pmSourceDophotType (pmSource *source); 2075 \end{prototype} 2076 This function converts the source classification into the closest 2077 available approximation to the Dophot classification scheme. The 2078 following list gives the correspondence: 2079 \begin{verbatim} 2080 PM_SOURCE_DEFECT: 8 2081 PM_SOURCE_SATURATED: 8 2082 PM_SOURCE_SATSTAR: 10 2083 PM_SOURCE_PSFSTAR: 1 2084 PM_SOURCE_GOODSTAR: 1 2085 PM_SOURCE_POOR_FIT_PSF: 7 2086 PM_SOURCE_FAIL_FIT_PSF: 4 2087 PM_SOURCE_FAINTSTAR: 4 2088 PM_SOURCE_GALAXY: 2 2089 PM_SOURCE_FAINT_GALAXY: 2 2090 PM_SOURCE_DROP_GALAXY: 2 2091 PM_SOURCE_FAIL_FIT_GAL: 2 2092 PM_SOURCE_POOR_FIT_GAL: 2 2093 PM_SOURCE_OTHER: ? 2094 \end{verbatim} 2095 2096 \begin{prototype} 2097 int pmSourceSextractType (pmSource *source); 2098 \end{prototype} 2099 This function converts the source classification into the closest 2100 available approximation to the Sextractor classification scheme. 2101 \tbd{the correspondence is not yet defined}. 2127 2102 2128 2103 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% … … 2218 2193 questionable pixels neighbor each other in the transformed image. 2219 2194 \item The cores of point sources may mimic a cosmic ray, especially in 2220 under-sampled images. To minimi se flagging stars as cosmic rays, we2195 under-sampled images. To minimize flagging stars as cosmic rays, we 2221 2196 determine the gradient around the pixel of interest; if the gradient 2222 2197 is large, then the pixel is likely the core of a point source. In … … 2332 2307 Image subtraction is arguably the best method of identifying faint 2333 2308 variable sources in images with different point-spread functions. It 2334 relies on fitting for a convolution kernel that minimi ses the2309 relies on fitting for a convolution kernel that minimizes the 2335 2310 residuals in subtracting small regions of the image. The use of a 2336 2311 convolution kernel consisting of a linear combination of basis … … 2434 2409 \code{spatialOrder}). The \code{subIndex} is set to the kernel which 2435 2410 has \code{u = 0}, \code{v = 0}, \code{xOrder = 0} and \code{yOrder = 2436 0}, for the first of the gaussian widths in the \code{sigmas} vector.2411 0}, for the first of the Gaussian widths in the \code{sigmas} vector. 2437 2412 2438 2413 \subsection{Stamps} … … 2472 2447 2473 2448 \begin{prototype} 2474 psAr ary *pmSubtractionFindStamps(psArray *stamps, // Output stamps, or NULL2449 psArray *pmSubtractionFindStamps(psArray *stamps, // Output stamps, or NULL 2475 2450 const psImage *image, // Image for which to find stamps 2476 2451 const psImage *mask, // Mask … … 2491 2466 stamp \code{status} is \code{PM_STAMP_REJECTED}. 2492 2467 2493 A stamp shall be recogni sed as the pixel with the greatest value that2468 A stamp shall be recognized as the pixel with the greatest value that 2494 2469 does not have the corresponding pixel in the \code{mask} matching 2495 2470 \code{maskVal}. If the value of the this pixel does not exceed … … 2553 2528 2554 2529 Since this step is one of the major rate-limiting factors in image 2555 subtraction, care should be taken with optimi sation.2530 subtraction, care should be taken with optimization. 2556 2531 2557 2532 \begin{prototype} … … 2603 2578 input image, and then squaring to obtain the mean square residual. 2604 2579 2605 \subsection{Visuali sation of kernel}2606 2607 Having solved for the best-fit kernel, it is often useful to visuali se2580 \subsection{Visualization of kernel} 2581 2582 Having solved for the best-fit kernel, it is often useful to visualize 2608 2583 it. 2609 2584 … … 2709 2684 \appendix 2710 2685 2711 \section{Pseudo-C PSPhot} 2712 \label{psphot} 2713 2714 \begin{verbatim} 2715 # include <pslib.h> 2716 # include <psmodule.h> 2717 2718 main () { 2719 2720 psMetadata *header; 2721 psImage *image; 2722 2723 fd = psFitsOpen (argv[1]); 2724 md = psFitsReadHeader (fd); 2725 image = psFitsReadImage (fd, md); 2726 2727 stats = psImageStats (NULL, image); 2728 2729 RDNOISE = psMetadataLookup (md, "RDNOISE"); 2730 GAIN = psMetadataLookup (md, "GAIN"); 2731 INNER = psMetadataLookup (config, "INNER_RADIUS"); 2732 OUTER = psMetadataLookup (config, "OUTER_RADIUS"); 2733 SATURATE = psMetadataLookup (config, "SATURATE"); 2734 NSIGMA = psMetadataLookup (config, "PSF_PEAK_THRESHOLD"); 2735 RADIUS = psMetadataLookup (config, "PSF_MOMENTS_RADIUS"); 2736 XBORDER = psMetadataLookup (config, "XBORDER"); 2737 YBORDER = psMetadataLookup (config, "YBORDER"); 2738 2739 keep = psRegionAlloc (XBORDER, image->nCol - YBORDER, 2740 YBORDER, image->nRow - YBORDER); 2741 2742 Sky = stats->median; 2743 Sig = sqrt(Sky/GAIN + SQ(RDNOISE)); 2744 2745 kernel = psKernelParts (); 2746 smooth = psImageConvolve (NULL, image, kernel, PS_PARTS); 2747 2748 peaks = pmFindImagePeaks (smooth, NSIGMA*Sig + Sky); 2749 2750 peaks = pmCullImagePeaks (peaks, SATURATE, *keep); 2751 2752 sources = pmSourceLocalSky (image, peaks, INNER, OUTER); 2753 2754 sources = pmSourceMoments (image, sources, RADIUS); 2755 2756 sources = pmSourceRoughClassify (sources, SATURATE, MIN_SN_LIM, *keep); 2757 2758 stars = pmSourceSelectBrightStars (sources); 2759 2760 stars = pmSourceFitModel ( 2761 } 2762 2763 2764 2765 psArray *pmFindImagePeaks (psImage *image, float threshold) { 2766 2767 psVector *row; 2768 2769 row = psVectorAlloc (image[0].Ncol); 2770 2771 /* find peaks in each row */ 2772 for (i = 0; i < image[0].Nrow; i++) { 2773 rowpeaks = pmFindVectorPeaks (row, threshold); 2774 peaks.x = rowpeaks; 2775 peaks.y = i; 2776 peaks.z = image (i, x); 2777 } 2778 2779 /* drop non-local peaks (peaks with neighbors) */ 2780 for (n = 0; n < peaks.n; n++) { 2781 if (!local_peak) { 2782 drop_peak; 2783 } 2784 } 2785 return (peaks); 2786 } 2787 \end{verbatim} 2686 \section{Basic Object Models} 2687 \label{ObjectModels} 2688 2689 We specify a variety of basic object models which are required. 2690 Details of the model functional forms, parameters, and the derivatives 2691 are specified in the ADD. 2692 2693 \subsubsection{Real 2D Gaussian} 2694 2695 \begin{prototype} 2696 float pmMinLM_Gauss2D(psVector *deriv, psVector *params, psVector *x); 2697 \end{prototype} 2698 2699 This function is a two-dimensional Gaussian with an elliptical 2700 cross-section and a constant local background. 2701 2702 The initial guess for the Gaussian parameters may be taken from the 2703 moments, peak value, and local sky. 2704 2705 \subsubsection{Pseudo-Gaussian} 2706 2707 \begin{prototype} 2708 float pmMinLM_PseudoGauss2D(psVector *deriv, psVector *params, psVector *x); 2709 \end{prototype} 2710 2711 This function is a polynomial approximation of a 2D Gaussian otherwise 2712 very similar to the real Gaussian. It is used in place of a real 2713 Gaussian for speed. 2714 2715 The initial guess for the Gaussian parameters may be taken from the 2716 moments, peak value, and local sky. 2717 2718 \subsubsection{Waussian} 2719 2720 \begin{prototype} 2721 float pmMinLM_Wauss2D(psVector *deriv, psVector *params, psVector *x); 2722 \end{prototype} 2723 2724 The Waussian is a modified polynomial approximation of a 2D Gaussian, 2725 with non-linear polynomial terms having variable coefficients, rather 2726 than the Taylor series values of 1/2 and 1/6. 2727 2728 \subsubsection{Twisted Gaussian} 2729 2730 \begin{prototype} 2731 float pmMinLM_TwistGauss2D(psVector *deriv, psVector *params, psVector *x); 2732 \end{prototype} 2733 2734 This function describes an object with power-law wings and a flattened 2735 core, where the core has a different contour from the wings. 2736 2737 The initial guess for the Gaussian parameters may be taken from the 2738 moments, peak value, and local sky. 2739 2740 \tbd{future galaxy models to be implemented} 2741 2742 \subsubsection{Sersic Galaxy Model} 2743 2744 \begin{prototype} 2745 float pmMinLM_Sersic(psVector *deriv, psVector *params, psVector *x); 2746 \end{prototype} 2747 2748 \subsubsection{Sersic with Core Galaxy Model} 2749 2750 \begin{prototype} 2751 float pmMinLM_SersicCore(psVector *deriv, psVector *params, psVector *x); 2752 \end{prototype} 2753 2754 \subsubsection{Pseudo Sersic Galaxy Model} 2755 2756 \begin{prototype} 2757 float pmMinLM_PseudoSersic(psVector *deriv, psVector *params, psVector *x); 2758 \end{prototype} 2788 2759 2789 2760 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Note:
See TracChangeset
for help on using the changeset viewer.
