Changeset 5993 for trunk/psphot/src/psphotFullFit.c
- Timestamp:
- Jan 15, 2006, 8:30:16 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotFullFit.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotFullFit.c
r5828 r5993 14 14 sources = psArraySort (sources, psphotSortBySN); 15 15 16 // galaxymodel parameters17 float GAL_MIN_SN = psMetadataLookupF32 (&status, config, "GAL_MIN_SN");18 float GAL_MOMENTS_RAD = psMetadataLookupF32 (&status, config, "GAL_MOMENTS_RADIUS");16 // extended source model parameters 17 float EXT_MIN_SN = psMetadataLookupF32 (&status, config, "EXT_MIN_SN"); 18 float EXT_MOMENTS_RAD = psMetadataLookupF32 (&status, config, "EXT_MOMENTS_RADIUS"); 19 19 20 // 'galaxy'model descriptions21 char *modelName FLT = psMetadataLookupPtr (&status, config, "GAL_MODEL");22 pmModelType modelType FLT = pmModelSetType (modelNameFLT);20 // extended source model descriptions 21 char *modelNameEXT = psMetadataLookupPtr (&status, config, "EXT_MODEL"); 22 pmModelType modelTypeEXT = pmModelSetType (modelNameEXT); 23 23 24 24 psphotInitLimitsPSF (config); 25 25 psphotInitRadiusPSF (config, sky, psf->type); 26 psphotInitRadius FLT (config, sky, modelTypeFLT);26 psphotInitRadiusEXT (config, sky, modelTypeEXT); 27 27 28 28 for (int i = 0; i < sources->n; i++) { … … 82 82 83 83 // skip the source if we don't think it is extended 84 if (source->type != PM_SOURCE_ GALAXY) goto subLINEAR;85 if (source->moments->SN < GAL_MIN_SN) goto subLINEAR;84 if (source->type != PM_SOURCE_EXTENDED) goto subLINEAR; 85 if (source->moments->SN < EXT_MIN_SN) goto subLINEAR; 86 86 87 87 // add the double-PSF fit mode 88 88 // how do we compare the results? chisq? 89 89 90 // recalculate the source moments using the larger galaxymoments radius91 if (!pmSourceMoments (source, GAL_MOMENTS_RAD)) goto subLINEAR;90 // recalculate the source moments using the larger extended-source moments radius 91 if (!pmSourceMoments (source, EXT_MOMENTS_RAD)) goto subLINEAR; 92 92 93 93 // use the source moments, etc to guess basic model parameters 94 source->model FLT = pmSourceModelGuess (source, modelTypeFLT);95 pmModel *model FLT = source->modelFLT;94 source->modelEXT = pmSourceModelGuess (source, modelTypeEXT); 95 pmModel *modelEXT = source->modelEXT; 96 96 97 psphotCheckRadius FLT (imdata, source, modelFLT);97 psphotCheckRadiusEXT (imdata, source, modelEXT); 98 98 99 x = model FLT->params->data.F32[2];100 y = model FLT->params->data.F32[3];99 x = modelEXT->params->data.F32[2]; 100 y = modelEXT->params->data.F32[3]; 101 101 102 // fit FLT (not PSF) model (set/unset the pixel mask)103 psImageKeepCircle (source->mask, x, y, model FLT->radius, "OR", PSPHOT_MASK_MARKED);104 pmSourceFitModel (source, model FLT, false);105 psImageKeepCircle (source->mask, x, y, model FLT->radius, "AND", ~PSPHOT_MASK_MARKED);102 // fit EXT (not PSF) model (set/unset the pixel mask) 103 psImageKeepCircle (source->mask, x, y, modelEXT->radius, "OR", PSPHOT_MASK_MARKED); 104 pmSourceFitModel (source, modelEXT, false); 105 psImageKeepCircle (source->mask, x, y, modelEXT->radius, "AND", ~PSPHOT_MASK_MARKED); 106 106 107 107 // track model evaluations 108 Niter += model FLT[0].nIter;108 Niter += modelEXT[0].nIter; 109 109 Nfit++; 110 110 111 // does the FLT model succeed?112 if (psphotEval FLT (source, source->modelFLT)) {113 pmSourceSubModel (source->pixels, source->mask, source->model FLT, false, false);111 // does the EXT model succeed? 112 if (psphotEvalEXT (source, source->modelEXT)) { 113 pmSourceSubModel (source->pixels, source->mask, source->modelEXT, false, false); 114 114 source->mode |= PM_SOURCE_SUBTRACTED; 115 115 source->mode &= ~PM_SOURCE_TEMPSUB;
Note:
See TracChangeset
for help on using the changeset viewer.
