Changeset 6825
- Timestamp:
- Apr 10, 2006, 10:21:36 AM (20 years ago)
- Location:
- branches/rel10_ifa/psModules/src/objects
- Files:
-
- 6 edited
-
pmModel.h (modified) (2 diffs)
-
pmPSF.c (modified) (2 diffs)
-
pmPSF.h (modified) (3 diffs)
-
pmPSFtry.c (modified) (2 diffs)
-
pmSourceFitModel.c (modified) (2 diffs)
-
pmSourceFitSet.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/rel10_ifa/psModules/src/objects/pmModel.h
r6751 r6825 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1.1.2. 3$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-04- 01 02:47:20$8 * @version $Revision: 1.1.2.4 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-04-10 20:21:36 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 42 42 psVector *dparams; ///< Parameter errors. 43 43 float chisq; ///< Fit chi-squared. 44 float chisqNorm; ///< re-normalized fit chi-squared. 44 45 int nDOF; ///< number of degrees of freedom 45 46 int nIter; ///< number of iterations to reach min -
branches/rel10_ifa/psModules/src/objects/pmPSF.c
r6556 r6825 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1.4.4. 2$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-0 3-09 03:14:23$8 * @version $Revision: 1.4.4.3 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-04-10 20:21:36 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 97 97 pmPSF_MaskApTrend (psf, PM_PSF_SKYBIAS); 98 98 99 if (PM_PSF_POISSON_WEIGHTS) { 100 psf->ChiTrend = psPolynomial1DAlloc (PS_POLYNOMIAL_ORD, 1); 101 } else { 102 psf->ChiTrend = psPolynomial1DAlloc (PS_POLYNOMIAL_ORD, 2); 103 } 104 99 105 // don't define a growth curve : user needs to choose radius bins 100 106 psf->growth = NULL; -
branches/rel10_ifa/psModules/src/objects/pmPSF.h
r6556 r6825 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1.1.22. 2$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-0 3-09 03:14:23$8 * @version $Revision: 1.1.22.3 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-04-10 20:21:36 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 15 15 # ifndef PM_PSF_H 16 16 # define PM_PSF_H 17 18 # define PM_PSF_POISSON_WEIGHTS 1 17 19 18 20 /** pmPSF data structure … … 32 34 pmModelType type; ///< PSF Model in use 33 35 psArray *params; ///< Model parameters (psPolynomial2D) 36 psPolynomial1D *ChiTrend; ///< Chisq vs flux fit (correction for systematic errors) 34 37 psPolynomial4D *ApTrend; ///< ApResid vs (x,y,rflux) (rflux = ten(0.4*mInst) 35 38 pmGrowthCurve *growth; ///< apMag vs Radius 36 float ApResid; ///< ???37 float dApResid; ///< ???38 float skyBias; ///< ???39 float skySat; ///< ???40 float chisq; ///< PSF goodness statistic 39 float ApResid; ///< apMag - psfMag (for PSF stars) 40 float dApResid; ///< scatter of ApResid 41 float skyBias; ///< implied residual sky offset from ApResid fit 42 float skySat; ///< roll-over of ApResid fit 43 float chisq; ///< PSF goodness statistic (unused??) 41 44 int nPSFstars; ///< number of stars used to measure PSF 42 45 int nApResid; ///< number of stars used to measure ApResid -
branches/rel10_ifa/psModules/src/objects/pmPSFtry.c
r6556 r6825 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1.4.4. 2$ $Name: not supported by cvs2svn $8 * @date $Date: 2006-0 3-09 03:14:23$7 * @version $Revision: 1.4.4.3 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2006-04-10 20:21:36 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 184 184 psTrace ("psphot.psftry", 3, "keeping %d of %d PSF candidates (PSF)\n", Npsf, sources->n); 185 185 186 // make this optional 187 // DumpModelFits (psfTry->modelPSF, "modelsPSF.dat"); 186 // measure the chi-square trend as a function of flux (PAR[1]) 187 // this should be linear for Poisson errors and quadratic for constant sky errors 188 psVector *flux = psVectorAlloc (psfTry->sources->n, PS_TYPE_F64); 189 psVector *chisq = psVectorAlloc (psfTry->sources->n, PS_TYPE_F64); 190 psVector *mask = psVectorAlloc (psfTry->sources->n, PS_TYPE_MASK); 191 192 // write sources with models first 193 for (int i = 0; i < psfTry->sources->n; i++) { 194 pmModel *model = psfTry->modelPSF->data[i]; 195 if (model == NULL) { 196 flux->data.F64[i] = 0.0; 197 chisq->data.F64[i] = 0.0; 198 mask->data.U8[i] = 1; 199 } else { 200 flux->data.F64[i] = model->params->data.F32[1]; 201 chisq->data.F64[i] = model[0].chisq/model[0].nDOF; 202 mask->data.U8[i] = 0; 203 } 204 } 205 // use 3hi/3lo sigma clipping on the r2rflux vs metric fit 206 psStats *stats = psStatsAlloc (PS_STAT_SAMPLE_MEDIAN | PS_STAT_SAMPLE_STDEV); 207 stats->clipSigma = 3.0; 208 stats->clipIter = 3; 209 // linear clipped fit of ApResid to r2rflux 210 psVectorClipFitPolynomial1D (psfTry->psf->ChiTrend, stats, mask, 1, chisq, NULL, flux); 211 for (int i = 0; i < psfTry->psf->ChiTrend->nX + 1; i++) { 212 psLogMsg ("pmPSFtry", 4, "chisq vs flux fit term %d: %f +/- %f\n", i, psfTry->psf->ChiTrend->coeff[i]*pow(10000, i), psfTry->psf->ChiTrend->coeffErr[i]); 213 } 214 psLogMsg ("pmPSFtry", 4, "chisq vs flux fit: %f +/- %f\n", stats->sampleMedian, stats->sampleStdev); 215 psFree (stats); 216 psFree (flux); 217 psFree (chisq); 188 218 189 219 // XXX this function wants aperture radius for pmSourcePhotometry -
branches/rel10_ifa/psModules/src/objects/pmSourceFitModel.c
r6820 r6825 6 6 * @author GLG, MHPCC 7 7 * 8 * @version $Revision: 1.1.2. 4$ $Name: not supported by cvs2svn $9 * @date $Date: 2006-04- 09 18:45:42$8 * @version $Revision: 1.1.2.5 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2006-04-10 20:21:36 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 96 96 y->data.F32[nPix] = source->pixels->data.F32[i][j]; 97 97 // psMinimizeLMChi2 takes wt = 1/dY^2 98 if (P OISSON_WEIGHT) {98 if (PM_PSF_POISSON_WEIGHTS) { 99 99 yErr->data.F32[nPix] = 1.0 / source->weight->data.F32[i][j]; 100 100 } else { -
branches/rel10_ifa/psModules/src/objects/pmSourceFitSet.c
r6751 r6825 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.1.2. 3$ $Name: not supported by cvs2svn $6 * @date $Date: 2006-04- 01 02:47:20$5 * @version $Revision: 1.1.2.4 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2006-04-10 20:21:36 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 182 182 psS32 nPix = source->pixels->numRows * source->pixels->numCols; 183 183 184 // local sky variance 185 psF32 dSky = source->moments->dSky; 186 184 187 // construct the coordinate and value entries 185 188 psArray *x = psArrayAlloc(nPix); … … 206 209 y->data.F32[nPix] = source->pixels->data.F32[i][j]; 207 210 // psMinimizeLMChi2 takes wt = 1/dY^2 208 yErr->data.F32[nPix] = 1.0 / source->weight->data.F32[i][j]; 211 if (PM_PSF_POISSON_WEIGHTS) { 212 yErr->data.F32[nPix] = 1.0 / source->weight->data.F32[i][j]; 213 } else { 214 yErr->data.F32[nPix] = 1.0 / dSky; 215 } 209 216 nPix++; 210 217 }
Note:
See TracChangeset
for help on using the changeset viewer.
