Changeset 4216 for trunk/psphot/src/pspsf.c
- Timestamp:
- Jun 12, 2005, 3:49:21 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/pspsf.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/pspsf.c
r4129 r4216 46 46 } 47 47 48 pmPSF_Test *pmPSF_TestModel (psArray *sources, char *modelName ) {48 pmPSF_Test *pmPSF_TestModel (psArray *sources, char *modelName, float RADIUS) { 49 49 50 50 int Nflt = 0; … … 58 58 psSource *source = test->sources->data[i]; 59 59 psModel *model = pmSourceModelGuess (source, test->modelType); 60 60 x = source->peak->x; 61 y = source->peak->y; 62 63 // set temporary object mask and fit object 61 64 // fit model as FLT, not PSF (mask & skip poor fits) 62 if (!pmSourceFitModel (source, model, false)) { 65 psImageKeepCircle (source->mask, x, y, RADIUS, OR, 0x80); 66 status = pmSourceFitModel (source, model, false); 67 psImageKeepCircle (source->mask, x, y, RADIUS, AND, 0x7f); 68 69 if (!status) { 63 70 test->mask->data.U8[i] = 1; 64 71 continue; … … 96 103 psModel *modelPSF = psModelFromPSF (modelFLT, test->psf); // set shape for this model 97 104 98 // fit model as PSF, not FLT (skip poor fits) 99 if (!pmSourceFitModel (source, modelPSF, true)) { 105 psImageKeepCircle (source->mask, RADIUS, OR, 0x80); 106 status = pmSourceFitModel (source, modelPSF, true); 107 psImageKeepCircle (source->mask, RADIUS, AND, 0x7f); 108 109 // skip poor fits 110 if (!status) { 100 111 test->mask->data.U8[i] = 1; 101 112 continue; … … 224 235 } 225 236 226 // this was an attempt to measure ap-fit using image stats. it was giving227 // strangely wrong answers.228 # if (0)229 psImage *pixels = psImageCopy (NULL, source->pixels, source->pixels->type.type);230 pixels->col0 = source->pixels->col0;231 pixels->row0 = source->pixels->row0;232 // psImageCopy does not retain the parent offset233 // this copy is relative to the parent array.234 235 pmSourceSubModel (pixels, source->mask, model, false);236 237 // use a robust statistic or not?238 psStats *stats = psStatsAlloc (PS_STAT_SAMPLE_MEAN);239 psImageStats (stats, pixels, NULL, 0);240 // psImageStats (stats, pixels, source->mask, 0);241 // XXX this should be the SUM, but we don't have such a statistic242 // XXX given the mask, we need stat functions to return Npixels used243 # endif
Note:
See TracChangeset
for help on using the changeset viewer.
