Changeset 20339
- Timestamp:
- Oct 22, 2008, 5:52:22 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotMergeSources.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotMergeSources.c
r20329 r20339 71 71 detections->peaks = psArrayAllocEmpty(100); 72 72 73 psMetadata *recipe = psMetadataLookupPtr (NULL, config->recipes, PSPHOT_RECIPE); 74 if (!recipe) { 75 psError(PSPHOT_ERR_CONFIG, false, "missing recipe %s", PSPHOT_RECIPE); 76 return false; 77 } 78 float snMin = psMetadataLookupF32(NULL, recipe, "MOMENTS_SN_MIN"); 79 if (!isfinite(snMin)) { 80 return NULL; 81 } 82 73 83 for (int i = 0; i < sources->n; i++) { 74 84 pmSource *source = sources->data[i]; 75 85 pmModel *model = source->modelPSF; 76 86 87 if (!isfinite(source->psfMag)) { 88 continue; 89 } 90 91 float flux = powf(10.0, -0.4 * source->psfMag); 77 92 float xpos = model->params->data.F32[PM_PAR_XPOS]; 78 93 float ypos = model->params->data.F32[PM_PAR_YPOS]; … … 81 96 peak->xf = xpos; 82 97 peak->yf = ypos; 83 peak->flux = 1.0;84 peak->SN = INFINITY;98 peak->flux = flux; 99 peak->SN = snMin + flux; 85 100 86 101 psArrayAdd (detections->peaks, 100, peak);
Note:
See TracChangeset
for help on using the changeset viewer.
