IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

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

Reorganise so that statistics file gets written out even when we don't make it to the bottom of ppStackLoop().

File:
1 edited

Legend:

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

    r27158 r27160  
    6868    psFree(options->outRO); options->outRO = NULL;
    6969
    70     // Write out summary statistics
    71     if (options->stats) {
    72 
    73         psMetadataAddS32(options->stats, PS_LIST_TAIL, "QUALITY", PS_META_REPLACE,
    74                          "Bad data quality flag", options->quality);
    75         psMetadataAddF32(options->stats, PS_LIST_TAIL, "TIME_STACK", 0,
    76                          "Total time", psTimerClear("PPSTACK_TOTAL"));
    77 
    78         const char *statsMDC = psMetadataConfigFormat(options->stats);
    79         if (!statsMDC || strlen(statsMDC) == 0) {
    80             psError(PS_ERR_IO, false, "Unable to get statistics MDC file.");
    81             return false;
    82         }
    83         if (fprintf(options->statsFile, "%s", statsMDC) != strlen(statsMDC)) {
    84             psError(PS_ERR_IO, false, "Unable to write statistics MDC file.");
    85             return false;
    86         }
    87         psFree(statsMDC);
    88         if (fclose(options->statsFile) == EOF) {
    89             psError(PS_ERR_IO, false, "Unable to close statistics MDC file.");
    90             return false;
    91         }
    92         options->statsFile = NULL;
    93         pmConfigRunFilenameAddWrite(config, "STATS", psMetadataLookupStr(NULL, config->arguments, "STATS"));
    94     }
    95 
    9670    return true;
    9771}
Note: See TracChangeset for help on using the changeset viewer.