Changeset 5828 for trunk/psphot/src/psphotApResid.c
- Timestamp:
- Dec 22, 2005, 4:20:27 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotApResid.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotApResid.c
r5802 r5828 21 21 psVector *rflux = psVectorAlloc (300, PS_TYPE_F64); 22 22 psVector *apResid = psVectorAlloc (300, PS_TYPE_F64); 23 mask->n = rflux->n = apResid->n = 0;23 mask->n = xPos->n = yPos->n = rflux->n = apResid->n = 0; 24 24 Npsf = 0; 25 25 … … 43 43 44 44 psImageKeepCircle (source->mask, x, y, RADIUS, "OR", PSPHOT_MASK_MARKED); 45 // XXX EAM : add in source flux46 45 status = pmSourcePhotometry (&fitMag, &obsMag, model, source->pixels, source->mask); 47 46 psImageKeepCircle (source->mask, x, y, RADIUS, "AND", ~PSPHOT_MASK_MARKED); 47 48 pmSourceSubModel (source->pixels, source->mask, model, false, false); 48 49 if (!status) continue; 49 50 … … 55 56 56 57 psVectorExtend (mask, 100, 1); 58 psVectorExtend (xPos, 100, 1); 59 psVectorExtend (yPos, 100, 1); 57 60 psVectorExtend (rflux, 100, 1); 58 61 psVectorExtend (apResid, 100, 1); 59 62 Npsf ++; 60 61 pmSourceSubModel (source->pixels, source->mask, model, false, false);62 psMemCheckCorruption (true);63 63 } 64 psLogMsg ("psphot.apresid", 4, "measure aperture residuals : %f sec\n", psTimerMark ("psphot")); 64 65 65 66 // 3hi/1lo sigma clipping on the rflux vs metric fit … … 70 71 71 72 // linear clipped fit of apResid to rflux, xPos, yPos 72 psf->ApTrend = psVectorClipFitPolynomial3D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, NULL, rflux, xPos, yPos);73 psf->ApTrend = psVectorClipFitPolynomial3D (psf->ApTrend, stats, mask, PSFTRY_MASK_ALL, apResid, NULL, xPos, yPos, rflux); 73 74 psf->skyBias = psf->ApTrend->coeff[0][0][1] / (M_PI * PS_SQR(RADIUS)); 74 75 psf->ApResid = psf->ApTrend->coeff[0][0][0]; 75 76 psf->dApResid = stats->sampleStdev; 77 psf->ApTrend->coeff[0][0][1] = 0; 76 78 77 psLogMsg ("ApResid", 4, "aperture residual: %f +/- %f : %f bias\n", psf->ApResid, psf->dApResid, psf->skyBias); 79 /* 80 (aprMag' - fitMag) = rflux*skyBias + ApTrend(x,y) 81 (aprMag - rflux*skyBias) - fitMag = ApTrend(x,y) 82 (aprMag - rflux*skyBias) = fitMag + ApTrend(x,y) 83 */ 84 85 # if (0) 86 psPolynomial3D *poly = psf->ApTrend; 87 for (int nz = 0; nz <= poly->nZ; nz++) { 88 for (int ny = 0; ny <= poly->nY; ny++) { 89 for (int nx = 0; nx <= poly->nX; nx++) { 90 fprintf (stderr, "%d %d %d : %22.15g\n", nx, ny, nz, poly->coeff[nx][ny][nz]); 91 } 92 } 93 } 94 # endif 95 96 psLogMsg ("psphot.apresid", 3, "measure full-frame aperture residual: %f sec\n", psTimerMark ("psphot")); 97 psLogMsg ("psphot.apresid", 4, "aperture residual: %f +/- %f : %f bias\n", psf->ApResid, psf->dApResid, psf->skyBias); 78 98 79 99 psFree (stats);
Note:
See TracChangeset
for help on using the changeset viewer.
