Changeset 8137
- Timestamp:
- Aug 4, 2006, 2:37:17 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotApResid.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotApResid.c
r7342 r8137 5 5 bool psphotApResid (pmReadout *readout, psArray *sources, psMetadata *recipe, pmPSF *psf) { 6 6 7 int Nfail = 0; 8 int Nskip = 0; 7 9 int Npsf; 8 10 bool status; … … 13 15 14 16 // S/N limit to perform full non-linear fits 15 float FIT_SN_LIM = psMetadataLookupF32 (&status, recipe, "FULL_FIT_SN_LIM");17 float MAX_AP_OFFSET = psMetadataLookupF32 (&status, recipe, "MAX_AP_OFFSET"); 16 18 17 19 // set limits on the aperture magnitudes … … 36 38 for (int i = 0; i < sources->n; i++) { 37 39 source = sources->data[i]; 40 model = source->modelPSF; 38 41 39 42 if (source->type != PM_SOURCE_TYPE_STAR) continue; … … 43 46 if (source->mode & PM_SOURCE_MODE_POOR) continue; 44 47 45 model = source->modelPSF;46 if (model == NULL) continue;47 48 // XXX tune independently?49 if (source->moments->SN < 2*FIT_SN_LIM) continue;50 51 48 // get growth-corrected, apTrend-uncorrected magnitudes in scaled apertures 52 if (!pmSourceMagnitudes (source, psf, PM_SOURCE_PHOT_GROWTH)) continue; 49 // will fail if below S/N threshold or model is missing 50 if (!pmSourceMagnitudes (source, psf, PM_SOURCE_PHOT_GROWTH)) { 51 Nskip ++; 52 continue; 53 } 53 54 54 55 apResid->data.F64[Npsf] = source->apMag - source->psfMag; … … 65 66 // XXX need to see if all data were tossed? 66 67 // XXX need to subtract median? 67 if (fabs(apResid->data.F64[Npsf]) > 0.2) continue; 68 // XXX need to put this in the config data... 69 // if (fabs(apResid->data.F64[Npsf]) > 0.2) continue; 70 if (fabs(apResid->data.F64[Npsf]) > MAX_AP_OFFSET) { 71 Nfail ++; 72 continue; 73 } 68 74 69 75 dMag->data.F64[Npsf] = model->dparams->data.F32[1] / model->params->data.F32[1]; … … 78 84 Npsf ++; 79 85 } 80 psLogMsg ("psphot.apresid", 4, "measure aperture residuals : %f sec for %d objects\n", psTimerMark ("psphot"), Npsf); 86 psLogMsg ("psphot.apresid", 4, "measure aperture residuals : %f sec for %d objects (%d skipped, %d failed, %d invalid)\n", 87 psTimerMark ("psphot"), Npsf, Nskip, Nfail, sources->n - Npsf - Nskip - Nfail); 81 88 82 89 // APTREND options : NONE SKYBIAS XY_LIN XY_QUAD SKY_XY_LIN FULL
Note:
See TracChangeset
for help on using the changeset viewer.
