Changeset 6481 for trunk/psphot/src/psphotBlendFit.c
- Timestamp:
- Feb 23, 2006, 6:16:11 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotBlendFit.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotBlendFit.c
r6427 r6481 3 3 // XXX I don't like this name 4 4 bool psphotBlendFit (pmReadout *readout, psMetadata *config, psArray *sources, pmPSF *psf) { 5 6 bool status; 5 7 6 8 psTimerStart ("psphot"); … … 9 11 sources = psArraySort (sources, psphotSortBySN); 10 12 13 // S/N limit to perform full non-linear fits 14 float FIT_SN_LIM = psMetadataLookupF32 (&status, config, "FULL_FIT_SN_LIM"); 15 11 16 psphotInitLimitsPSF (config); 12 17 psphotInitLimitsEXT (config); 13 18 psphotInitRadiusPSF (config, psf->type); 14 19 20 // option to limit analysis to a specific region 21 char *region = psMetadataLookupStr (&status, config, "ANALYSIS_REGION"); 22 psRegion AnalysisRegion = psRegionForImage (readout->image, psRegionFromString (region)); 23 if (psRegionIsNaN (AnalysisRegion)) psAbort ("psphot", "analysis region mis-defined"); 24 15 25 for (int i = 0; i < sources->n; i++) { 16 17 26 pmSource *source = sources->data[i]; 18 27 … … 22 31 if (source->type == PM_SOURCE_SATURATED) continue; 23 32 33 // limit selection to some SN limit 34 if (source->moments == NULL) continue; 35 if (source->moments->SN < FIT_SN_LIM) continue; 36 24 37 // if model is NULL, we don't have a starting guess 25 38 if (source->modelPSF == NULL) continue; 39 40 if (source->moments->x < AnalysisRegion.x0) continue; 41 if (source->moments->y < AnalysisRegion.y0) continue; 42 if (source->moments->x > AnalysisRegion.x1) continue; 43 if (source->moments->y > AnalysisRegion.y1) continue; 26 44 27 45 // replace object in image … … 29 47 30 48 psTrace ("psphot.blend", 5, "trying source at %f, %f\n", source->moments->x, source->moments->y); 31 49 32 50 // try fitting PSFs, then try extended sources 33 51 if (psphotFitBlend (readout, source)) continue;
Note:
See TracChangeset
for help on using the changeset viewer.
