Changeset 6949
- Timestamp:
- Apr 21, 2006, 11:50:22 AM (20 years ago)
- Location:
- trunk/psphot/src
- Files:
-
- 2 edited
-
psphotEnsemblePSF.c (modified) (3 diffs)
-
psphotSourceFits.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psphot/src/psphotEnsemblePSF.c
r6900 r6949 29 29 psArray *models = psArrayAlloc (sources->n); 30 30 psVector *index = psVectorAlloc (sources->n, PS_TYPE_U32); 31 models->n = index->n = 0;31 // DROP models->n = index->n = 0; 32 32 33 33 // option to limit analysis to a specific region … … 170 170 171 171 psSparseConstraint constraint; 172 constraint.paramMin = 0 ;172 constraint.paramMin = 0.0; 173 173 constraint.paramMax = 1e8; 174 174 constraint.paramDelta = 1e8; … … 191 191 192 192 // assign linearly-fitted normalization 193 if (isnan(norm->data.F32[i])) { 194 psAbort ("psphot", "ensemble source is nan"); 195 } 193 196 Fi->modelPSF->params->data.F32[1] = norm->data.F32[i]; 194 197 Fi->modelPSF->dparams->data.F32[1] = sqrt(sqrt(2) * norm->data.F32[i] / (sparse->Bfj->data.F32[i] * weight->data.F32[i])); -
trunk/psphot/src/psphotSourceFits.c
r6900 r6949 10 10 // save the PSF model from the Ensemble fit 11 11 pmModel *PSF = pmModelCopy (source->modelPSF); 12 if (isnan(PSF->params->data.F32[1])) psAbort ("psphot", "nan in psf fit"); 12 13 13 14 // extend source radius as needed … … 191 192 PSF = source->modelPSF; 192 193 psphotCheckRadiusPSFBlend (readout, source, PSF, 8.0); 194 if (isnan(PSF->params->data.F32[1])) psAbort ("psphot", "nan in dbl fit"); 193 195 194 196 modelSet = psArrayAlloc (2); 195 modelSet->n = 0;197 // DROP modelSet->n = 0; 196 198 197 199 DBL = pmModelCopy (PSF); … … 224 226 // use the source moments, etc to guess basic model parameters 225 227 pmModel *EXT = pmSourceModelGuess (source, modelTypeEXT); 228 // if (isnan(EXT->params->data.F32[1])) psAbort ("psphot", "nan in ext fit"); 226 229 227 230 psphotCheckRadiusEXT (readout, source, EXT); … … 229 232 x = EXT->params->data.F32[2]; 230 233 y = EXT->params->data.F32[3]; 234 235 if ((source->moments->Sx < 1e-3) || (source->moments->Sx < 1e-3)) { 236 psTrace ("psphotSourceFits", 5, "problem source: moments: %f %f\n", source->moments->Sx, source->moments->Sy); 237 } 231 238 232 239 // fit EXT (not PSF) model (set/unset the pixel mask) … … 251 258 // save the PSF model from the Ensemble fit 252 259 pmModel *PSF = pmModelCopy (source->modelPSF); 260 if (isnan(PSF->params->data.F32[1])) psAbort ("psphot", "nan in blend fit primary"); 253 261 254 262 x = PSF->params->data.F32[2]; … … 256 264 257 265 psArray *modelSet = psArrayAlloc (source->blends->n + 1); 258 modelSet->n = 0;266 // DROP modelSet->n = 0; 259 267 psArrayAdd (modelSet, 16, PSF); 260 268 261 269 psArray *sourceSet = psArrayAlloc (source->blends->n + 1); 262 sourceSet->n = 0;270 // DROP sourceSet->n = 0; 263 271 psArrayAdd (sourceSet, 16, source); 264 272 … … 282 290 // XXX assume local sky is 0.0? 283 291 model->params->data.F32[1] = blend->moments->Peak - blend->moments->Sky; 292 if (isnan(model->params->data.F32[1])) psAbort ("psphot", "nan in blend fit"); 284 293 model->params->data.F32[2] = blend->peak->x; 285 294 model->params->data.F32[3] = blend->peak->y;
Note:
See TracChangeset
for help on using the changeset viewer.
