IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 24, 2012, 3:56:18 PM (14 years ago)
Author:
eugene
Message:

merge changes from trunk

Location:
branches/eam_branches/ipp-20120905/psphot
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20120905/psphot

  • branches/eam_branches/ipp-20120905/psphot/src

  • branches/eam_branches/ipp-20120905/psphot/src/psphotSourceMatch.c

    r34354 r34570  
    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.