Changeset 21519 for trunk/psphot/src/psphotFitSourcesLinear.c
- Timestamp:
- Feb 16, 2009, 12:34:24 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotFitSourcesLinear.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotFitSourcesLinear.c
r21366 r21519 63 63 pmSource *source = sources->data[i]; 64 64 65 // turn this bit off and turn it on again if we pass this test 66 source->mode &= ~PM_SOURCE_MODE_LINEAR_FIT; 67 65 68 // skip non-astronomical objects (very likely defects) 66 69 if (source->type == PM_SOURCE_TYPE_DEFECT) continue; 67 70 if (source->type == PM_SOURCE_TYPE_SATURATED) continue; 68 71 69 // if (source->type == PM_SOURCE_TYPE_STAR && 72 // do not include CRs in the full ensemble fit 70 73 if (source->mode & PM_SOURCE_MODE_CR_LIMIT) continue; 71 74 72 75 if (final) { 73 if (source-> mode & PM_SOURCE_MODE_SUBTRACTED) continue;76 if (source->tmpFlags & PM_SOURCE_TMPF_SUBTRACTED) continue; 74 77 } else { 75 if (source->mode & PM_SOURCE_MODE_BLEND) continue;78 if (source->mode & PM_SOURCE_MODE_BLEND) continue; 76 79 } 77 80 … … 91 94 if (y > AnalysisRegion.y1) continue; 92 95 96 source->mode |= PM_SOURCE_MODE_LINEAR_FIT; 93 97 psArrayAdd (fitSources, 100, source); 94 98 } … … 185 189 psLogMsg ("psphot.ensemble", PS_LOG_MINUTIA, "solve matrix: %f sec (%d elements)\n", psTimerMark ("psphot.linear"), sparse->Nelem); 186 190 191 // XXXX **** philosophical question: 192 // we measure bright objects in three passes: 1) linear fit; 2) non-linear fit; 3) linear fit: 193 // should retain the chisq and errors from the intermediate non-linear fit? 194 // the non-linear fit provides better values for the position errors, and for 195 // extended sources, the shape errors 196 187 197 // adjust I0 for fitSources and subtract 188 198 for (int i = 0; i < fitSources->n; i++) { … … 194 204 psAbort("linear fitted source is nan"); 195 205 } 206 196 207 model->params->data.F32[PM_PAR_I0] = norm->data.F32[i]; 197 208 model->dparams->data.F32[PM_PAR_I0] = errors->data.F32[i]; … … 200 211 // subtract object 201 212 pmSourceSub (source, PM_MODEL_OP_FULL, maskVal); 202 source-> mode |= PM_SOURCE_MODE_SUBTRACTED;213 source->tmpFlags |= PM_SOURCE_TMPF_SUBTRACTED; 203 214 } 204 215 psLogMsg ("psphot.ensemble", PS_LOG_MINUTIA, "sub models: %f sec (%d elements)\n", psTimerMark ("psphot.linear"), sparse->Nelem); … … 207 218 for (int i = 0; final && (i < fitSources->n); i++) { 208 219 pmSource *source = fitSources->data[i]; 220 if (source->mode & PM_SOURCE_MODE_NONLINEAR_FIT) continue; 209 221 pmModel *model = pmSourceGetModel (NULL, source); 210 222 pmSourceChisq (model, source->pixels, source->maskObj, source->variance, maskVal);
Note:
See TracChangeset
for help on using the changeset viewer.
