IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 21260


Ignore:
Timestamp:
Feb 1, 2009, 11:58:32 AM (17 years ago)
Author:
eugene
Message:

select the common sources (at least 2 detections) and save on PPSTACK.OUTPUT:chip for future photometry

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppStack/src/ppStackSources.c

    r21199 r21260  
    146146#endif
    147147
     148    // Save best matches SOMEWHERE for future photometry
     149    // XXX this is a really poor output location; clean up the pmFPAfiles used in ppStack
     150    pmCell *sourcesCell = pmFPAfileThisCell(config->files, view, "PPSTACK.OUTPUT");
     151    psArray *sourcesBest = psArrayAllocEmpty (100);
     152
     153    // XXX something of a hack: require at 2 detections or 1/2 of the max possible
     154    int minMatches = PS_MAX (2, 0.5*num);
     155    for (int i = 0; i < matches->n; i++) {
     156        pmSourceMatch *match = matches->data[i]; // Match of interest
     157        if (match->num < minMatches) continue;
     158
     159        // We need to grab a single instance of this source: just take the first available
     160        int nImage = match->image->data.S32[0];
     161        int nIndex = match->index->data.S32[0];
     162        psArray *sources = sourceLists->data[nImage];
     163        pmSource *source = sources->data[nIndex];
     164       
     165        // stick this sample source on sourcesBest
     166        psArrayAdd (sourcesBest, 100, source);
     167    }
     168    psMetadataAdd (sourcesCell->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_DATA_ARRAY | PS_META_REPLACE, "psphot sources", sourcesBest);
     169    psLogMsg("ppStack", PS_LOG_INFO, "Selected %ld sources for photometry analysis\n", sourcesBest->n);
     170    psFree (sourcesBest);
     171
    148172    psFree(matches);
    149173    if (!trans) {
Note: See TracChangeset for help on using the changeset viewer.