Changeset 30764
- Timestamp:
- Feb 28, 2011, 2:46:40 PM (15 years ago)
- Location:
- branches/eam_branches/ipp-20110213/psphot/src
- Files:
-
- 8 edited
-
psphotApResid.c (modified) (2 diffs)
-
psphotBlendFit.c (modified) (1 diff)
-
psphotChoosePSF.c (modified) (2 diffs)
-
psphotExtendedSourceFits.c (modified) (1 diff)
-
psphotFitSet.c (modified) (1 diff)
-
psphotFitSourcesLinear.c (modified) (5 diffs)
-
psphotFitSourcesLinearStack.c (modified) (1 diff)
-
psphotVisual.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20110213/psphot/src/psphotApResid.c
r30624 r30764 1 1 # include "psphotInternal.h" 2 // # define DEBUG 2 3 3 4 # define SKIPSTAR(MSG) { psTrace ("psphot", 3, "invalid : %s", MSG); continue; } … … 481 482 if (!isfinite(source->apMag) || !isfinite(source->psfMag)) { 482 483 Nfail ++; 483 psTrace ("psphot", 3, "fail : nan mags : %f %f", source->apMag, source->psfMag);484 psTrace ("psphot", 3, "fail : %f, %f : nan mags : %f %f", source->peak->xf, source->peak->yf, source->apMag, source->psfMag); 484 485 continue; 485 486 } -
branches/eam_branches/ipp-20110213/psphot/src/psphotBlendFit.c
r30707 r30764 94 94 fitOptions->weight = PS_SQR(skySig); 95 95 fitOptions->mode = PM_SOURCE_FIT_PSF; 96 fitOptions->covarFactor = psImageCovarianceFactorForAperture(readout->covariance, 10.0); // Covariance matrix 96 97 97 98 psphotInitLimitsPSF (recipe, readout); -
branches/eam_branches/ipp-20110213/psphot/src/psphotChoosePSF.c
r30753 r30764 160 160 options->fitOptions->weight = PS_SQR(SKY_SIG); 161 161 options->fitOptions->mode = PM_SOURCE_FIT_PSF; 162 options->fitOptions->covarFactor = psImageCovarianceFactorForAperture(readout->covariance, 10.0); // Covariance matrix 163 162 164 163 165 psArray *stars = psArrayAllocEmpty (sources->n); … … 178 180 psphotCheckStarDistribution (stars, sources, options); 179 181 180 psLogMsg ("psphot.pspsf", PS_LOG_DETAIL, "selected candidate %ldPSF objects\n", stars->n);182 psLogMsg ("psphot.pspsf", PS_LOG_DETAIL, "selected %ld candidate PSF objects\n", stars->n); 181 183 182 184 if (stars->n < 50) { -
branches/eam_branches/ipp-20110213/psphot/src/psphotExtendedSourceFits.c
r30707 r30764 275 275 // Define source fitting parameters for extended source fits 276 276 pmSourceFitOptions *fitOptions = pmSourceFitOptionsAlloc(); 277 fitOptions->mode = PM_SOURCE_FIT_EXT;277 fitOptions->mode = PM_SOURCE_FIT_EXT; 278 278 fitOptions->saveCovariance = true; // XXX make this a user option? 279 fitOptions->covarFactor = psImageCovarianceFactorForAperture(readout->covariance, 10.0); // Covariance matrix 279 280 280 281 // XXX for now, use the defaults for the rest: -
branches/eam_branches/ipp-20110213/psphot/src/psphotFitSet.c
r29004 r30764 27 27 pmSourceFitOptions *fitOptions = pmSourceFitOptionsAlloc(); 28 28 fitOptions->mode = PM_SOURCE_FIT_EXT; 29 fitOptions->covarFactor = 1.0; 29 30 // XXX for now, use the defaults for the rest: 30 31 // fitOptions->nIter = fitIter; -
branches/eam_branches/ipp-20110213/psphot/src/psphotFitSourcesLinear.c
r30624 r30764 121 121 // covarFactor = 1.0; 122 122 123 int Nsat = 0; 124 123 125 // select the sources which will be used for the fitting analysis 124 126 for (int i = 0; i < sources->n; i++) { … … 134 136 // do not include CRs in the full ensemble fit 135 137 if (source->mode & PM_SOURCE_MODE_CR_LIMIT) continue; 138 139 // XXX count saturated stars 140 if (source->mode & PM_SOURCE_MODE_SATSTAR) { 141 Nsat ++; 142 } 136 143 137 144 if (final) { … … 180 187 psLogMsg ("psphot.ensemble", PS_LOG_MINUTIA, "built fitSources: %f sec (%ld objects)\n", psTimerMark ("psphot.linear"), sources->n); 181 188 189 fprintf (stderr, "****** Nsat : %d ********\n", Nsat); 190 182 191 if (fitSources->n == 0) { 183 192 psFree(fitSources); … … 305 314 if (source->mode & PM_SOURCE_MODE_NONLINEAR_FIT) continue; 306 315 pmModel *model = pmSourceGetModel (NULL, source); 307 pmSourceChisq (model, source->pixels, source->maskObj, source->variance, maskVal, covarFactor );316 pmSourceChisq (model, source->pixels, source->maskObj, source->variance, maskVal, covarFactor, 1); 308 317 } 309 318 psLogMsg ("psphot.ensemble", PS_LOG_MINUTIA, "get chisqs: %f sec (%d elements)\n", psTimerMark ("psphot.linear"), sparse->Nelem); … … 324 333 // We have to place this visualization here because the models are not realized until 325 334 // psphotGuessModels or fitted until psphotFitSourcesLinear. 326 psphotVisualShowPSFStars (recipe, psf, sources);335 // psphotVisualShowPSFStars (recipe, psf, sources); 327 336 328 337 return true; -
branches/eam_branches/ipp-20110213/psphot/src/psphotFitSourcesLinearStack.c
r30624 r30764 165 165 if (source->mode & PM_SOURCE_MODE_NONLINEAR_FIT) continue; 166 166 pmModel *model = pmSourceGetModel (NULL, source); 167 pmSourceChisq (model, source->pixels, source->maskObj, source->variance, maskVal, COVAR_FACTOR );167 pmSourceChisq (model, source->pixels, source->maskObj, source->variance, maskVal, COVAR_FACTOR, 1); 168 168 } 169 169 psLogMsg ("psphot.ensemble", PS_LOG_MINUTIA, "get chisqs: %f sec (%d elements)\n", psTimerMark ("psphot.linear"), sparse->Nelem); -
branches/eam_branches/ipp-20110213/psphot/src/psphotVisual.c
r30753 r30764 845 845 846 846 if (source->type != type) continue; 847 if (mode && !(source->mode & mode)) continue; 847 848 if (mode == PM_SOURCE_MODE_PSFSTAR) { 849 bool keep = false; 850 keep |= (source->tmpFlags & PM_SOURCE_TMPF_CANDIDATE_PSFSTAR); 851 keep |= (source->mode & PM_SOURCE_MODE_PSFSTAR); 852 if (!keep) continue; 853 } else { 854 if (mode && !(source->mode & mode)) continue; 855 } 848 856 849 857 pmMoments *moments = source->moments; … … 1361 1369 graphdata.xmax = +30.05; 1362 1370 graphdata.ymin = -0.05; 1363 graphdata.ymax = + 5.05;1371 graphdata.ymax = +8.05; 1364 1372 KapaSetLimits (myKapa, &graphdata); 1365 1373 … … 1421 1429 graphdata.xmax = +1.51; 1422 1430 graphdata.ymin = -0.05; 1423 graphdata.ymax = + 5.05;1431 graphdata.ymax = +8.05; 1424 1432 graphdata.color = KapaColorByName ("black"); 1425 1433 KapaSetLimits (myKapa, &graphdata); … … 2664 2672 graphdata.ymax = -32.0; 2665 2673 2666 FILE *f = fopen ("chisq.dat", "w");2667 2668 2674 // construct the plot vectors 2669 2675 int n = 0; … … 2683 2689 graphdata.ymin = PS_MIN(graphdata.ymin, y->data.F32[n]); 2684 2690 graphdata.ymax = PS_MAX(graphdata.ymax, y->data.F32[n]); 2685 2686 fprintf (f, "%d %d %f %f\n", i, n, x->data.F32[n], y->data.F32[n]);2687 2688 2691 n++; 2689 2692 } 2690 2693 x->n = y->n = n; 2691 fclose (f);2692 2694 2693 2695 float range;
Note:
See TracChangeset
for help on using the changeset viewer.
