Changeset 32348 for trunk/psphot/src/psphotFitSourcesLinearStack.c
- Timestamp:
- Sep 6, 2011, 1:32:31 PM (15 years ago)
- Location:
- trunk/psphot
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot
-
trunk/psphot/src
- Property svn:ignore
-
old new 22 22 psphotMakePSF 23 23 psphotStack 24 psphotModelTest
-
- Property svn:ignore
-
trunk/psphot/src/psphotFitSourcesLinearStack.c
r31452 r32348 64 64 // turn this bit off and turn it on again if we keep this source 65 65 source->mode &= ~PM_SOURCE_MODE_LINEAR_FIT; 66 67 // skip non-astronomical objects (very likely defects) 68 if (source->type == PM_SOURCE_TYPE_DEFECT) continue; 69 if (source->type == PM_SOURCE_TYPE_SATURATED) continue; 70 71 // do not include CRs in the full ensemble fit 72 if (source->mode & PM_SOURCE_MODE_CR_LIMIT) continue; 73 74 // do not include MOMENTS_FAILURES in the fit 75 if (source->mode & PM_SOURCE_MODE_MOMENTS_FAILURE) continue; 76 77 if (final) { 78 if (source->tmpFlags & PM_SOURCE_TMPF_SUBTRACTED) continue; 79 } else { 80 // if (source->mode & PM_SOURCE_MODE_BLEND) continue; 81 } 66 82 67 83 // generate model for sources without, or skip if we can't … … 83 99 } 84 100 85 source->mode |= PM_SOURCE_MODE_LINEAR_FIT; 101 bool isPSF = false; 102 pmModel *model = pmSourceGetModel (&isPSF, source); 103 104 // clear the 'mark' pixels and remask on the fit aperture 105 psImageMaskPixels (source->maskObj, "AND", PS_NOT_IMAGE_MASK(markVal)); 106 psImageKeepCircle (source->maskObj, source->peak->x, source->peak->y, model->fitRadius, "OR", markVal); 107 108 // we call this function multiple times. for the first time, we have only PSF models for all objects 109 // the second time has extended sources. If we ever fit the PSF model, we should raise this bit 110 source->mode |= PM_SOURCE_MODE_LINEAR_FIT; 111 if (isPSF) { 112 source->mode |= PM_SOURCE_MODE_PSFMODEL; 113 } 86 114 psArrayAdd (fitSources, 100, source); 87 115 } … … 166 194 model->params->data.F32[PM_PAR_I0] = norm->data.F32[i]; 167 195 model->dparams->data.F32[PM_PAR_I0] = errors->data.F32[i]; 196 197 // clear the 'mark' pixels so the subtraction covers the full window 198 psImageMaskPixels (source->maskObj, "AND", PS_NOT_IMAGE_MASK(markVal)); 168 199 169 200 // subtract object … … 190 221 psFree (errors); 191 222 192 psLogMsg ("psphot.ensemble", PS_LOG_ INFO, "measure ensemble of PSFs: %f sec\n", psTimerMark ("psphot.linear"));223 psLogMsg ("psphot.ensemble", PS_LOG_WARN, "measure ensemble of PSFs: %f sec\n", psTimerMark ("psphot.linear")); 193 224 return true; 194 225 }
Note:
See TracChangeset
for help on using the changeset viewer.
