Changeset 14990
- Timestamp:
- Sep 23, 2007, 5:01:20 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20070921/psphot/src/psphotApResid.c
r14965 r14990 1 1 # include "psphotInternal.h" 2 2 3 # define SKIPSTAR(MSG) { psTrace ("psphot", 3, "invalid : %s", MSG); continue; } 3 4 // measure the aperture residual statistics and 2D variations 4 5 bool psphotApResid (pmReadout *readout, psArray *sources, psMetadata *recipe, pmPSF *psf, psMaskType maskVal, psMaskType mark) … … 63 64 model = source->modelPSF; 64 65 65 if (source->type != PM_SOURCE_TYPE_STAR) continue;66 if (source->mode & PM_SOURCE_MODE_SATSTAR) continue;67 if (source->mode & PM_SOURCE_MODE_BLEND) continue;68 if (source->mode & PM_SOURCE_MODE_FAIL) continue;69 if (source->mode & PM_SOURCE_MODE_POOR) continue;66 if (source->type != PM_SOURCE_TYPE_STAR) SKIPSTAR ("NOT STAR"); 67 if (source->mode & PM_SOURCE_MODE_SATSTAR) SKIPSTAR ("SATSTAR"); 68 if (source->mode & PM_SOURCE_MODE_BLEND) SKIPSTAR ("BLEND"); 69 if (source->mode & PM_SOURCE_MODE_FAIL) SKIPSTAR ("FAIL STAR"); 70 if (source->mode & PM_SOURCE_MODE_POOR) SKIPSTAR ("POOR STAR"); 70 71 71 72 // get growth-corrected, apTrend-uncorrected magnitudes in scaled apertures … … 73 74 if (!pmSourceMagnitudes (source, psf, photMode, maskVal, mark)) { 74 75 Nskip ++; 76 psTrace ("psphot", 3, "skip : bad source mag"); 75 77 continue; 76 78 } 77 79 78 if (!isfinite(source->apMag) || !isfinite(source-> apMag)) {80 if (!isfinite(source->apMag) || !isfinite(source->psfMag)) { 79 81 Nfail ++; 82 psTrace ("psphot", 3, "fail : nan mags : %f %f", source->apMag, source->psfMag); 80 83 continue; 81 84 } … … 87 90 if ((MAX_AP_OFFSET > 0) && (fabs(dap) > MAX_AP_OFFSET)) { 88 91 Nfail ++; 92 psTrace ("psphot", 3, "fail : bad dap %f %f", dap, MAX_AP_OFFSET); 89 93 continue; 90 94 } … … 146 150 } 147 151 152 // XXX catch error condition 148 153 psphotApResidTrend (readout, psf, Npsf, entryMin, &errorScale, &errorFloor, mask, xPos, yPos, apResid, dMag); 149 154 … … 170 175 float xc = 0.5*readout->image->numCols + readout->image->col0 + 0.5; 171 176 float yc = 0.5*readout->image->numRows + readout->image->row0 + 0.5; 177 172 178 psf->ApResid = pmTrend2DEval (psf->ApTrend, xc, yc); // ap-fit at chip center 173 179 psf->dApResid = errorFloor;
Note:
See TracChangeset
for help on using the changeset viewer.
