- Timestamp:
- Nov 28, 2013, 1:25:15 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20130904/psphot/src/psphotSourceFits.c
r36318 r36325 653 653 if (TIMING) { t4 = psTimerMark ("psphotFitPCM"); } 654 654 655 //psphotPCMfitCheckSize (pcm, source, maskVal, psfSize);655 if (options.isInteractive) psphotPCMfitCheckSize (pcm, source, maskVal, psfSize); 656 656 // if (pcm->modelConv->nIter == fitOptions->nIter) { 657 657 // psphotPCMfitRetry (pcm, source, &options, maskVal, markVal, psfSize); … … 791 791 792 792 // 0.5 / n for (0.5, 1.0, 1.5, 2.0, 3.0, 4.0, 5.0, 6.0) 793 float indexGuessInv[] = {1.00, 0.50, 0.333, 0.25, 1.666, 0.125, 0.10, 0.0833};793 float indexGuessInv[] = {1.00, 0.50, 0.333, 0.25, 0.166, 0.125, 0.10, 0.0833}; 794 794 float indexGuessR1q[] = {1.06, 1.19, 1.335, 1.48, 1.840, 2.290, 2.84, 3.5300}; 795 795 # define N_INDEX_GUESS_INV 8 … … 902 902 rMin = reffGuess[j] / indexGuessR1q[i]; 903 903 } 904 //fprintf (stderr, "%d | %f %f %f %f | %f %f %f %f", i, indexGuessInv[i], reffGuess[j], Io, Chisq, sMin, rMin, iMin, xMin);905 //fprintf (stderr, "\n");904 fprintf (stderr, "%d | %f %f %f %f | %f %f %f %f", i, indexGuessInv[i], reffGuess[j], Io, Chisq, sMin, rMin, iMin, xMin); 905 fprintf (stderr, "\n"); 906 906 } 907 907 } … … 1006 1006 psVector *Sidx = psVectorAllocEmpty (16, PS_TYPE_F32); 1007 1007 1008 PAR[PM_PAR_7] = indexGuessInv[nStart]; 1008 float Sm = NAN, Sp = NAN, So = NAN; 1009 if (nStart == 0) { 1010 Sm = indexGuessInv[nStart]; 1011 So = 0.5*(indexGuessInv[nStart + 1] + indexGuessInv[nStart]); 1012 Sp = indexGuessInv[nStart + 1]; 1013 } else if (nStart == N_INDEX_GUESS_INV - 1) { 1014 Sp = indexGuessInv[nStart]; 1015 So = 0.5*(indexGuessInv[nStart - 1] + indexGuessInv[nStart]); 1016 Sm = indexGuessInv[nStart - 1]; 1017 } else { 1018 Sm = 0.5*(indexGuessInv[nStart - 1] + indexGuessInv[nStart]); 1019 So = indexGuessInv[nStart]; 1020 Sp = 0.5*(indexGuessInv[nStart + 1] + indexGuessInv[nStart]); 1021 } 1022 1023 PAR[PM_PAR_7] = Sm; 1009 1024 pmSourceFitPCM (pcm, source, &options, maskVal, markVal, psfSize); 1010 1025 if (EXTRA_VERBOSE) fprintf (stderr, "%d >>> %d %f : %f - %f %f - %f %f %f - %f\n", source->id, model->nIter, model->chisqNorm, PAR[7], PAR[2], PAR[3], PAR[4], PAR[5], PAR[6], PAR[1]); … … 1012 1027 psVectorAppend (chi2, model->chisqNorm); 1013 1028 1014 PAR[PM_PAR_7] = (nStart < N_INDEX_GUESS_INV - 1) ? 0.5*(indexGuessInv[nStart + 1] + indexGuessInv[nStart]) : indexGuessInv[nStart - 1];1029 PAR[PM_PAR_7] = So; 1015 1030 pmSourceFitPCM (pcm, source, &options, maskVal, markVal, psfSize); 1016 1031 if (EXTRA_VERBOSE) fprintf (stderr, "%d >>> %d %f : %f - %f %f - %f %f %f - %f\n", source->id, model->nIter, model->chisqNorm, PAR[7], PAR[2], PAR[3], PAR[4], PAR[5], PAR[6], PAR[1]); … … 1018 1033 psVectorAppend (chi2, model->chisqNorm); 1019 1034 1020 PAR[PM_PAR_7] = (nStart > 0) ? 0.5*(indexGuessInv[nStart - 1] + indexGuessInv[nStart]) : indexGuessInv[nStart + 1];1035 PAR[PM_PAR_7] = Sp; 1021 1036 pmSourceFitPCM (pcm, source, &options, maskVal, markVal, psfSize); 1022 1037 if (EXTRA_VERBOSE) fprintf (stderr, "%d >>> %d %f : %f - %f %f - %f %f %f - %f\n", source->id, model->nIter, model->chisqNorm, PAR[7], PAR[2], PAR[3], PAR[4], PAR[5], PAR[6], PAR[1]); … … 1036 1051 float Smin = -0.5 * poly->coeff[1] / poly->coeff[2] / 100.0; 1037 1052 1038 // constrain Smin to be in a valid range (1.0 - 0.1, corresponding to 0.5 (Gauss) to 5.0 (slightly peakier than Dev) 1039 Smin = PS_MAX(PS_MIN(Smin, 1.0), 0.1); 1053 // constrain Smin to be in a valid range: allow the fitted range to go a bit beyond the 3 trial points, but no further 1054 float Smx = Sm - 0.25*(So - Sm); 1055 float Spx = Sp + 0.25*(Sp - So); 1056 Smin = PS_MAX(PS_MIN(Smin, Smx), Spx); 1040 1057 PAR[PM_PAR_7] = Smin; 1041 1058 … … 1249 1266 1250 1267 // loop over Reff, keeping the ARatio and Theta constant 1251 for (int j = - 20; j < 21; j++) {1252 1253 float dref = j * 0.0 2;1268 for (int j = -4; j <= 4; j++) { 1269 1270 float dref = j * 0.01; 1254 1271 1255 1272 psEllipseAxes guessAxes; … … 1306 1323 rMin = dref; 1307 1324 } 1308 fprintf (stderr, "%d | %f %f %f | %f %f %f\n", j, dref, Io, Chisq, rMin, iMin, xMin);1325 // fprintf (stderr, "%d | %f %f %f | %f %f %f\n", j, dref, Io, Chisq, rMin, iMin, xMin); 1309 1326 } 1310 1327
Note:
See TracChangeset
for help on using the changeset viewer.
