Changeset 6427 for trunk/psphot/src/psphotEnsemblePSF.c
- Timestamp:
- Feb 14, 2006, 6:33:17 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/psphotEnsemblePSF.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotEnsemblePSF.c
r6379 r6427 3 3 // 2006.02.07 : no leaks! 4 4 // fit all reasonable sources with the linear PSF model 5 bool psphotEnsemblePSF (pmReadout *readout, psMetadata *config, psArray *sources, pmPSF *psf , psStats *sky) {5 bool psphotEnsemblePSF (pmReadout *readout, psMetadata *config, psArray *sources, pmPSF *psf) { 6 6 7 7 bool status; … … 15 15 sources = psArraySort (sources, psphotSortByY); 16 16 17 // radius for source moments if star is saturated 18 // XXX we already do this in psphotSourceStats, is it still needed? 17 19 float INNER_RADIUS = psMetadataLookupF32 (&status, config, "SKY_INNER_RADIUS"); 18 float PSF_FIT_NSIGMA = psMetadataLookupF32 (&status, config, "PSF_FIT_NSIGMA");19 float PSF_FIT_PADDING = psMetadataLookupF32 (&status, config, "PSF_FIT_PADDING");20 20 21 // set the object surface-brightness limit for fitted pixels 22 float FLUX_LIMIT = PSF_FIT_NSIGMA * sky->sampleStdev; 23 psLogMsg ("psphot.ensemble", 4, "fitting pixels with at least %f object counts\n", FLUX_LIMIT); 21 // setup the PSF fit details 22 psphotInitRadiusPSF (config, psf->type); 24 23 25 24 // pre-calculate all model pixels … … 29 28 index->n = 0; 30 29 30 // option to limit analysis to a specific region 31 31 bool UseAnalysisRegion = false; 32 32 psRegion AnalysisRegion = {0, 0, 0, 0}; … … 98 98 y = model->params->data.F32[3]; 99 99 100 // get function which specifies the radius at which the model hits the given flux101 pmModelRadius modelRadius = pmModelRadius_GetFunction (psf->type);102 103 100 // set the fit radius based on the object flux limit and the model 104 model->radius = modelRadius (model->params, FLUX_LIMIT) + PSF_FIT_PADDING; 105 if (isnan(model->radius)) psAbort ("psphotEnsemblePSF", "error in radius"); 106 107 // if needed, ask for more object pixels 108 psphotRedefinePixels (inSource, readout, x, y, model->radius); 101 psphotCheckRadiusPSF (readout, inSource, model); 109 102 110 103 // make temporary copies of the image pixels and mask … … 116 109 psImage *mask = otSource->mask; 117 110 118 // set model to unit peak, zero sky (we assume sky is constant)111 // set model to unit peak, zero sky (we assume sky is subtracted) 119 112 model->params->data.F32[0] = 0.0; 120 113 model->params->data.F32[1] = 1.0; … … 165 158 psLogMsg ("psphot.emsemble", 4, "built matrix: %f (%d elements)\n", psTimerMark ("psphot"), sparse->Nelem); 166 159 167 // solve for normalization terms (need include local sky )160 // solve for normalization terms (need include local sky?) 168 161 psSparseResort (sparse); 169 162 psVector *norm = psSparseSolve (NULL, sparse, 3);
Note:
See TracChangeset
for help on using the changeset viewer.
