IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 32318


Ignore:
Timestamp:
Sep 5, 2011, 8:58:06 AM (15 years ago)
Author:
eugene
Message:

change test for TYPE_STAR to MODE_EXT_LIMIT for selection; use kron flux for S/N test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20110710/psphot/src/psphotExtendedSourceFits.c

    r32240 r32318  
    66    bool status = true;
    77
     8    fprintf (stdout, "\n");
     9    psLogMsg ("psphot", PS_LOG_INFO, "--- psphot Extended Source Fits ---");
     10
    811    // select the appropriate recipe information
    912    psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE);
     
    1215    // perform full extended source non-linear fits?
    1316    if (!psMetadataLookupBool (&status, recipe, "EXTENDED_SOURCE_FITS")) {
    14         psLogMsg ("psphot", PS_LOG_INFO, "skipping extended source measurements\n");
     17        psLogMsg ("psphot", PS_LOG_INFO, "skipping extended source fits\n");
    1518        return true;
    1619    }
     
    301304
    302305        // skip PSF-like and non-astronomical objects
    303         if (source->type == PM_SOURCE_TYPE_STAR) continue;
     306        if (!(source->mode & PM_SOURCE_MODE_EXT_LIMIT)) continue;
    304307        if (source->type == PM_SOURCE_TYPE_DEFECT) continue;
    305308        if (source->type == PM_SOURCE_TYPE_SATURATED) continue;
     
    330333        }
    331334
    332         // XXX deprecate?
    333         // XXX // extFitPars are the non-parametric data measured for this model fit (moments, kron, etc)
    334         // XXX if (source->extFitPars == NULL) {
    335         // XXX     source->extFitPars = psArrayAllocEmpty (models->list->n);
    336         // XXX }
    337 
    338335        // loop here over the models chosen for each source (exclude by S/N)
    339336        psMetadataIterator *iter = psMetadataIteratorAlloc (models, PS_LIST_HEAD, NULL);
     
    346343
    347344          // check the SNlim and skip model if source is too faint
    348           float SNlim = psMetadataLookupF32 (&status, model, "SNLIM_VALUE");
     345          float FIT_SN_LIM = psMetadataLookupF32 (&status, model, "SNLIM_VALUE");
    349346          assert (status);
    350347
    351348          // limit selection to some SN limit
    352349          // assert (source->peak); // how can a source not have a peak?
    353           if (sqrt(source->peak->detValue) < SNlim) {
     350          // limit selection to some SN limit
     351          bool skipSource = false;
     352          if (source->mode & PM_SOURCE_MODE_EXT_LIMIT) {
     353              skipSource = (source->moments->KronFlux < FIT_SN_LIM * source->moments->KronFluxErr);
     354          } else {
     355              skipSource = (sqrt(source->peak->detValue) < FIT_SN_LIM);
     356          }
     357          if (skipSource) {
    354358              Nfaint ++;
    355359              continue;
Note: See TracChangeset for help on using the changeset viewer.