- Timestamp:
- Sep 22, 2007, 3:47:28 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branch_20070921/psModules/src/objects/pmPSFtry.c
r14980 r14986 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1.45.2. 2$ $Name: not supported by cvs2svn $8 * @date $Date: 2007-09-22 02:20:11$7 * @version $Revision: 1.45.2.3 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2007-09-22 13:47:28 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 139 139 140 140 // stage 2: construct a psf (pmPSF) from this collection of model fits 141 // XXX take 'applyWeights' from the psf options? 142 if (!pmPSFFromPSFtry (psfTry, options->applyWeights)) { 141 if (!pmPSFFromPSFtry (psfTry)) { 143 142 psError(PS_ERR_UNKNOWN, false, "failed to construct a psf model from collection of sources"); 144 143 psFree(psfTry); … … 339 338 /***************************************************************************** 340 339 pmPSFFromPSFtry (psfTry): build a PSF model from a collection of 341 source->modelEXT ent ires. The PSF ignores the first 4 (independent) model340 source->modelEXT entries. The PSF ignores the first 4 (independent) model 342 341 parameters and constructs a polynomial fit to the remaining as a function of 343 342 image coordinate. … … 345 344 Note: some of the array entries may be NULL (failed fits); ignore them. 346 345 *****************************************************************************/ 347 bool pmPSFFromPSFtry (pmPSFtry *psfTry , bool applyWeight)346 bool pmPSFFromPSFtry (pmPSFtry *psfTry) 348 347 { 349 348 pmPSF *psf = psfTry->psf; … … 355 354 356 355 psVector *dz = NULL; 357 if ( applyWeight) {356 if (psf->poissonErrorsParams) { 358 357 dz = psVectorAlloc (psfTry->sources->n, PS_TYPE_F32); 359 358 } … … 420 419 if (psTraceGetLevel("psModules.objects") >= 4) { 421 420 FILE *f = fopen ("pol.dat", "w"); 422 fprintf (f, " x y : e0obs e1obs e2obs : e0fit e1fit e2fit : mask\n",421 fprintf (f, "# x y : e0obs e1obs e2obs : e0fit e1fit e2fit : mask\n"); 423 422 for (int i = 0; i < e0->n; i++) { 424 423 fprintf (f, "%f %f : %f %f %f : %f %f %f : %d\n", … … 462 461 // fit the collection of measured parameters to the PSF 2D model 463 462 // the mask is carried from previous steps and updated with this operation 464 // the weight is either the flux error or NULL, depending on ' applyWeights'463 // the weight is either the flux error or NULL, depending on 'psf->poissonErrorParams' 465 464 if (!pmTrend2DFit (psf->params->data[i], psfTry->mask, 0xff, x, y, e0, NULL)) { 466 465 psError(PS_ERR_UNKNOWN, false, "failed to build psf model for parameter %d", i); 467 psFree(stats);468 466 psFree(x); 469 467 psFree(y); … … 502 500 } 503 501 504 psFree (stats);505 502 psFree (x); 506 503 psFree (y);
Note:
See TracChangeset
for help on using the changeset viewer.
