Changeset 4949 for trunk/psphot/src/pspsf.c
- Timestamp:
- Sep 5, 2005, 8:44:00 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/psphot/src/pspsf.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/pspsf.c
r4901 r4949 10 10 11 11 // a PSF always has 4 parameters fewer than the equivalent model 12 pmPSF *pmPSFAlloc (p sModelType type) {12 pmPSF *pmPSFAlloc (pmModelType type) { 13 13 14 14 int Nparams; … … 19 19 psf->chisq = 0.0; 20 20 21 Nparams = p sModelParameterCount (type);21 Nparams = pmModelParameterCount (type); 22 22 if (!Nparams) { 23 psError(PS_ERR_UNKNOWN, true, "Undefined p sModelType");23 psError(PS_ERR_UNKNOWN, true, "Undefined pmModelType"); 24 24 return(NULL); 25 25 } … … 54 54 55 55 // XXX probably need to increment ref counter 56 test->modelType = p sModelSetType (modelName);56 test->modelType = pmModelSetType (modelName); 57 57 test->psf = pmPSFAlloc (test->modelType); 58 58 test->sources = psMemCopy(sources); … … 99 99 for (int i = 0; i < test->sources->n; i++) { 100 100 101 p sSource *source = test->sources->data[i];102 p sModel *model = pmSourceModelGuess (source, test->modelType);101 pmSource *source = test->sources->data[i]; 102 pmModel *model = pmSourceModelGuess (source, test->modelType); 103 103 x = source->peak->x; 104 104 y = source->peak->y; … … 134 134 if (test->mask->data.U8[i]) continue; 135 135 136 p sSource *source = test->sources->data[i];137 p sModel *modelFLT = test->modelFLT->data[i];136 pmSource *source = test->sources->data[i]; 137 pmModel *modelFLT = test->modelFLT->data[i]; 138 138 139 139 // set shape for this model based on PSF 140 p sModel *modelPSF = psModelFromPSF (modelFLT, test->psf);140 pmModel *modelPSF = pmModelFromPSF (modelFLT, test->psf); 141 141 x = source->peak->x; 142 142 y = source->peak->y; … … 185 185 } 186 186 187 // input: an array of p sModels, pre-allocated psf187 // input: an array of pmModels, pre-allocated psf 188 188 // some of the array entries may be NULL, ignore them 189 189 bool pmPSFFromModels (pmPSF *psf, psArray *models, psVector *mask) { … … 197 197 198 198 for (int i = 0; i < models->n; i++) { 199 p sModel *model = models->data[i];199 pmModel *model = models->data[i]; 200 200 if (model == NULL) continue; 201 201 … … 211 211 for (int i = 0; i < psf->params->n; i++) { 212 212 for (int j = 0; j < models->n; j++) { 213 p sModel *model = models->data[j];213 pmModel *model = models->data[j]; 214 214 if (model == NULL) continue; 215 215 z->data.F64[j] = model->params->data.F32[i + 4]; … … 231 231 } 232 232 233 p sModel *psModelFromPSF (psModel *modelFLT, pmPSF *psf) {233 pmModel *pmModelFromPSF (pmModel *modelFLT, pmPSF *psf) { 234 234 235 235 // need to define the relationship between the modelFLT and modelPSF ? 236 236 237 237 // find function used to set the model parameters 238 p sModelFromPSFFunc modelFromPSFFunc = psModelFromPSFFunc_GetFunction (psf->type);238 pmModelFromPSFFunc modelFromPSFFunc = pmModelFromPSFFunc_GetFunction (psf->type); 239 239 240 240 // do we need a different model for the PSF vs FLT version? 241 p sModel *modelPSF = psModelAlloc (psf->type);241 pmModel *modelPSF = pmModelAlloc (psf->type); 242 242 243 243 // set model parameters for this source based on PSF information
Note:
See TracChangeset
for help on using the changeset viewer.
