00001 /* @file pmPSFtry.h 00002 * 00003 * This file contains code that allows the user to try to fit several 00004 * PSF models to an image. 00005 * 00006 * @author EAM, IfA 00007 * 00008 * @version $Revision: 1.11 $ $Name: $ 00009 * @date $Date: 2007/01/24 02:54:15 $ 00010 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii 00011 */ 00012 00013 # ifndef PM_PSF_TRY_H 00014 # define PM_PSF_TRY_H 00015 00016 /// @addtogroup Objects Object Detection / Analysis Functions 00017 /// @{ 00018 00019 /** 00020 * 00021 * This structure contains a pointer to the collection of sources which will 00022 * be used to test the PSF model form. It lists the pmModelType type of model 00023 * being tests, and contains an element to store the resulting psf 00024 * representation. In addition, this structure carries the complete collection of 00025 * EXT (floating parameter) and PSF (fixed parameter) model fits to each of the 00026 * sources modelEXT and modelPSF. It also contains a mask which is set by the 00027 * model fitting and psf fitting steps. For each model, the value of the quality 00028 * metric is stored in the vector metric and the fitted instrumental magnitude is 00029 * stored in fitMag. The quality metric for the PSF model is the aperture 00030 * magnitude minus the fitted magnitude for each source. This collection of 00031 * aperture residuals is examined in the analysis process, and a linear trend of 00032 * the residual with the inverse object flux (ie, 100:4his structure contains a 00033 * pointer to the collection of sources which will be used to test the PSF model 00034 * form. It lists the pmModelType type of modmag) is fitted. The result of this 00035 * fit is a measured sky bias (systematic error in the sky measured by the fits), 00036 * an effective infinite-magnitude aperture correction (ApResid), and the scatter 00037 * of the aperture correction for the ensemble of PSF stars (dApResid). The 00038 * ultimate metric to intercompare multiple types of PSF models is the value of 00039 * the aperture correction scatter. 00040 * 00041 * XXX: There are many more members in the SDRS then in the prototype code. 00042 * I stuck with the prototype code. 00043 * 00044 * 00045 */ 00046 typedef struct 00047 { 00048 pmPSF *psf; ///< Add comment. 00049 psArray *sources; ///< pointers to the original sources 00050 psVector *mask; ///< Add comment. 00051 psVector *metric; ///< Add comment. 00052 psVector *metricErr; ///< Add comment. 00053 psVector *fitMag; ///< Add comment. 00054 } 00055 pmPSFtry; 00056 00057 00058 /** pmPSFtryMaskValues 00059 * 00060 * The following datatype defines the masks used by the pmPSFtry analysis to 00061 * identify sources which should or should not be included in the analysis. 00062 * 00063 */ 00064 typedef enum { 00065 PSFTRY_MASK_CLEAR = 0x00, ///< Add comment. 00066 PSFTRY_MASK_OUTLIER = 0x01, ///< 1: outlier in psf polynomial fit (provided by psPolynomials) 00067 PSFTRY_MASK_EXT_FAIL = 0x02, ///< 2: ext model failed to converge 00068 PSFTRY_MASK_PSF_FAIL = 0x04, ///< 3: psf model failed to converge 00069 PSFTRY_MASK_BAD_PHOT = 0x08, ///< 4: invalid source photometry 00070 PSFTRY_MASK_ALL = 0x0f, ///< Add comment. 00071 } pmPSFtryMaskValues; 00072 00073 00074 /** pmPSFtryAlloc() 00075 * 00076 * Allocate a pmPSFtry data structure. 00077 * 00078 */ 00079 pmPSFtry *pmPSFtryAlloc (psArray *sources, char *modelName, bool poissonErrors, psPolynomial2D *psfTrendMask); 00080 00081 /** pmPSFtryModel() 00082 * 00083 * This function takes the input collection of sources and performs a complete 00084 * analysis to determine a PSF model of the given type (specified by model name). 00085 * The result is a pmPSFtry with the results of the analysis. 00086 * 00087 */ 00088 pmPSFtry *pmPSFtryModel (psArray *sources, char *modelName, float RADIUS, bool poissonErrors, psPolynomial2D *psfTrendMask, bool applyWeights); 00089 00090 /** pmPSFtryMetric() 00091 * 00092 * This function is used to measure the PSF model metric for the set of 00093 * results contained in the pmPSFtry structure. 00094 * 00095 */ 00096 bool pmPSFtryMetric( 00097 pmPSFtry *psfTry, ///< Add comment. 00098 float RADIUS ///< Add comment. 00099 ); 00100 00101 /** pmPSFtryMetric_Alt() 00102 * 00103 * This function is used to measure the PSF model metric for the set of 00104 * results contained in the pmPSFtry structure (alternative implementation). 00105 * 00106 */ 00107 bool pmPSFtryMetric_Alt( 00108 pmPSFtry *try 00109 , ///< Add comment. 00110 float RADIUS ///< Add comment. 00111 ); 00112 00113 /** 00114 * 00115 * This function takes a collection of pmModel fitted models from across a 00116 * single image and builds a pmPSF representation of the PSF. The input array of 00117 * model fits may consist of entries to be ignored (noted by a non-zero mask 00118 * entry). The analysis of the models fits a 2D polynomial for each parameter to 00119 * the collection of model parameters as a function of position (and 00120 * normalization?). In this process, some of the input models may be marked as 00121 * outliers and excluded from the fit. These elements will be marked with a 00122 * specific mask value (1 == PSFTRY_MASK_OUTLIER). 00123 * 00124 */ 00125 bool pmPSFFromPSFtry (pmPSFtry *psfTry, bool applyWeights); 00126 00127 /// @} 00128 # endif
1.5.1