Changeset 4642 for trunk/psphot/src/pspsf.c
- Timestamp:
- Jul 28, 2005, 7:04:10 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/pspsf.c (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/pspsf.c
r4375 r4642 21 21 psf->params->data[i] = Polynomial2DAlloc(1, 1, PS_POLYNOMIAL_ORD); 22 22 } 23 // set the destructors 23 24 return(psf); 24 25 } … … 48 49 test->fitMag->data.F64[i] = 0; 49 50 } 51 // set the destructors 52 50 53 return (test); 51 54 } … … 92 95 psLogMsg ("psphot.psftest", 4, "fit flt: %f sec for %d sources\n", psTimerMark ("fit"), sources->n); 93 96 psTrace ("psphot.psftest", 3, "keeping %d of %d PSF candidates (FLT)\n", Nflt, sources->n); 94 DumpModelFits (test->modelFLT, "modelsFLT.dat"); 97 98 // make this optional? 99 // DumpModelFits (test->modelFLT, "modelsFLT.dat"); 95 100 96 101 // stage 2: construct a psf (pmPSF) from this collection of model fits … … 141 146 psLogMsg ("psphot.psftest", 4, "fit psf: %f sec for %d sources\n", psTimerMark ("fit"), sources->n); 142 147 psTrace ("psphot.psftest", 3, "keeping %d of %d PSF candidates (PSF)\n", Npsf, sources->n); 143 DumpModelFits (test->modelPSF, "modelsPSF.dat"); 148 149 // make this optional 150 // DumpModelFits (test->modelPSF, "modelsPSF.dat"); 144 151 145 152 // XXX this function wants aperture radius from pmSourcePhotometry … … 188 195 // psPolynomial2DDump (psf->params->data[i]); 189 196 } 197 198 psFree (x); 199 psFree (y); 200 psFree (z); 201 psFree (dz); 190 202 return (true); 191 203 } … … 228 240 rflux->data.F64[i] = pow(10.0, 0.4*test->fitMag->data.F64[i]); 229 241 } 230 // psScalar *t1 = psScalar(0.4);231 // psVector *v1 = psBinaryOp (NULL, test->fitMag, "*", t1);232 // psVector *rflux = psUnaryOp (NULL, v1, "ten");233 // psFree (t1);234 // psFree (v1);235 242 236 243 // find min and max of (1/flux): … … 247 254 psTrace ("psphot.metricmodel", 3, "rflux max: %g, min: %g, delta: %g\n", stats->max, stats->min, dBin); 248 255 256 // group data in daBin bins, measure lower 50% mean 249 257 for (int i = 0; i < daBin->n; i++) { 250 258 … … 277 285 // dA values are contaminated with low outliers 278 286 // measure statistics only on upper 50% of points 287 // this would be easier if we could sort in reverse: 288 // 289 // psVectorSort (tmp, tmp); 290 // tmp->n = 0.5*tmp->n; 291 // stats = psStatsAlloc (PS_STAT_SAMPLE_MEDIAN); 292 // psVectorStats (stats, tmp, NULL, NULL, 0); 293 // psTrace ("psphot.metricmodel", 4, "rfBin %d (%g): %d pts, %g\n", i, rfBin->data.F64[i], tmp->n, stats->sampleMedian); 294 279 295 psVectorSort (tmp, tmp); 280 296 nKeep = 0.5*tmp->n; … … 291 307 292 308 daBin->data.F64[i] = stats->sampleMedian; 309 310 psFree (stats); 311 psFree (tmp); 312 psFree (tmp2); 293 313 } 294 314 … … 307 327 test->skyBias = poly->coeff[1] / (M_PI * PS_SQR(RADIUS)); 308 328 329 psFree (maskB); 330 psFree (rfBin); 331 psFree (daBin); 332 psFree (daBinFit); 333 psFree (daResid); 334 psFree (poly); 335 psFree (stats); 336 309 337 return true; 310 338 }
Note:
See TracChangeset
for help on using the changeset viewer.
