- Timestamp:
- Apr 19, 2013, 4:45:57 PM (13 years ago)
- Location:
- branches/eam_branches/ipp-20130419
- Files:
-
- 4 edited
-
. (modified) (1 prop)
-
psphot (modified) (1 prop)
-
psphot/src (modified) (1 prop)
-
psphot/src/psphotExtendedSourceFits.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130419
-
branches/eam_branches/ipp-20130419/psphot
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20130307/psphot (added) merged: 35322,35350,35377,35413
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20130419/psphot/src
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20130307/psphot/src (added) merged: 35322,35350,35377,35413
- Property svn:mergeinfo changed
-
branches/eam_branches/ipp-20130419/psphot/src/psphotExtendedSourceFits.c
r34404 r35421 90 90 assert (markVal); 91 91 92 // source fitting parameters for extended source fits 93 int fitIter = psMetadataLookupS32(&status, recipe, "EXT_FIT_ITER"); // Max number of fit iterations 94 assert (status && fitIter > 0); 95 96 float fitMinTol = psMetadataLookupF32 (&status, recipe, "EXT_FIT_MIN_TOL"); // Fit tolerance 97 if (!status || !isfinite(fitMinTol) || fitMinTol <= 0) { 98 fitMinTol = psMetadataLookupF32 (&status, recipe, "PSF_FIT_TOL"); // Fit tolerance 99 if (!status || !isfinite(fitMinTol) || fitMinTol <= 0) { 100 psAbort("PSF_FIT_MIN_TOL (and PSF_FIT_TOL) not defined or positive"); 101 } 102 } 103 104 float fitMaxTol = psMetadataLookupF32 (&status, recipe, "EXT_FIT_MAX_TOL"); // Fit tolerance 105 if (!status || !isfinite(fitMaxTol) || fitMaxTol <= 0) { 106 fitMaxTol = 1.0; 107 } 108 92 109 // maskVal is used to test for rejected pixels, and must include markVal 93 110 maskVal |= markVal; … … 181 198 182 199 PS_ARRAY_ADD_SCALAR(job->args, psfSize, PS_TYPE_S32); 200 PS_ARRAY_ADD_SCALAR(job->args, fitIter, PS_TYPE_S32); 201 PS_ARRAY_ADD_SCALAR(job->args, fitMinTol, PS_TYPE_F32); 202 PS_ARRAY_ADD_SCALAR(job->args, fitMaxTol, PS_TYPE_F32); 203 183 204 PS_ARRAY_ADD_SCALAR(job->args, maskVal, PS_TYPE_IMAGE_MASK); 184 205 PS_ARRAY_ADD_SCALAR(job->args, markVal, PS_TYPE_IMAGE_MASK); … … 293 314 psRegion *region = job->args->data[4]; 294 315 int psfSize = PS_SCALAR_VALUE(job->args->data[5],S32); 295 psImageMaskType maskVal = PS_SCALAR_VALUE(job->args->data[6],PS_TYPE_IMAGE_MASK_DATA); 296 psImageMaskType markVal = PS_SCALAR_VALUE(job->args->data[7],PS_TYPE_IMAGE_MASK_DATA); 316 int fitIter = PS_SCALAR_VALUE(job->args->data[6],S32); 317 float fitMinTol = PS_SCALAR_VALUE(job->args->data[7],F32); 318 float fitMaxTol = PS_SCALAR_VALUE(job->args->data[8],F32); 319 psImageMaskType maskVal = PS_SCALAR_VALUE(job->args->data[9],PS_TYPE_IMAGE_MASK_DATA); 320 psImageMaskType markVal = PS_SCALAR_VALUE(job->args->data[10],PS_TYPE_IMAGE_MASK_DATA); 297 321 298 322 // Define source fitting parameters for extended source fits … … 301 325 fitOptions->saveCovariance = true; // XXX make this a user option? 302 326 fitOptions->covarFactor = psImageCovarianceFactorForAperture(readout->covariance, 10.0); // Covariance matrix 303 304 // XXX for now, use the defaults for the rest: 305 // fitOptions->nIter = fitIter; 306 // fitOptions->tol = fitTol; 307 // fitOptions->poissonErrors = poisson; 308 // fitOptions->weight = PS_SQR(skySig); 327 fitOptions->nIter = fitIter; 328 fitOptions->minTol = fitMinTol; 329 fitOptions->maxTol = fitMaxTol; 309 330 310 331 // choose the sources of interest … … 335 356 // set the fit radius based on the first radial moment (also sets the mask pixels) 336 357 psphotSetRadiusMomentsExact(&fitRadius, &windowRadius, readout, source, markVal); // NOTE : 6 allocs 358 359 // XXX WATCH OUT HERE!! 360 // fitRadius = 30; 337 361 338 362 // UPDATE : we have changed the moments calculation. There is now an iteration within … … 498 522 499 523 // change the value of a scalar on the array (wrap this and put it in psArray.h) 500 scalar = job->args->data[ 8];524 scalar = job->args->data[11]; 501 525 scalar->data.S32 = Next; 502 526 503 scalar = job->args->data[ 9];527 scalar = job->args->data[12]; 504 528 scalar->data.S32 = Nconvolve; 505 529 506 scalar = job->args->data[1 0];530 scalar = job->args->data[13]; 507 531 scalar->data.S32 = NconvolvePass; 508 532 509 scalar = job->args->data[1 1];533 scalar = job->args->data[14]; 510 534 scalar->data.S32 = Nplain; 511 535 512 scalar = job->args->data[1 2];536 scalar = job->args->data[15]; 513 537 scalar->data.S32 = NplainPass; 514 538 515 scalar = job->args->data[1 3];539 scalar = job->args->data[16]; 516 540 scalar->data.S32 = Nfaint; 517 541 518 scalar = job->args->data[1 4];542 scalar = job->args->data[17]; 519 543 scalar->data.S32 = Nfail; 520 544
Note:
See TracChangeset
for help on using the changeset viewer.
