IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 27158


Ignore:
Timestamp:
Mar 3, 2010, 1:38:58 PM (16 years ago)
Author:
Paul Price
Message:

Catch case where no input has any sources, so photometry can't be matched; then treat as bad data quality. Reworked how the bad data quality flag gets raised (since there's more than one source now) --- it's carried in the ppStackOptions, and then put in the statistics file at the end.

Location:
trunk/ppStack/src
Files:
7 edited

Legend:

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

    r27157 r27158  
    7070    // Write out summary statistics
    7171    if (options->stats) {
     72
     73        psMetadataAddS32(options->stats, PS_LIST_TAIL, "QUALITY", PS_META_REPLACE,
     74                         "Bad data quality flag", options->quality);
    7275        psMetadataAddF32(options->stats, PS_LIST_TAIL, "TIME_STACK", 0,
    7376                         "Total time", psTimerClear("PPSTACK_TOTAL"));
  • trunk/ppStack/src/ppStackLoop.c

    r27155 r27158  
    8080             psTimerClear("PPSTACK_STEPS"));
    8181    ppStackMemDump("prepare");
    82 
     82    if (options->quality) {
     83        // Can't do anything else
     84        return true;
     85    }
    8386
    8487    // Convolve inputs
  • trunk/ppStack/src/ppStackOptions.c

    r26898 r27158  
    5656    options->convVariances = NULL;
    5757    options->num = 0;
     58    options->quality = 0;
    5859    options->psf = NULL;
    5960    options->inputSeeing = NULL;
  • trunk/ppStack/src/ppStackOptions.h

    r26898 r27158  
    1717    psArray *origCovars;                // Original covariances matrices
    1818    int num;                            // Number of inputs
     19    int quality;                        // Bad data quality flag
    1920    // Prepare
    2021    pmPSF *psf;                         // Target PSF
  • trunk/ppStack/src/ppStackPhotometry.c

    r27004 r27158  
    7272        psErrorStackPrint(stderr, "Unable to perform photometry on image");
    7373        psWarning("Unable to perform photometry on image --- suspect bad data quality.");
    74         if (options->stats && psMetadataLookupS32(NULL, options->stats, "QUALITY") == 0) {
    75             psMetadataAddS32(options->stats, PS_LIST_TAIL, "QUALITY", PS_META_REPLACE,
    76                              "Unable to perform photometry on image", psErrorCodeLast());
     74        if (options->quality == 0) {
     75            options->quality = psErrorCodeLast();
    7776        }
    7877        psErrorClear();
  • trunk/ppStack/src/ppStackSetup.c

    r27004 r27158  
    4848        psFree(resolved);
    4949        options->stats = psMetadataAlloc();
    50         psMetadataAddS32(options->stats, PS_LIST_TAIL, "QUALITY", 0, "No problems", 0);
    5150    }
    5251
  • trunk/ppStack/src/ppStackSources.c

    r27004 r27158  
    127127    float airmassTerm = NAN;            // Airmass term
    128128    float sumExpTime = 0.0;             // Sum of the exposure time
     129    int numGoodImages = 0;              // Number of good images
    129130    for (int i = 0; i < num; i++) {
     131        psArray *sources = sourceLists->data[i]; // Source list
     132        psAssert(sources, "Don't have source list %d", i);
     133        if (sources->n == 0) {
     134            options->inputMask->data.PS_TYPE_VECTOR_MASK_DATA[i] |= PPSTACK_MASK_CAL;
     135            continue;
     136        }
     137        numGoodImages++;
     138
    130139        pmFPAfile *file = pmFPAfileSelectSingle(config->files, "PPSTACK.INPUT", i); // File of interest
    131140        pmCell *cell = pmFPAviewThisCell(view, file->fpa); // Cell of interest
     
    145154        psFree(fake);
    146155#endif
    147 
    148156
    149157        float exptime = psMetadataLookupF32(NULL, cell->concepts, "CELL.EXPOSURE"); // Exposure time
Note: See TracChangeset for help on using the changeset viewer.