IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 4, 2011, 1:12:39 PM (15 years ago)
Author:
eugene
Message:

use the smoothed image for footprint culling; use a more stringent culling for saturated stars; more tweaks to get sat stars to be fitted; various updates to psphotStack; unify psphotImageLoop varients; be a bit careful about number of stars in a PSF clump

Location:
trunk/psphot
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot

  • trunk/psphot/src/psphotFitSourcesLinear.c

    r30624 r31154  
    121121    // covarFactor = 1.0;
    122122
     123    int Nsat = 0;
     124
    123125    // select the sources which will be used for the fitting analysis
    124126    for (int i = 0; i < sources->n; i++) {
     
    134136        // do not include CRs in the full ensemble fit
    135137        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        }
    136143
    137144        if (final) {
     
    167174        if (modelSum < 0.8) {
    168175            fprintf (stderr, "low-sig model @ %f, %f (%f sum, %f peak)\n",
    169                      source->peak->xf, source->peak->yf, modelSum, source->peak->flux);
     176                     source->peak->xf, source->peak->yf, modelSum, source->peak->rawFlux);
    170177        }
    171178
     
    179186    }
    180187    psLogMsg ("psphot.ensemble", PS_LOG_MINUTIA, "built fitSources: %f sec (%ld objects)\n", psTimerMark ("psphot.linear"), sources->n);
     188
     189    // fprintf (stderr, "****** Nsat : %d ********\n", Nsat);
    181190
    182191    if (fitSources->n == 0) {
     
    303312    for (int i = 0; i < fitSources->n; i++) {
    304313        pmSource *source = fitSources->data[i];
    305         if (source->mode & PM_SOURCE_MODE_NONLINEAR_FIT) continue;
    306314        pmModel *model = pmSourceGetModel (NULL, source);
    307         pmSourceChisq (model, source->pixels, source->maskObj, source->variance, maskVal, covarFactor);
     315        if (!(source->mode & PM_SOURCE_MODE_NONLINEAR_FIT)) {
     316            model->nPar = 1; // LINEAR-only sources have 1 parameter; NONLINEAR sources have their original value
     317        }
     318        pmSourceChisq (model, source->pixels, source->maskObj, source->variance, maskVal);
    308319    }
    309320    psLogMsg ("psphot.ensemble", PS_LOG_MINUTIA, "get chisqs: %f sec (%d elements)\n", psTimerMark ("psphot.linear"), sparse->Nelem);
     
    324335    // We have to place this visualization here because the models are not realized until
    325336    // psphotGuessModels or fitted until psphotFitSourcesLinear.
    326     psphotVisualShowPSFStars (recipe, psf, sources);
     337    // psphotVisualShowPSFStars (recipe, psf, sources);
    327338
    328339    return true;
Note: See TracChangeset for help on using the changeset viewer.