Changeset 36311
- Timestamp:
- Nov 25, 2013, 11:51:42 AM (13 years ago)
- Location:
- branches/eam_branches/ipp-20130904
- Files:
-
- 4 edited
-
psModules/src/objects/pmPCM_MinimizeChisq.c (modified) (1 diff)
-
psphot/src/psphotExtendedSourceFits.c (modified) (1 diff)
-
psphot/src/psphotSourceFits.c (modified) (4 diffs)
-
psphot/test/tap_psphot_galaxygrid.pro (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130904/psModules/src/objects/pmPCM_MinimizeChisq.c
r36309 r36311 135 135 } 136 136 137 if ( 0) {138 fprintf (stderr, "%d : \n", min->iter);137 if (1) { 138 fprintf (stderr, "%d : ", min->iter); 139 139 for (int ti = 0; ti < params->n; ti++) { 140 140 fprintf (stderr, "%f ", params->data.F32[ti]); 141 141 } 142 fprintf (stderr, " \n");142 fprintf (stderr, " : %f\n", min->value); 143 143 } 144 144 -
branches/eam_branches/ipp-20130904/psphot/src/psphotExtendedSourceFits.c
r36310 r36311 315 315 316 316 // XXX TEST 317 if ( !isInteractive) {317 if (false && !isInteractive) { 318 318 if (!psThreadJobAddPending(job)) { 319 319 psError(PS_ERR_UNKNOWN, false, "Unable to guess model."); -
branches/eam_branches/ipp-20130904/psphot/src/psphotSourceFits.c
r36310 r36311 21 21 22 22 bool psphotPCMfitCheckSize (pmPCMdata *pcm, pmSource *source, psImageMaskType maskVal, float psfSize); 23 bool psphotPCMfitRetry (pmPCMdata *pcm, pmSource *source, pmSourceFitOptions *fitOptions, psImageMaskType maskVal, psImageMaskType markVal, float psfSize); 23 24 24 25 bool psphotFitInit (int nThreads) { … … 652 653 if (TIMING) { t4 = psTimerMark ("psphotFitPCM"); } 653 654 654 psphotPCMfitCheckSize (pcm, source, maskVal, psfSize); 655 if (pcm->modelConv->nIter == fitOptions->nIter) { 656 psphotPCMfitRetry (pcm, source, &options, maskVal, markVal, psfSize); 657 } 658 // psphotPCMfitCheckSize (pcm, source, maskVal, psfSize); 655 659 if (TIMING) { t5 = psTimerMark ("psphotFitPCM"); } 656 660 … … 1325 1329 rMin = dref; 1326 1330 } 1327 //fprintf (stderr, "%d | %f %f %f | %f %f %f\n", j, dref, Io, Chisq, rMin, iMin, xMin);1331 fprintf (stderr, "%d | %f %f %f | %f %f %f\n", j, dref, Io, Chisq, rMin, iMin, xMin); 1328 1332 } 1329 1333 … … 1344 1348 } 1345 1349 1350 // we have an initial fit, check to see if the current size is besst 1351 bool psphotPCMfitRetry (pmPCMdata *pcm, pmSource *source, pmSourceFitOptions *fitOptions, psImageMaskType maskVal, psImageMaskType markVal, float psfSize) { 1352 1353 // PAR is already at my current best guess 1354 psF32 *PAR = pcm->modelConv->params->data.F32; 1355 1356 // store best guess as a shape 1357 psEllipseAxes centerAxes; 1358 pmModelParamsToAxes (¢erAxes, PAR[PM_PAR_SXX], PAR[PM_PAR_SXY], PAR[PM_PAR_SYY], true); 1359 1360 // retry with axes smaller by 1 pixel 1361 psEllipseAxes guessAxes; 1362 guessAxes.major = centerAxes.major - 0.08; 1363 guessAxes.minor = guessAxes.major * centerAxes.minor / centerAxes.major; 1364 guessAxes.theta = centerAxes.theta; 1365 1366 if (!isfinite(guessAxes.major)) return false; 1367 if (!isfinite(guessAxes.minor)) return false; 1368 if (!isfinite(guessAxes.theta)) return false; 1369 1370 // convert the major,minor,theta to shape parameters for an Reff-like model 1371 pmModelAxesToParams (&PAR[PM_PAR_SXX], &PAR[PM_PAR_SXY], &PAR[PM_PAR_SYY], guessAxes, true); 1372 1373 // generated the modelFlux 1374 pmPCMMakeModel (source, pcm->modelConv, maskVal, psfSize); 1375 1376 float YY = 0.0; 1377 float YM = 0.0; 1378 float MM = 0.0; 1379 bool usePoisson = false; 1380 1381 for (int iy = 0; iy < source->pixels->numRows; iy++) { 1382 for (int ix = 0; ix < source->pixels->numCols; ix++) { 1383 // skip masked points 1384 if (source->maskObj->data.PS_TYPE_IMAGE_MASK_DATA[iy][ix]) { 1385 continue; 1386 } 1387 // skip zero-variance points 1388 if (source->variance->data.F32[iy][ix] == 0) { 1389 continue; 1390 } 1391 // skip nan value points 1392 if (!isfinite(source->pixels->data.F32[iy][ix])) { 1393 continue; 1394 } 1395 1396 float fy = source->pixels->data.F32[iy][ix]; 1397 float fm = source->modelFlux->data.F32[iy][ix]; 1398 float wt = (usePoisson) ? 1.0 / source->variance->data.F32[iy][ix] : 1.0; 1399 1400 YY += PS_SQR(fy) * wt; 1401 YM += fm * fy * wt; 1402 MM += PS_SQR(fm) * wt; 1403 } 1404 } 1405 1406 float Io = YM / MM; 1407 PAR[PM_PAR_I0] = Io; 1408 1409 pmSourceFitPCM (pcm, source, fitOptions, maskVal, markVal, psfSize); // NOTE : 1687 allocs in here 1410 1411 return true; 1412 } 1413 1414 -
branches/eam_branches/ipp-20130904/psphot/test/tap_psphot_galaxygrid.pro
r36310 r36311 1278 1278 foreach radius 1.0 1.5 2.0 2.5 3.0 4.0 6.0 8.0 1279 1279 # mkexp.devexp.single tests.20131120/testrad.ps1v1.exp.$Nrun EXP $radius 1.0 1280 fitexp tests.20131120/testrad.ps1v1.exp.$Nrun tests.20131120/testrad.ps1v1.exp.$Nrun.t4 sEXP_CONV1280 fitexp tests.20131120/testrad.ps1v1.exp.$Nrun tests.20131120/testrad.ps1v1.exp.$Nrun.t4p EXP_CONV 1281 1281 $Nrun ++ 1282 1282 end … … 1285 1285 $Nrun = 0 1286 1286 foreach radius 1.0 1.5 2.0 2.5 3.0 4.0 6.0 8.0 1287 cmf.load.concat tests.20131120/testrad.ps1v1.exp.$Nrun.dat tests.20131120/testrad.ps1v1.exp.$Nrun.t4 s.cmf EXP1287 cmf.load.concat tests.20131120/testrad.ps1v1.exp.$Nrun.dat tests.20131120/testrad.ps1v1.exp.$Nrun.t4p.cmf EXP 1288 1288 set dM_m = Mot_m - Min_m 1289 1289 vstat -q dM_m
Note:
See TracChangeset
for help on using the changeset viewer.
