Changeset 20581
- Timestamp:
- Nov 7, 2008, 3:51:01 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotApResid.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotApResid.c
r20453 r20581 190 190 psVector *dMagSys = (psVector *) psBinaryOp (NULL, (void *) dMag, "*", (void *) psScalarAlloc(errorScale, PS_TYPE_F32)); 191 191 192 if (psTraceGetLevel("psphot") >= 5) {192 if (psTraceGetLevel("psphot") >= 2) { 193 193 FILE *dumpFile = fopen ("apresid.dat", "w"); 194 194 for (int i = 0; i < xPos->n; i++) { … … 289 289 dMo->data.F32[i] = statsM->sampleMean; 290 290 dRo->data.F32[i] = statsS->robustStdev / statsM->sampleMean; 291 fprintf (stderr, "%d (%d) : sys: %f, phot: %f, rat: %f\n", i, j, dSo->data.F32[i], dMo->data.F32[i], dRo->data.F32[i]); 291 292 } else { 292 293 dSo->data.F32[i] = NAN; … … 339 340 Nx = PS_MAX (1, Nx); 340 341 } 341 342 if (Npsf < 3*Nx*Ny) { 342 343 // require at least 10 stars per spatial bin 344 if (Npsf < 10*Nx*Ny) { 343 345 return false; 344 346 } … … 356 358 psf->ApTrend = pmTrend2DAlloc (PM_TREND_MAP, readout->image, Nx, Ny, stats); 357 359 360 // XXX somewhat arbitrary: soften the errors so the few bright stars do not totally dominate: 361 psVector *dMagSoft = psVectorAlloc (dMag->n, PS_TYPE_F32); 362 for (int i = 0; i < dMag->n; i++) { 363 dMagSoft->data.F32[i] = hypot(dMag->data.F32[i], 0.01); 364 } 365 358 366 // XXX test for errors here 359 pmTrend2DFit (psf->ApTrend, mask, 0xff, xPos, yPos, apResid, dMag );367 pmTrend2DFit (psf->ApTrend, mask, 0xff, xPos, yPos, apResid, dMagSoft); 360 368 361 369 // construct the fitted values and the residuals … … 373 381 374 382 psFree (stats); 383 psFree (dMagSoft); 375 384 psFree (apResidFit); 376 385 psFree (apResidRes);
Note:
See TracChangeset
for help on using the changeset viewer.
