IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 24, 2012, 8:52:34 AM (14 years ago)
Author:
bills
Message:

In psphotStack add third pass for psphotKronIterate. Here measure kron flux
but not radius for matched sources. The radial momement for these is set to the
minimum of the values for the detected sources for the object

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotSourceMatch.c

    r34354 r34542  
    559559}
    560560
    561 bool psphotDropBadMatchedSources (pmConfig *config, const pmFPAview *view, const char *filerule, psArray *objects) {
     561bool psphotFilterMatchedSources (pmConfig *config, const pmFPAview *view, const char *filerule, psArray *objects) {
    562562
    563563    bool status = false;
    564564
    565     psLogMsg ("psphot", PS_LOG_INFO, "--- psphot Drop Bad Matched Sources ---");
     565    psLogMsg ("psphot", PS_LOG_INFO, "--- psphot Filter Matched Sources ---");
    566566
    567567    psMetadata *recipe = psMetadataLookupPtr (&status, config->recipes, PSPHOT_RECIPE);
     
    615615    psFree(dropped);
    616616
     617    // find the "best" Mrf from the detected sources.
     618    // Currently we use the smallest positive value
     619    for (int i=0; i< objects->n; i++) {
     620        pmPhotObj *obj = objects->data[i];
     621
     622        float minMrf = 1000.;
     623        bool hasMatched = false;
     624        for (int j = 0; j < obj->sources->n; j++) {
     625            pmSource *source = obj->sources->data[j];
     626            if (source->mode2 & PM_SOURCE_MODE2_MATCHED) {
     627                hasMatched = true;
     628                continue;
     629            }
     630            float Mrf = source->moments->Mrf;
     631            if (isfinite(Mrf) && Mrf < minMrf && Mrf > 0) {
     632                minMrf = Mrf;
     633            }
     634        }
     635
     636        if (!hasMatched || minMrf > 120.) {
     637            continue;
     638        }
     639
     640        // set Mrf for matched sources to the value found above
     641        for (int j = 0; j < obj->sources->n; j++) {
     642            pmSource *source = obj->sources->data[j];
     643            if (source->mode2 & PM_SOURCE_MODE2_MATCHED) {
     644                source->moments->Mrf = minMrf;
     645            }
     646        }
     647    }
     648
    617649    return true;
    618650}
Note: See TracChangeset for help on using the changeset viewer.