IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 23211


Ignore:
Timestamp:
Mar 6, 2009, 12:25:41 PM (17 years ago)
Author:
Paul Price
Message:

Cleaning up, reducing threshold for matches.

File:
1 edited

Legend:

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

    r23190 r23211  
    110110        pmReadout *fake = pmReadoutAlloc(NULL); // Fake readout
    111111        pmPSF *psf = psMetadataLookupPtr(NULL, config->arguments, "PSF.TARGET"); // PSF for fake image
    112         pmReadoutFakeFromSources(fake, FAKE_COLS, FAKE_ROWS, sourceLists->data[i], NULL, NULL, psf, 5, 0, false, true);
     112        pmReadoutFakeFromSources(fake, FAKE_COLS, FAKE_ROWS, sourceLists->data[i],
     113                                 NULL, NULL, psf, 5, 0, false, true);
    113114        psString name = NULL;
    114115        psStringAppend(&name, "start_%03d.fits", i);
     
    185186    psArray *sourcesBest = psArrayAllocEmpty (100);
    186187
    187     // XXX something of a hack: require at 2 detections or 1/2 of the max possible
    188     int minMatches = PS_MAX (2, 0.5*num);
     188    // XXX something of a hack: require at least 2 detections or 1/2 of the max possible
     189    int minMatches = PS_MAX(2, 0.3*num);// Minimum number of matches required
    189190    for (int i = 0; i < matches->n; i++) {
    190191        pmSourceMatch *match = matches->data[i]; // Match of interest
    191         if (match->num < minMatches) continue;
     192        if (match->num < minMatches) {
     193            continue;
     194        }
    192195
    193196        // We need to grab a single instance of this source: just take the first available
    194         int nImage = match->image->data.S32[0];
    195         int nIndex = match->index->data.S32[0];
    196         psArray *sources = sourceLists->data[nImage];
    197         pmSource *source = sources->data[nIndex];
    198 
    199         // stick this sample source on sourcesBest
    200         psArrayAdd (sourcesBest, 100, source);
    201     }
    202     psMetadataAdd (sourcesCell->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_DATA_ARRAY | PS_META_REPLACE, "psphot sources", sourcesBest);
    203     psLogMsg("ppStack", PS_LOG_INFO, "Selected %ld sources for photometry analysis\n", sourcesBest->n);
    204     psFree (sourcesBest);
     197        int image = match->image->data.S32[0]; // Index of image
     198        int index = match->index->data.S32[0]; // Index of source within image
     199        psArray *sources = sourceLists->data[image]; // Sources for image
     200        pmSource *source = sources->data[index]; // Source of interest
     201
     202        psArrayAdd(sourcesBest, 100, source);
     203    }
     204    psMetadataAdd(sourcesCell->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_DATA_ARRAY | PS_META_REPLACE,
     205                  "psphot sources", sourcesBest);
     206    psLogMsg("ppStack", PS_LOG_INFO, "Selected %ld sources for photometry analysis", sourcesBest->n);
     207    psFree(sourcesBest);
    205208
    206209    psFree(matches);
Note: See TracChangeset for help on using the changeset viewer.