Changeset 5985 for branches/eam_rel9_p0/psModules/src/objects/pmPSFtry.c
- Timestamp:
- Jan 13, 2006, 9:02:53 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_rel9_p0/psModules/src/objects/pmPSFtry.c
r5958 r5985 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1.3.4. 1$ $Name: not supported by cvs2svn $8 * @date $Date: 2006-01-1 0 04:46:03 $7 * @version $Revision: 1.3.4.2 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2006-01-14 07:02:53 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 192 192 // we use an outlier rejection to avoid this bias 193 193 194 // r flux =ten(0.4*fitMag);195 psVector *r flux = psVectorAlloc (psfTry->sources->n, PS_TYPE_F64);194 // r2rflux = radius^2 * ten(0.4*fitMag); 195 psVector *r2rflux = psVectorAlloc (psfTry->sources->n, PS_TYPE_F64); 196 196 for (int i = 0; i < psfTry->sources->n; i++) { 197 197 if (psfTry->mask->data.U8[i] & PSFTRY_MASK_ALL) 198 198 continue; 199 r flux->data.F64[i] =pow(10.0, 0.4*psfTry->fitMag->data.F64[i]);200 } 201 202 // use 3hi/1lo sigma clipping on the r flux vs metric fit199 r2rflux->data.F64[i] = PS_SQR(RADIUS) * pow(10.0, 0.4*psfTry->fitMag->data.F64[i]); 200 } 201 202 // use 3hi/1lo sigma clipping on the r2rflux vs metric fit 203 203 psStats *stats = psStatsAlloc (PS_STAT_SAMPLE_MEDIAN | PS_STAT_SAMPLE_STDEV); 204 204 stats->min = 1.0; … … 206 206 stats->clipIter = 3; 207 207 208 // fit Ap Resid only to rflux, ignore x,yvariations for now209 // linear clipped fit of ApResid to r flux208 // fit ApTrend only to r2rflux, ignore x,y,flux variations for now 209 // linear clipped fit of ApResid to r2rflux 210 210 psPolynomial1D *poly = psPolynomial1DAlloc (1, PS_POLYNOMIAL_ORD); 211 poly = psVectorClipFitPolynomial1D (poly, stats, psfTry->mask, PSFTRY_MASK_ALL, psfTry->metric, NULL, r flux);211 poly = psVectorClipFitPolynomial1D (poly, stats, psfTry->mask, PSFTRY_MASK_ALL, psfTry->metric, NULL, r2rflux); 212 212 psLogMsg ("pmPSFtryMetric", 4, "fit stats: %f +/- %f\n", stats->sampleMedian, stats->sampleStdev); 213 213 214 psfTry->psf->ApTrend->coeff[0][0][0] = poly->coeff[0]; 215 psfTry->psf->ApTrend->coeff[0][0][1] = 0; 216 217 psfTry->psf->skyBias = poly->coeff[1] / (M_PI * PS_SQR(RADIUS)); 214 pmPSF_MaskApTrend (psfTry->psf, PM_PSF_SKYBIAS); 215 psfTry->psf->ApTrend->coeff[0][0][0][0] = poly->coeff[0]; 216 psfTry->psf->ApTrend->coeff[0][0][1][0] = 0; 217 218 psfTry->psf->skyBias = poly->coeff[1]; 218 219 psfTry->psf->ApResid = poly->coeff[0]; 219 220 psfTry->psf->dApResid = stats->sampleStdev; 220 221 221 psFree (r flux);222 psFree (r2rflux); 222 223 psFree (poly); 223 224 psFree (stats);
Note:
See TracChangeset
for help on using the changeset viewer.
