Changeset 5993 for trunk/psphot/src/psphotFitGalaxies.c
- Timestamp:
- Jan 15, 2006, 8:30:16 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotFitGalaxies.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotFitGalaxies.c
r5828 r5993 1 1 # include "psphot.h" 2 2 3 bool psphotFit Galaxies (eamReadout *imdata, psMetadata *config, psArray *sources, psStats *skyStats)3 bool psphotFitExtended (eamReadout *imdata, psMetadata *config, psArray *sources, psStats *skyStats) 4 4 { 5 5 bool status; … … 12 12 psTimerStart ("psphot"); 13 13 14 float GAL_MIN_SN = psMetadataLookupF32 (&status, config, "GAL_MIN_SN");15 float GAL_MOMENTS_RAD = psMetadataLookupF32 (&status, config, "GAL_MOMENTS_RADIUS");16 char *modelName = psMetadataLookupPtr (&status, config, " GAL_MODEL");14 float EXT_MIN_SN = psMetadataLookupF32 (&status, config, "EXT_MIN_SN"); 15 float EXT_MOMENTS_RAD = psMetadataLookupF32 (&status, config, "EXT_MOMENTS_RADIUS"); 16 char *modelName = psMetadataLookupPtr (&status, config, "EXT_MODEL"); 17 17 pmModelType modelType = pmModelSetType (modelName); 18 18 19 psphotInitRadius FLT (config, skyStats, modelType);19 psphotInitRadiusEXT (config, skyStats, modelType); 20 20 21 21 for (int i = 0; i < sources->n; i++) { … … 23 23 24 24 // only fit suspected extended sources 25 if (source->type != PM_SOURCE_ GALAXY) continue;25 if (source->type != PM_SOURCE_EXTENDED) continue; 26 26 if (source->mode & PM_SOURCE_BLEND) continue; 27 27 28 28 // skip possible extended sources below fit threshold 29 if (source->moments->SN < GAL_MIN_SN) continue;29 if (source->moments->SN < EXT_MIN_SN) continue; 30 30 31 // recalculate the source moments using the larger galaxymoments radius32 status = pmSourceMoments (source, GAL_MOMENTS_RAD);31 // recalculate the source moments using the larger extended-source moments radius 32 status = pmSourceMoments (source, EXT_MOMENTS_RAD); 33 33 if (!status) { 34 34 source->mode |= PM_SOURCE_FAIL; // better choice? … … 38 38 // use the source moments, etc to guess basic model parameters 39 39 pmModel *model = pmSourceModelGuess (source, modelType); 40 source->model FLT = model;40 source->modelEXT = model; 41 41 x = model->params->data.F32[2]; 42 42 y = model->params->data.F32[3]; 43 43 44 44 // sets the model radius (via source->model) and adjusts pixels as needed 45 psphotCheckRadius FLT (imdata, source, model);45 psphotCheckRadiusEXT (imdata, source, model); 46 46 47 // fit FLT (not PSF) model (set/unset the pixel mask)47 // fit EXT (not PSF) model (set/unset the pixel mask) 48 48 psImageKeepCircle (source->mask, x, y, model->radius, "OR", PSPHOT_MASK_MARKED); 49 49 pmSourceFitModel (source, model, false); … … 61 61 } 62 62 } 63 psLogMsg ("psphot", 3, "fit GAL models: %f sec for %d galaxies (%d total iterations)\n", psTimerMark ("psphot"), Nfit, Niter);64 psLogMsg ("psphot", 4, "subtracted %d GAL models\n", Nsub);63 psLogMsg ("psphot", 3, "fit EXT models: %f sec for %d objects (%d total iterations)\n", psTimerMark ("psphot"), Nfit, Niter); 64 psLogMsg ("psphot", 4, "subtracted %d EXT objects\n", Nsub); 65 65 return (true); 66 66 }
Note:
See TracChangeset
for help on using the changeset viewer.
